• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[ROM] LineageOS 17.1/18.1 UNOFFICIAL - (Update: 2021-12-19)

Shall F-Droid be included in the ROM(s)?

  • Total voters
Search This thread


Senior Member
Apr 3, 2011
But if i move this file with root explorer (my decice is rooted) it will the same? Will work? Thanks
Yes, I already moved it with root explorer just copy paste in the same location and reboot, works great with Neutron player! Thanks flamefire! Looking forward to you getting that test phone :)


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
What I find confusing: Attached are the original files from the latest SONY ROM. The audio_policy_configuration.xml which AFAIK is the file the new Androids use does not mention 192k output at all. Nowhere!
However the (according to the Google docs) old file audio_output_policy.conf has things like direct_pcm_24 which has 24 bit with 384kHz.

If anyone has information on the actual file formats (i.e. meaning of all that stuff, docs for that are lacking) and how the conf file should be "translated" to the XML format, I'd be grateful. My impression here is that even SONY didn't understand that and translated it only partially. Or I'm missing something...


  • etc.zip
    3.3 KB · Views: 3


Senior Member
Nov 16, 2017
This is my configuration using magisk module "sony audio enhancement" from xperia 10.


  • audio_policy_configuration.zip
    3.4 KB · Views: 13


Nov 24, 2021
I cant connect to any wifi after moving from the stock 9, the only thing I can think of the is the MAC randomizer screwing up but I cant find a way to disable it.


Jul 23, 2009
I cant connect to any wifi after moving from the stock 9, the only thing I can think of the is the MAC randomizer screwing up but I cant find a way to disable it.
go to Settings - Network & Internet - wi-fi - select connected (or stored network) - in network details modify "Privacy" setting. it can be set to "randomized MAC" or "device MAC".



Nov 24, 2021
You can only do that if you are able to connect in the first place.

Anyway, 18.1 works fine so it doesn't matter.


Senior Member
damn it, when I thought 18.1 was perfect, gps isnt working, any clue why?
I have 18.1 installed and mine works but it took about 1-2 mins before I got satellite connections, granted I was inside next to a window when I tested it.
Did you install LineageOS on top of stock firmware 47.2.A.11.228 as instructed on the 1st page? (assuming the GPS requires stock drivers to work)


Nov 24, 2021
No.. I installed 17, couldn't get WiFi to work. So moved to 18 after wiping, now everything but GPS works fine.


Senior Member


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
Just a quick update from me:
I received the test phone from @landsome for which I'm very grateful! Thanks also to everyone who offered help or donated recently or in the past.

This allowed me to continue testing and trying to get a build with November patches working.
However I have to admit that I failed so far. While the October ROM is still flashable and working, trying to flash and boot a more recent build always leads to the phone being stuck at the SONY logo. This affects both the 17.1 and 18.1 builds. I already tried using the vendor-specific commits and the exact same kernel as for the October build which should have solved this, but to no avail.
As the phone is stuck so early I don't know how to debug this or get any logs, which makes it incredibly hard to fix this. I keep on trying but it very much may be possible that the upstream sources (there are almost 800 repositories involved for building this ROM) were updated in a way which makes them incompatible with our phone.

If anyone has any ideas or knows someone who may have some input or knows a way to debug this that would help a lot. It really feels like trying to fix something in pitch-black-blindfold.

Edit: I have the feeling something is really messed up. Neither on Stock Android nor with the (working) October 17.1 build I'm able to do `fastboot boot twrp-3.3.1-0-lilac-android10-1.img` to get into the recovery. Same symptom: Stuck at the logo. Can easily get out though: Hold VolUp+Power until the device reboots.
After flashing TWRP to the recovery partition and booting it via VolDown+Power it works.
But I'm sure that `fastboot boot` has worked when I started with LOS dev and it used to be a good way to test kernel builds. No idea what I'm missing...
Last edited:


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
Next update to keep you guys posted and tell a bit where the donations go:
I was successfully able to reproduce a working ROM at the state of the October build. This is good news because it means at least I'm able to publish a fixed 17.1 version where IMS (VoLTE, VoWifi) works again if the November sources really don't work anymore and more importantly also means I have a starting point to bisect which changeset breaks the boot process. This is still VERY cumbersome but at least something.

