yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
To install stock firmware you need

1. The Xperifirm app to find and download the firmware version you need - see this thread

2. A tool to flash the firmware. That guide mentions NewFlasher which is a command-line app. I have used a GUI app called FlashTool to flash stock firmware on severeal Sony devices, including XZ1C. You can download flashtool for your platform here, then follow this turorial to flash the firmware you downloaded

I hope that helps
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Thank you! I will give that a go. There is no link linked where you have written 'this thread' - could you please provide the link?

Thanks!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tickertapes:
I recently bought a brand new XZ1c for permanent use in my car for android auto services. Straight out of the box I flashed L-OS-20 along with all the Google apps. Everything worked like a dream with the exception of cellular and wifi connectivity. If I pulled the SIM I'd get good reliable Wifi.

I searched many threads on this topic and spent hours and hours trying to get to the bottom of it. I tried L-OS-19, 16 and 15 and the crazy behavior persisted. Running L-OS of any version essentially made my XZ1c useless as a phone.

It would appear that the vast majority of people do not have this problem with their radios at all, while some have very slight issues and others are severely impacted.

I considered the possibility of different hardware revisions but thought this to be unlikely.

Anyway, yesterday I had a breakthrough. I noticed that my baseband firmware was very old as was shipped from the factory.

I flashed the latest stock firmware from Sony (Pie) and my radios worked perfectly, I also noticed that my baseband firmware was of a much later revision.

I still had TWRP and some ROM's on my SD card and quickly flashed back to L-OS-20 and BINGO!!!, I have rock solid LTE, VoLTE and Wifi.

I hope this finally brings an end to everyone's #XZ1 Compact, #Cellular, #SIM card and radio issues.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Sorry - I've corrected the post. The link is https://xdaforums.com/t/tool-xperifirm-xperia-firmware-downloader-v5-6-5.2834142/
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
So what version is your baseband now? Mine is showing as '8998--8998-.gen.prodQ-00278-47'

And where did you get the stock firmware, and which version?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tickertapes:
Looks like I'm on exactly the same revision as you now.

Are you having issues?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
No, just curious :) I've been using (and building) different custom ROMs for this device (based on @whatwurst's code), and I sometimes find myself trying to help others who do have issues. This might help some of them.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tickertapes:
It looks like there were about 15 firmware's that Sony released for this phone. I'd imagine the vast majority of people received all of the OTA updates before migrating to L-OS but a small number made the transition early or just didn't bother with all the Sony updates.

Do you know if there's a way to get this device to boot when USB power is applied?

I've tried "fastboot oem off-mode-charge 1" which appears to be invalid.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Sorry I have no idea
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] anarki@butterblume:
https://xdaforums.com/t/rom-lineageos-17-18-19-unofficial-update-2023-08-26.4308295/
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Thank you. Sorry, I cannot see any older firmware versions only versions of the latest 47.2.A.11.228. Do you know of any way how to display older firmware versions (which I would need to downgrade to in order to be able to backup TA partition)?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Do you think it's worth me continuing pursuing trying to downgrade in order to backup TA partition even when it seems it's not so obvious/easy to do, or should I just go ahead and flash LineageOS 20 and be done with it?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
I think I did it for one of my phones, in case I ever wanted to sell it. If you plan to keep it, or if you are happy to try and sell it as 'bootloader unlocked', then it's not worth the hassle of downgrading. And if you do decide you don't want to keep the phone, there may be someone in this thread who would buy it from you ;)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
There's no way to relock the bootloader of the XZ1c, so even if you save (and/or restore) the TA, it will always have the boot warning and be unlocked - even if running a stock ROM.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] casouzaj:
It's the same for the Tama platform (XZ2, XZ2C, XZ3). Unlocking is forever! I think Sony changed this behavior on the next iteration forwards (1, 5, 10, and subsequent Mark II to V).
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
Ah, that's nice. It might actually make me consider a Xperia phone again...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Ok thanks for your inputs! I'll try and go ahead without backing up the TA partition.

Although, I saw this reddit post from 7 months ago and 1 month ago respectively (below) suggesting that the camera wouldn't work if not backed up and restored, but I suppose maybe that's been fixed since then.

Does NFC work on LineageOS 20?

Ok, how do I go about starting the process of getting LineageOS on the device? I have downloaded all the tools at the top of this thread but can't see any directions as to what to do
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
If you follow the LOS guides for Xperia Z5 Compact (suzuran), you won't go far wrong

The Special boot modes are as secribed at https://wiki.lineageos.org/devices/suzuran/#special-boot-modes

Instructions for unlocking the bootloader on the Sony Open Devices web site https://developer.sony.com/open-source/aosp-on-xperia-open-devices/get-started/unlock-bootloader/

Installation instructions at https://wiki.lineageos.org/devices/suzuran/install

