• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[ROM] [11] LineageOS 18.1 [OFFICIAL]

Search This thread

drater2

Senior Member
Nov 22, 2018
63
6
Sony Xperia XZ Premium
Hello.
I don't know if this is directly related to the rom, so please just delete this if it doesn't belong here...
But does this rom support MicroG? - or is it possible to make it work somehow if it isn't supported officially?
Best regards
 

hotcakes_shinku

Senior Member
Sep 27, 2016
56
16
Xperia XZ2
starting with 18.1, i notice that my xz2 is having problems with mesh wifi. It disconnects from 5ghz and connects to 2.4ghz when i move rooms that has poor 5ghz. But it doesn't reconnect to the 5ghz when i move back to the room where the 5ghz signal is strong.

AAC audio for my bluetooth headphones is also missing now.

This wasnt an issue with 17.1
 
Last edited:

Smarticus

New member
Jul 13, 2016
2
0
Hi, someone knows a method to upgrade from lineage OS 17.1(20210519) to 18.1 without using ADB maybe with the recovery. This because my XZ2 is not recognized by none of my computers in the house. I've already spent a lot of time trying to fix the connection using drivers, ADB, etc. but it doesn't work if there is no way to update without using ADB then I'll stick to 17.1. Last but not least, thank you Sjll and Olivier for all the time invested in this device forgotten by Sony. Looking forward for answers, thanks.
 

seilent

Senior Member
Jun 11, 2010
294
232
28
Xperia XZ2
Hi, someone knows a method to upgrade from lineage OS 17.1(20210519) to 18.1 without using ADB maybe with the recovery. This because my XZ2 is not recognized by none of my computers in the house. I've already spent a lot of time trying to fix the connection using drivers, ADB, etc. but it doesn't work if there is no way to update without using ADB then I'll stick to 17.1. Last but not least, thank you Sjll and Olivier for all the time invested in this device forgotten by Sony. Looking forward for answers, thanks.
PC won't detect at all? like there's no sound of connected usb device?
IF there PC still somehow detect that something is connected but no driver for it, you can try use zadig to install the driver

but if there's 0 sign, maybe try using usb C to C cable, then use C to A adapter. Since my phone won't detect if I use normal usb cable for some reason, so just a bit of personal experience
 

joska59

Senior Member
Oct 20, 2007
58
6
Hi.
In some roms, I could find the possibility to reboot into recovery. Any chance, to realize that? Wasn't in LOS 17.1?

In LOS-recovery, I'd found sometimes possibility to flash zip-files from sd-card, sometimes not. What is the reason for that?

Regards, Joska
 

joska59

Senior Member
Oct 20, 2007
58
6
@trinhloivn
As I know, the xz2 has no recovery partition. So, twrp would bei erased by flashing LOS. I die so in past. The link leads to twrp for stock.
The reboot-choice was part of the rom, not of recovery.

The observation that sometimes a selection of files was also possible from the sd card, but sometimes only via adb-sideload, I made in LOS-recovery. If I could find that again, I would no need a twrp.
If not, I need a twrp that is compatible with this rom.
 

Smarticus

New member
Jul 13, 2016
2
0
Fortunately, I could upgrade via microsd with the LOS Recovery. I feel super smooth the LOS 18.1 and many of the tiny problems that I had in LOS 17.1 like not history in youtube or bad quality in photos have been resolved in LOS 18.1. Thanks again Sjll and Olivier for all the time invested in this device. @seilent when I connect to pc there is sound and notification that said "unknown usb device descriptor request failed" totally are the drivers but until now I can't fix it. Thank you for zadig I did not know about that program unfortunately didn't work whit the xz2 but could be useful in the future. @joska59 Hi, I think LOS recovery maybe has a bug or something because like you the LOS recovery in the section update at the beginning did not show me an option to update (flash zip) from SDcard only from ADB. But if you restart from recovery to recovery appears like magic always unplugged from AC and with more of the 80% of battery. That in my case because plugged to AC never work super weird but the option is there I know because I upgrade thaks to that option and flash mindGapps all from a microSD in exFat. :)
 

서수빈