This trial&error method would NOT be possible without the test phone, as a failed attempt (soft brick) means I have to completely reset the phone, flash stock etc. which I obviously can't do on my own phone (which I especially now really rely on)
The donations allowed me to upgrade my build machine with more RAM and SSD memory. This was still expensive but due to the donations it wasn't that much any more and at least the RAM (but not the SSD) is also useful for myself as I have my games on another partition on the same PC ;-) The SSD(s) were required as LOS (especially multiple versions) takes a lot of space and having that and the extended RAM allows for faster turnaround times in building making testing a bit easier. For comparison: A full LOS build from scratch on my old machine took ~8hrs, now on my new PC with the extended RAM and SSD I'm down to about 2hrs.

So far... Now comes the painful work of figuring out what breaks the boot.
Still: If anyone has information on how to debug such soft bricks that would help a lot!


Senior Member
Jul 26, 2013
Sony Xperia XZ1 Compact
Good news. How much RAM do you have in the machine now?
32GB. Doubled from 16 which were not enough. The system started swapping during the build which made it much slower and impossible to use it at all. I usually already work on the next issue while the build is running but when the ram is full it becomes impossible to even move the cursor :D
And doubling allows for multi-channel use increasing the total speed

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    The value is not persistent, though, and resets after reboot. @Flamefire do you have an idea how to set it at boot time? (I used to run a script as root, but since my banking app disallows root I don't use Magisk anymore).
    I'm adding a quick settings tile for that. This will basically toggle between normal brightness and reduced brightness (basically scaling the value of the brightness slider)
    I found Android 12 has a similar setting called "Extra Dim" which basically applies a filter to reduce brightness. So I'm reusing their icon and calling it "Ultra-Dim" ;-) If you got a better name, tell me. Will be in the next release together with a self-written LED driver that uses the whole range of the LCD brightness, i.e. it can go lower than stock even without that setting. But not as much as Ultra-Dim does (which likely also saves more battery than the "Extra Dim" from A12)
    Let us know if you manage to work this into the ROM. It seems weird to me that you have a maximum setting that also changes the lower value, since everything is proportional to the max value. Maybe you can set currentStepPercent to go over 100%, or so some other hack so the whole range can be set by the slider. (If I understand this correctly.)
    Checked everything and I don't really see a way. It is quite complicated already. What I found: `echo 1 > /sys/class/leds/wled/brightness` can set the brightness lower than android, which for some reason uses 34 as the minimum but I can't find where this comes from. The config files and everything look good.
    This is still brighter than with fs_curr_ua=5000, but at least doesn't limit the max brightness. And no, fs_curr_ua is a hardware maximum. So no way to turn it to 11 ;) I see if I can add an option to turn down overall brightness, but I don't think it is a good idea.
    Also, I actually found a bug I think, because the reader is also activated on pressing the power button to turn OFF the screen. Just before turning off the display it activates the fingerprint reader, seeing by all kinds of messages from libfingerprint_core.
    I think this is caused by the setting which is left to "on". I guess one of the potential issues of having this enabled (and in the kernel) could be that locking the phone with the power button could unlock it again. Another reason not to do that...
    For now I think it would be great for virtually endless support if we could get something like this working (LineageOS GSI by @AndyYan). Or otherwise the release by @phhusson here on which the former is based. Perhaps then just add the requirement of flashing some patches based on the current release from this thread for the XZ1C's idiosyncrasies and we're good to go?!

    Any thoughts about this? Especially from @Flamefire?
    FWIW: A while ago I updated my device tree repo with literal step-by-step instruction how to build this ROM. The `repo sync` will pull in all LOS changes (i.e. framework/core-Android updates) automatically. Only issues will be changed things related to vendor blobs, like e.g. the camera app that stopped working on 18.1 due to changes in framework. (BTW: I'm currently working on this. If I could only understand how to make a single app use a different VNDK version I could make the camera app work on 18.1). Other issues can occur due to SELinux changes and such, but all of my work is open source, even the patches I developed. So if I get hit by a meteor someone else can take over providing updates ;-)
    Of course updating the Kernel and CAF modules is still something that needs to be done manually when updating the ROM.

    About the GSIs: Not fully sure how they work. I guess they basically replace the /system partition while leaving /vendor untouched. Hence I assume everything copied from Stock to /system will be removed which is the reason for the issues you see. I.e. everything listed in `proprietary-files.txt` got to be checked and things to be kept for GSIs moved to the vendor partition so it "survives" GSI updates. Might be possible, but I'd need confirmation that this will be really enough before doing that work.
    Also note that all the added goodies from this ROM will be gone, e.g. SNet fix, and would need other methods to achieve that.
    Screen brightness
    The value in the file
    /sys/devices/soc/800f000.qcom,spmi/spmi-0/spmi0-03/800f000.qcom,spmi:qcom,[email protected]:qcom,[email protected]/leds/wled/fs_curr_ua
    sets the LED current in uA of the background illumination. It defaults to 17500.

    By writing a lower value, one can achieve a decreased minimal brightness, which is easier on the eyes when reading at night. I found a value of 5000 to be fine:
    adb shell "echo $VALUE > $FILE"

    The maximum brightness with this setting also is sufficient when outside, I think.

    The value is not persistent, though, and resets after reboot. @Flamefire do you have an idea how to set it at boot time? (I used to run a script as root, but since my banking app disallows root I don't use Magisk anymore).

    Beware that values below 2500 turn the LEDs off, so without an adb connection, you'd need to hard reboot the phone.
    To be correct: It sets the maximum current in µA of the LEDs, as can be seen by in the kernel sources
    So the currently used current (and hence brightness) is then (likely, the code is hard to follow): `currentStepPercent * fs_curr_ua` where `currentStepPercent` is the percentage of the current brightness step, i.e. where the slider is proportional to the max value and likely capped to a min-value. There doesn't seem to be a way to control this setting from Android as it seems the brightness level is (fully) kernel controlled.
    So changing this setting will yield an overall reduced brightness! I'll double check if I can maybe extend a setting or otherwise change the minimum brightness only.

    Anyway: This issue has made me find an actual bug in the kernel code which I resolved. Probably nothing major or noticeable at all, but still a bug ;)

    Oh and if you want to change it manually persisting reboots (but not updates), see https://forum.xda-developers.com/t/lower-the-default-minimum-brightness.3938897/ which looks like it will work to me.
    Sorry to bother again, but I found this regarding the Fingerprint Wake and Unlock issue:

    So, this can be implemented by a change in the SystemUI apk and recompile.
    Is it possible you do this, @Flamefire, since modpunk doesn't support 17.1 anymore?

    EDIT: Since I just realised you said you like the way it works now and this is the build you use on a daily basis, is it possible you create a setting to adjust this behaviour for ourselves?
    I still don't understand your issue. Touching the fingerprint sensor while the lockscreen is shown will unlock the phone. This totally makes sense to me.
    For some reason you want to see the lockscreen without unlocking the phone. So why doesn't one of the proposed alternatives work for you? E.g. using the camera button or a non-registered finger or not touching the sensor "to long".

    I don't really understand the mentioned setting: "Should we listen for fingerprints when the screen is off?"
    If I touch the sensor with the screen off nothing happens. However I guess it makes sense to disable this setting anyway. I just doubt it will change anything as it seemingly only applies when the screen is off, not when it already is on, i.e. you already pressed the power button. Will check though...

    Edit: I checked back with stock, specifically "G8441_Customized DE_47.2.A.11.228-R3C". If I press the power button with a registered finger the phone basically immediately unlocks. It does not (and shows the clock) if I use my fingernail or press the power button and lift the finger fast enough. Short pressing the camera button does nothing, long pressing starts the camera. I didn't find any setting to change that.
  • 40
    LineageOS 17.1/18.1 for Sony Xperia XZ1 Compact



    This is an alternative ROM for the Sony Xperia XZ1 Compact.

    Creating this to honor the great work of modpunk and derf elot from https://forum.xda-developers.com/t/rom-lineageos-18-1-unofficial-2-0-update-2021-01-20.4047763/ which seems to be discontinued. Posting an own thread to keep the latest versions visible, I'm NOT claiming authorship over the ROM.
    I basically just build the ROM using the latest changes from upstream LineageOS/Google and kernel updates (usually incorporated by derf elot ) See my post.

    • Signed with dev keys
    • EAS kernel
    • Passes SafetyNet out of the box (thanks Rooted_Ansh, Havoc-OS Team and kdrag0n)
    • Seedvault (Video)
    • IMS support (thanks to Rooted_Ansh and also Shujath)
    • 17.1 has stock Sony camera (not possible on 18.1)


    You can download the latest release here.
    HINT: Download both the ZIP and md5sum file so TWRP can check the consistency of the upload/download.
    REQUIRED FIRMWARE: 47.2.A.11.228

    I only test the 17.1 releases myself. The 18.1 are build from mostly the same sources and hopefully work.


    Put the zip file of the ROM on you sdcard or internal store and boot into recovery.
    I suggest to use modpunks TWRP recovery. Again: Don't forget the md5sum file!
    TWRP 3.3.1-0 by modpunk for LineageOS 17.1
    TWPR 3.5.0-0 by derf elot for LineageOS 18.1
    Or use the latest TWRP from https://twrp.me/sony/sonyxperiaxz1compact.html.

    For ease of use I suggest to flash this recovery (only required once):
    1. Boot in Fastboot mode: Hold "Volume Up" while connecting the USB cable to phone and PC
    2. Flash TWRP by running this on the PC: fastboot flash recovery twrp-3.3.1-0-lilac-android10-1.img
      (adjust the filename if necessary)
    3. From now you can boot TWRP by turning on the phone with "Volume Down" + Power
    I heavily recommend to make a full backup before any installation so you can go back in case of issues. Flashing an older ROM usually helps to recover bootloops etc.

    • UnifiedNlp doesn't work with LineageOS 18.1 yet
    • Spell checking doesn't switch if you change keyboards

    There is NONE. If you have any issues or question ask in the thread so maybe someone else knows the answer.
    I'm just providing the ROM (Lineage 17.1 variant) I use myself for others to try to and just build the Lineage 18.1 ROM without much testing.
    If you prefer to use a more well-tested Android 11 ROM, I suggest to look at Havoc-OS.
    Contributions to the sources are welcome and likely get integrated into the next release.

    modpunk, derf elot, Rooted_Ansh, Flamefire, linckandrea
    Source Code: https://github.com/Flamefire/android_device_sony_lilac, Original: https://github.com/whatawurst/

    If you want to buy me a coffee/beer, I'll appreciate it but it is not necessary.
    Also please consider donating to the original authors too or to local charities as requested by @modpunk

    Special thanks to landsome for donating a test phone for bug hunting and development.

    ROM OS Version: Android 10/11
    ROM Kernel: Linux 4.4.x
    Based On: LineageOS

    Version Information
    Stable Release Date: 2021-12-19


    • December security patches
    • Kernel 4.4.295
    • QCom driver updates
    • Fix some permission issues
    • Reset phone ID to XZ1C
    • November security patches
    • Kernel 4.4.291
    • Fix IMS on 17.1
    • Fix/enhance Wifi-Display
    • Fix some power hints
    • Update APNs
    • October security patches
    • Kernel 4.4.288
    • September security patches
    • Include some more security patches from AOSP
    • Clang 11 for LOS 17.1 version (same as 18.1, improved optimizations)
    • Misc bugfixes backported from Android 11 to Android 10
    • Kernel 4.4.283
    • August security patches
    • Fix bug with switch 3G->4G in XperiaParts not working on slow boot
    • Include some more security patches from AOSP
    • Kernel 4.4.279
    • July security patches
    • Kernel 4.4.275
    • June security patches
    • Update to Linux Kernel 4.4.272
    • Updated APNs
    Updates are out!
    Gabeldorsche seemingly works on my test phone, so maybe some upstream change already fixed it.

    Anyway, wish you all an (early) Merry Christmas and Happy New Year!
    Currently uploading the new builds. Gonna take a bit...
    The 18.1 version seemingly works, passes SafetyNet etc. but as usual, I don't really test that version although I can now say that it flashes clean over the previous release and boots fine. Thanks to the test phone by @landsome
    I tested the 17.1 version the same way: Flash over previous release, boot and SafetyNet is working. However I'll flash that on my own phone tomorrow and test it a bit more "in production". Hence you'll find that in the "Testing Only" folder on AFH until I verified it a bit more. No time left for that today but if you want to give it a try feel free.
    As mentioned I fixed the IMS bug on 17.1 and on my phone (October build with only that patch applied) VoLTE and VoWIFI work fine.

    As for GPS: The XZ1C has known hardware issues with the GPS antenna. The ROM if flashed correctly works ok although I noticed that GPS is shaky too. Some users reported that squeezing the left edges often helps...

    I'll tackle the HD audio stuff later. That needs some more work to do it properly.

    Donations: See the initial post and my profile (About section). Always welcome and keeps me motivated to put in a bit of extra effort :) Please note that I often integrate changes from others, like modpunk/derfelot, linckandrea etc. On Github you can usually see that as "authored by X, committed by Flamefire" as I try to keep the author unchanged. So others deserve credit (and donations) too.
    I'm writing this from my phone updated to 17.1 November build. Hence I consider it stable :)

    December update will be there mid December, I'd say. Not sure if I manage to fix HD audio till then

    So far, wish you a nice Advent season!