Make sure you get the correct TWRP recovery - see first post in this thread
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Great, thank you! I'll have a crack at that now then. Any pointers as to how to install TWRP and boot into TWRP recovery? I've had a look, but I'm not sure exactly how to get it installed in the first place so that booting into it is possible

Do I need to unlock the bootloader before installing TWRP? Sorry for the questions
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
When I tried to install the drivers as directed in the instructions here and here with my XZ1 Compact connected to the computer, I was met with the following message
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
'fastboot flash recovery <name of twrp recovery file> `

e.g. `fastboot flash recovery twrp-3.6.2_12-0-20221002-lilac.img’

With device powered foo, hold Volume down and press power
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
According to this it says I can't unlock the bootloader. Is this expected and there is a workaround or?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Not that I know of - sorry!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Zayeah:
Damn! That's ok, not your fault, but does everyone else in this thread whose been able to install a custom ROM have the bootloader unlock allowed option as yes (and I've been unlucky somehow and it's no)? 😬 Seems strange/unlucky!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
I have a vague memory that in order to unlock the bootloader you must connect (or maybe be actively connected?) to the the internet.

So depending on the current state of your device (perhaps freshly reset, no access points) it could be worth trying.

If, on the other hand, you have a Docomo model, then I don't believe those are unlockable.

But yes, you need that setting on true in order to be able to run the fastboot command to do the unlock.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] victor126:
if i remember correctly go to developer options and turn on oem unlock
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Building IodéOS for `lilac` using the Whatawurst repos, I am seeing the following build error

In file included from hardware/qcom-caf/wlan/qcwcn/wifi_hal/sync.h:19:
hardware/qcom-caf/wlan/qcwcn/wifi_hal/common.h:226:5: error: unknown type name 'wifi_iface_concurrency_matrix'

I started with a clean source tree, and no problems with the `repo sync`, `source build/envsetup.sh` ,or `lunch`.

Any ideas?

The IodéOS code is building OK for a different device. I can't see any recent commits in the Whatawurst repos, so I'm a bit stuck!

Any ideas?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
That's not the case. You unlock the bootloader using `fastboot`, the device must be running in `fastboot` mode, so no iternet connection is possible

If the service menu shows that bootloader unlocking ***is not*** allowed, then that option will either not be present in developer options, ow will be greyed out. As mentioned in the Sony instructions, you do have to enable Developer options, and turn on USB debugging

Yes they do. You are unlucky because not all of these devices allow bootloader unclocking. Some device vendors (i.e. network operators) don't allow bootloader unlocking so, for example, if your phone was originally locked to a specific network (.e. Vodafone, T Mobile) then you will not be able to unlcok the bootloader, ***even if the network*** lock is removed. You need to buy a phone that is 'factory unlocked' rather than 'network unlocked'.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
I apologize. In my haste, I skipped a step.

Of course you unlock the bootloader via fastboot, without the internet.

But in order to unlock the bootloader, you need the "bootloader unlock allowed" setting set to 'yes'. And in order to that - you must be connected to the internet.

Perhaps a more accurate previous statement would have been "I have a vague memory that in order to toggle the bootloader unlock setting, you need to be connected to the internet".

Here one such post referencing it:

https://xdaforums.com/t/how-unlock-sony-xperia-xz1-bootloader.3758742/post-78040113

and I distinctly remember trying to unlock a freshly wiped phone and not being able to ... until I turned on the wifi and connected it.

While it's possible this particular device is carrier locked, it's at least worth them trying it out.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Again, I don't believe that is the case. I can toggle the option on my device whether or not I have an internet connection

Nothing in that post (that I can see) says you need to be connected

Everything is worh a try ;) but if the service menu says that bootloader unlocking is not allowed, then I'm pretty sure it won't work
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] tonsofquestions:
Well, there is the part where it says

I imagine that if the setting is enabled (or it has cached that it's editable) then you can switch it off and on again without issue. Or perhaps it's a distinction between the service menu setting and the one in the developer options.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] victor126:
usb debugging lol its been awhile since i did a bootloader unlock.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Dfis:
Hi!

Thanks a lot for the 1.4 firmware! Works great! :)

I've noticed that the option to force unlock the phone with fingerprint even on screen locked is not working.

Only after waking up the phone can unlock it.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Rrreutel:
Looking at whatawurst msm8998 kernel repo it seems that rebasing and fixing the wired mic issue on the lineage-20 branch is not complete yet.

If helpful I can test some kernels to help confirm the suspect commit(s). Or build some test kernels myself if you can point out your suspected commits for the mic issue.

Would be nice to reach a point where it's easier to keep track of changes in LOS common msm8998 kernel and cip updates again.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Danko Jones:
Hi @petefoth, I'm actually running your lineage4microg build from july and it's running great and bugfree. Are you still working on updated builds? Would love to see a new one with updated security patch. Many thanks for your work!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
I am, but making my builds has taken a back seat to maintaining the los4microg project. Updated los4microg and IodéPS builds for this device and for Z3 Tablet Compact are on my to do list. I should get round to them sometime soon if we don't encounter any more problems with the official los4microg builds

Edit:

Here's a wiki pages showing which builds I make for which devices, and builds that I have made in the past but I no longer build: Builds and Devices
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
New los4microg build available on AndroidFileHost

- flash with recovery `lineage-20.0-20231008-4microg-UNOFFICIAL-lilac.zip`

- flash with `fastboot` `lineage-20.0-20231008-4microg-UNOFFICIAL-lilac-img.zip`

* clean flash

fastboot --skip-reboot -w update lineage-20.0-20231008-4microg-UNOFFICIAL-lilac-img.zip

* dirty flash

fastboot --skip-reboot update lineage-20.0-20231008-4microg-UNOFFICIAL-lilac-img.zip

Basic testing only. I 'dirty flashed` using fastboot (over my latest IodéOS build :) ) and everything seemed to work, but you may want to make a backup before you flash