New member
Jun 5, 2021
2
0
Hi.
In some roms, I could find the possibility to reboot into recovery. Any chance, to realize that? Wasn't in LOS 17.1?

In LOS-recovery, I'd found sometimes possibility to flash zip-files from sd-card, sometimes not. What is the reason for that?

Regards, Joska
You need to enable dev options and then search for advanced restart to enable the restart options like boot into recovery, bootloader.
 

joska59

Senior Member
Oct 20, 2007
58
6
Which option didnt you found, dev options or advanced restart?
advanced restart, or "erweiterter Neustart" in german. I'd used that in different roms in past, but in LOS 18.1, I didn't find it, BUT, tata, you gave me a hint and the solution is near. Surching for "advanced" wasn't succesful, but surching for "erweitert" lead me to the missing link. It is located under "Einstellungen/System/Gesten und Bewegungen/Ein-/Aus-Menu/Erweiterter Neustart". No connection zu Developer Options, where it was ever.
Never change a running system, but this seems to be typical for adroid ;-)

Thank you, problem solved.

Regards, Joska
 
Last edited:

trinhloivn

Member
Apr 18, 2021
20
2
2okPze5.png

Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
About LineageOS
LineageOS is a free, community built, aftermarket firmware distribution of Android 11.x (R),
which is designed to increase performance and reliability over stock Android for your device.

All the source code for LineageOS is available in the LineageOS GitHub repo.
And if you would like to contribute to LineageOS, please visit our Gerrit Code Review.

Official LineageOS website : http://lineageos.org
About LineageOS Legal : http://lineageos.org/legal/

Important Information
1. This ROM has nothing related to ODM images! So you don't need to ask/install anything like that, just follow the instructions.
2. This ROM will never work with any versions of Google Camera (GCam)!
3. You need to flash Stock Android 10 before flashing this ROM.
4. For VoLTE, you need to boot into stock firmware and enable it before flashing this ROM!


Downloads Links
LineageOS website

Google Applications (optional):
MindTheGapps
Information: Flash the GApps before the first boot. If not, a clean flash is recommended.

Flashing and updating
How to flash

Make sure you are upgrade to Official Android 10.0 from Sony
Unlock bootloader is necessary.
To disable AVB 2.0 using fastboot:
Code:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
For vbmeta.img, you can download it anywhere you found.
More steps see wiki

Never flash oem from SODP!!
If you flashed oem and meet any issues, I could only say you are a hanhan.

Root access:
Flash Magisk in recovery.

Twrp:
You could download it here: Link
Code:
fastboot boot twrp.img

Issues and reports

Report issues only if you are using the ROM kernel
If an additional mod is installed, make sure it's unrelated, and mention it
Make sure the issue wasn't discussed earlier in the threads
Share a log of the error with CatLog for example

Also thanks to:
Olivier
Luk1337
The LineageOS Team
The CyanogenMod Team
The SODP Team
Everyone involved in working and testing

XDA:DevDB Information
Lineage 18.1 for Xperia XZ2, ROM for the Xperia XZ2

Contributors
Sjll, Olivier
Source Code: https://github.com/sony-sdm845

Donation
https://paypal.me/sjllls

ROM OS Version: Android 11
ROM Kernel: Linux 4.9
ROM Firmware Required: Official Android 10.0 firmware
Based On: LineageOS

Version Information
Status:
Stable

Created 2020-11-27
Last Updated 2021-05-26

System > gestures > power menu or simply use search function in settings
thanks u
 
  • Like
Reactions: shoey63

jediknight23

Senior Member
May 1, 2014
56
5
Any idea how to enable the Browser history per tab when holding the back navigation button?