Have fun!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] kevneh:
Hello everyone, I just installed iode-4.5-20230926-lilac.zip on a new XZ1 compact yesterday. Unfortunately, I am now finding that it keeps disconnecting and reconnecting to my network provider. And even when it shows connected, it is not. Is there any way to fix this error? I am currently using a Turkcell sim card in Turkey. Does anyone know how I modify the settings so that the network works? I have already tried setting the modem settings to amss_fsg_lilac_turkcell_turkey_tar.mbn. Does anyone have the exact APN settings for me? Thanks a lot!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
To clarify, the IodéOS ROM is built by me, using code from the `whatwurst` github repos. @kevneh and I have discussed this problem in this post in the IodéOS forums. I suggested that he install @derf elot's ROM from SourceForge to check that the problem is not specific to the the IodéOS ROM, and it seems it isn't. So I suggested he post here
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] kevneh:
Yes, sorry. That's true, I also had the problem with lineage-20.0-20230813-UNOFFICIAL-1.4-lilac.zip
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Danko Jones:
Dirty flashed over previous rom with twrp recovery and it worked fine. Doesn't encounter any bug while testing shortly. Many thanks @petefoth !
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] anarki@butterblume:
Flashed over your previous build. All working fine and also, the headset feedback bug is gone! Thanks alot @petefoth!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] TheArt.:
Wow great! Am I missing something or your microg build is more recent in terms of security patches than the clean LOS20? The OP post is frozen on may 2023. Or there is a ROM like yours but without microg?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
I think that @derf elot only makes builds for this device when there is significant new functionality, or device-specific changes, and that their main focus is on other devices. But that's just my guess, and I can't speak for the OP.

My main focus is on making fairly regular builds for this device (which I own, and which is my 'daily driver') using the same code

for IodéOS (which is the OS I use) whenever there is a new tagged release of their code

for LineageOS for microG whenever I think there hasn't been a release for a while :)

previously, for /e/OS, also whenever there is a new tagged release of their code.

I wouldn't worry about security patches being a few months behind: from what I understand, most of the 'vulnerabilities' addressed by these patches are - for most users - largely theoretical and not exploitable easily (if at all). And just about any custom ROM is going to be more secure than the manufacturer's stock ROM. I'm sure there will be another 'vanilla' build from the OP along sometime soon :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] jakoobo:
He everyone,

I do have the same issues like post#434. Network is not working properly, the connection is switching on and off. Also the APN setting are lost from time to time.

I have tried lineage-20.0-20230813-UNOFFICIAL-1.4-lilac.zip from this thread and lineage 19 from LineageOS 17/18/19 for Sony Xperia XZ1 Compact also. All the same.

But no issues with Havoc v3.11 or any other stock rom.