In Settings I find "Back long press action", but no suitable option within...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Sorry, I should've been more specific. I do use UAPP for local music playback, and it works fine. I think this is because it uses its own usb dac driver, not the one built into android.

    I'm testing out Apple Music, which has rolled out lossless and High Resolution recently. When testing a 192Khz track, my dac doesnt indicate 192Khz is playing. Note that it just lights up different colors to show what mode it is playing back in, so I can't tell exactly what mode it is since 44.1-96khz use one color. The rest use other colors, so I can confirm 192Khz is not being used

    (deleted below)
    Hello @hotcakes_shinku.
    Although I don't have Xperia's, I made a script to change the USB sample rate (for UAC drivers) on the fly like MacOS or bluetooth LDAC. This script was made for Galaxy S4 (LineageOS 18.1) and GSI's (A10 and A11) for avoiding annoying SRC distortion, but it could work for Xperia.

    Under Magisk environment (changing its root name space mount mode to global needed), expand the attached zip file under "/sdcard" and execute this script.

    Usage: sh /sdcard/USB_SampleRate_Changer/USB_SampleRate_Changer.sh --offload [[44k|48k|88k|96k|192k] [[16|24|32]]]

    I recommend to use Script Manager or something for easiness.

    Enjoy it!

    Edit: almost music streaming apps like Apple music, Spotify, etc. are using a UAC (USB Audio Class) 2.0 driver which usually connects to DACs with 96kHz 32bit mode. My script changes this sample rate and bit depth on the fly. You can see its connected sample rate and bit depth by a command, "dumpsys media.audio_flinger".
    Search "USB HEADSET" in the result of the command.

    Edit2 (fixed): I found XZ2 uses USB audio hardware offloading instead of usual (legacy?) USB audio module. Its sample rate range is 44.1kHz to 192kHz, but XZ2's audio policy fixes its rate at 48kHz (16bit) now. I added its support (experimental) to my script (V1.2.1). Under selinux enforcing mode, this script hadn't been used. This bug was fixed in V1.3.
    1
    Your rom is amazing. Phone not hot while idling, geekbench scores are what to expect from SDM845. But there's one thing bothering me. Is there any way to have stock-like vibration back? Like when typing something in stock ROM, it feels like you're actually pressing a key, not just buzzing. Please let me know whether it's possible or not. Thanks.
    1
    Thanks for the info and links. I just found time to test this out sorry.

    Using the cat /proc/asound/card1/pcm0p/sub0/hw_params from your github page, I can confirm that my usb dac is stuck in 16/48 mode while playback with Apple Music. Using your script and setting to 96khz, it is still stuck in 48khz.

    After installing your unlocker magisk module, tested higher than 96khz reports 96khz lock error, and its still stuck in 48khz when testing 96khz.
    I checked Akari's source codes, and found its /vendor/etc/audio_policy_configuration.xml was a bit bizarre. The sample rate of USB headsets ("USB Headset Out") is fixed 48kHz 16bit or 24bit. But /vendor/etc/audio_policy_a2dp_offload_disabled.xml is common among other Android devices. If you can disable "a2dp_offload", you could use my USB_SampleRate_Changer script. Otherwise you must rewrite the XML file if you need.
    XML:
    From audio_policy_configuration.xml,
    
    ...(deleted)
    <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST">
       <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                       samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
    </mixPort>
       ...(deleted)
    <devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink">
    </devicePort>
       ...
    <route type="mix" sink="USB Headset Out"
      sources="primary output,raw,deep_buffer,compressed_offload,hifi_playback,
      mmap_no_irq_out,voip_rx"/>
       ...(deleted)
    1
    The Disable Bluetooth A2DP hardware offload toggle in Developer options is off by default. Toggling it does nothing, it asks to restart, but stays off after a restart.

    I think I'll refrain from modifying the xml file. It might have been done for compatibility with LOS 18.1, as this wasn't a problem in 17.1.

    Thanks for looking through the source code and confirming my problem.
    In #108, I attached an updated USB_SampleRate_Changer supporting (USB) hardware offloading (44.1kHz to 192kHz 16,24,32bit modes) like XZ2. If you like, try this script with "--offload" option. In details, see README.md in the attached zip. This script never change system files, so you can revert to the state before executing this script whenever rebooting your device or using "--reset" option.
    1
    Which is the best camera app for lineage os?
    Open Camera all the way :) IMHO

  • 17
    Good news, we will go 18.1 official in next week.
    12
    2okPze5.png

    Code:
    #include <std_disclaimer.h>
    /*
    * Your warranty is now void.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about features included in this ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    */
    About LineageOS
    LineageOS is a free, community built, aftermarket firmware distribution of Android 11.x (R),
    which is designed to increase performance and reliability over stock Android for your device.

    All the source code for LineageOS is available in the LineageOS GitHub repo.
    And if you would like to contribute to LineageOS, please visit our Gerrit Code Review.

    Official LineageOS website : http://lineageos.org
    About LineageOS Legal : http://lineageos.org/legal/

    Important Information
    1. This ROM has nothing related to ODM images! So you don't need to ask/install anything like that, just follow the instructions.
    2. This ROM will never work with any versions of Google Camera (GCam)!
    3. You need to flash Stock Android 10 before flashing this ROM.
    4. For VoLTE, you need to boot into stock firmware and enable it before flashing this ROM!


    Downloads Links
    LineageOS website

    Google Applications (optional):
    MindTheGapps
    Information: Flash the GApps before the first boot. If not, a clean flash is recommended.

    Flashing and updating
    How to flash

    Make sure you are upgrade to Official Android 10.0 from Sony
    Unlock bootloader is necessary.
    To disable AVB 2.0 using fastboot:
    Code:
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
    For vbmeta.img, you can download it anywhere you found.
    More steps see wiki

    Never flash oem from SODP!!
    If you flashed oem and meet any issues, I could only say you are a hanhan.

    Root access:
    Flash Magisk in recovery.

    Twrp:
    You could download it here: Link
    Code:
    fastboot boot twrp.img

    Issues and reports

    Report issues only if you are using the ROM kernel
    If an additional mod is installed, make sure it's unrelated, and mention it
    Make sure the issue wasn't discussed earlier in the threads
    Share a log of the error with CatLog for example

    Also thanks to:
    Olivier
    Luk1337
    The LineageOS Team
    The CyanogenMod Team
    The SODP Team
    Everyone involved in working and testing

    XDA:DevDB Information
    Lineage 18.1 for Xperia XZ2, ROM for the Xperia XZ2

    Contributors
    Sjll, Olivier
    Source Code: https://github.com/sony-sdm845

    Donation
    https://paypal.me/sjllls

    ROM OS Version: Android 11
    ROM Kernel: Linux 4.9
    ROM Firmware Required: Official Android 10.0 firmware
    Based On: LineageOS

    Version Information
    Status:
    Stable

    Created 2020-11-27
    Last Updated 2021-05-26
    5
    Glad to tell everyone who are waiting for LineageOS 18.1.
    I uploaded the 20210515 build for Akari, but I don't have device to test.
    From the result on XZ3, everything works fine.
    Please test and feedback, if there is no bug, we will get official 18.1 support sson.
    5
    If so, why does installation of ROM and gapps in same routine lead to missing gapps? Why is it necessary to reboot after installation of ROM in recovery. Excuse me, but I feal, I'm to sill yto understand ;-(
    The XZ2 is an A/B device, i.e. it has two system partitions (one in slot A, one in slot B). This has the advantage that an update of the system can be done by the user while he is still using his device. No long pause for the update is required. Just a quick reboot at the end of the process to switch slots, and that's it.

    When such an OTA update comes in or a ROM gets installed via TWRP, then the update gets installed on the currently inactive slot. Let's assume slot A is currently active and we want to install a custom ROM, then the new ROM will get installed in the inactive slot B. This slot then gets marked as the one to boot from on the next restart. Now, to my understanding (otherwise people should please correct me), other zips, like GApps, always get installed into the currently active slot. Since slot A is still active, but you want to have the GApps installed for the new system in slot B, you first have to make slot B active. This can be done by a restart into recovery, because slot B was just marked as the one to become active on next boot. After the reboot into recovery slot B will be active and the installation of GApps will then be done for this now active slot B - which is exactly what we wanted.

    Btw., this procedure is this way not only for the XZ2 but for any A/B device.

    Hope this helps
    5
    So latest build is 18.0 from November?
    Seems a big pause in development.
    I will try building with the 18.1 sources on Lineage GitHub and see what happens.....

    Edit: Fixed the build errors but it wont boot and devs seem to have moved on.
    Back to 17.1 nightlies