Is there any fix or ideas? Thanks!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
It seems the version Havoc for lilac that you link to (and which works for you and for @kevneh who posted #434) is Android 10 / Q. All the ROMs that you and he have had problems with (LOS 19 & 20, IodéOS 4) are Android 12 / S or Android 13 / T.

A few of points occur to me:

What version of the Sony stock ROM did you install over? The device originally shipped with Android 8.0 (Oreo), and was upgradable to Android 9.0 (Pie). I know that I had updated to 9 / Pie before I ever flashed a custom ROM.

Did you run the stock ROM for a while before you flashed this ROM? (The Havoc OS thread you linked to links to this post which seems to suggest 'dirty flashing' over a working stock ROM to make IMS and mobile internet work well.)

The working Havoc OS ROM you and @kevneh are both currently using is Android 10, same as Lineage 17.1

When I first tried to build and install a ROM for my XZ1 Compact (/e/OS nougat I think) I couldn't make it work, so I ran Havoc OS for a while before I got /e/OS to work.

My 'upgrade' path has been from Stock A9 / pie -> /e/OS Q / A10 -> /e/OS R / A11 -> LOS 19 / A12 -> IodéOS 3 / A12 -> IodéOS 4 / A13 (i.e. always from one Android version to the next version up). I have never 'jumped' more than one Android version at a time. I suspect that many users of @Flamefire's and @derf elot's ROMs for this device have taken a similar path: maybe not one version of android at a time, but maybe not going from stock A9 / pie directly to Android 12 or 13.

So, you and @kevneh are both currently have a working Android 10 ROM.IF you would like to get to having a working LOS 20 ROM I would suggest to Install - possibly 'dirty flash', i.e. install without wiping or formatting - the following ROMs in order

@Flamefire 17.1 (either UNOFFICIAL or MICROG version) from here

@Flamefire 18.1 (use the same version) from here

@Flamefire 19.1 from here

@derf elot 20.0 from here for 'normal' LOS or my 20.0 from here for MICROG

Install using the @derf elot's TWRP recovery 3.6.2_12-0 from here

After each installation, check that mobile internet is working as you hope. If the phone boot loops after installation, then try to format data partition and re-install.

I know it's a lot to go through, and I fully understand if you prefer to stick with a working Havoc OS ROM, rather than help debugging this ROM :) But I'm as keen as anyone to fond out what is the root of these mobile internet problems that - apparently - are happening for new users of our ROMs.

Good luck!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Rrreutel:
Are you using lineage-20 kernel branch from whatawurst repo for your recent builds?

It's not obvious from the branch-name that this is a new branch, since it's named just like it always was, but I think the current lineage-20 is a Work In Progress to rebase everything onto the lineage common msm8998 kernel code base, see derf's post here. At the moment a fair number of CIP kernel patchsets and other updates still are missing from the current lineage-20 branch, so it's still quite a bit behind the original lineage-20 branch, which seems to be renamed to lineage-20_old.

So for the time being it's probably more stable and secure to use the lineage-20_old branch for the kernel. Maybe @derf elot can shed some light on status and how others can help progressing from here to bring the rebased lineage-20 branch up-to-date.

edit: link updated
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] jakoobo:
Sorry I had a working Havoc 4.19 from here not as said the v3.11.

TWRP recovery 3.6.2_12-0 from here is stuck in a freezed TWRP start screen after flashing (flash to recovery or boot). So I used 3.7.0_9-0 from here

So I tried the explained procedure, comming from a working Havoc v4.19, Android 11. I had to format data each flashing results in a boot loop.

18.1 from here -> mobile network and data is working

19.1 from here -> mobile network and data NOT working

20.0 from here -> mobile network and data NOT working

I hope this help for debugging...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Yes I've been using that branch in my builds

That's a link to the Github common kernel repo. I'd like to read derf's post - please can you give me a link?

I'll do that. I'll kick off some new builds using the `lineage-20_old` branch in the next few days.

Is there some other thread I should be reading & monitoring? I've not seen derf post here in very often. I guess he hangs out somewhere else :)

Thanks for your help.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Both those are @Flamefire's builds. It may be worth posting in [the thread for his 17/18/19 ROMs](https://xdaforums.com/t/rom-lineageos-17-18-19-unofficial-update-2023-08-26.4308295/) as well as here.

I know some ROMs are sensitive to which version of TWRP is used. This thread recommends the version from SoiurceForge. And In the installation instructions in his thread @Flamefire says

May be worth trying the 3.6.2_12 version he links to. The version I am currently using is @modpunk's 3.3.1-0 from here

I am now building `-img.zip`files for my ROMs, which can be flashed using fastboot rather than using recovery. The latest is lineage-20.0-20231008-4microg-UNOFFICIAL-lilac-img.zip I dirty flash it using the following command

fastboot --skip-reboot update lineage-20.0-20231008-4microg-UNOFFICIAL-lilac-img.zip

(That will flash the Lineage Recovery over whatever recpvery is currently installed.

I'm not really in a position to debug this, but others may be able to help :) Other interesting information will be from the following settings screens

Settings | Xperia Parts | Status

Settings | About phone | Android version (particularly the 'Baseband version)

Good luck!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Rrreutel:
Sorry, sloppy/paste, this is the post I was referring to. @Flamefire also has some relevant comments near that post.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petefoth:
Thanks. I did see that post, but I didn't realize the implications for the lineage-20 branch and for my builds.

I don't think this can be the cause if the mobile internet problems though, as they are occurring on FF's 19.q ROMs too

Edit: Actually, after re-reading derf 's post and FF's reply, I'm still not sure *which* branch in the whatawurst repos I should be building from. I'm currently making los4microg and Iodeos builds using the `lineage-20_old` branch, but I've no real idea what the differences are from the default `lineage-20` branch