yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Re ports on Sailfish: I agree, more Sony devices should get the port. Its just rather limited number of developers (we also have to cover software development, not just porting) and, as a result, we have to choose carefully where to invest the time. I consider XZ2 since its expected to be simple and would be rather synced with Jolla development. But, it doesn't help to have bad camera implementation when you compare with those who keep the vendor stack after unlocking. Hence the limited number of ports.

Re camera updates: Looking on the past updates of the vendor blobs (https://developer.sony.com/develop/open-devices/downloads/software-binaries), it seems that there will be probably one update with 4.14/Pie and later combinations of 4.14/Q and 4.9/P will be updated. Which makes porting on the basis of AOSP9 limited to the updates released next - if my line of thought is correct.

I will have to look into the examples of photos. Many photos in https://xdaforums.com/showpost.php?p=77635765&postcount=2 are poor, maybe it improved further in the thread. We probably cannot rely on gcam - I assume its a solution working as an app and not modifying Android-side services (not an expert on camera side, sorry for naïve assumption).
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yeah, the same problem with the amount of developers has sodp, too :(

I would wait until I release 4.14 Q testbuilds here.

Since I need my device as daily driver, means I need to focus on stability, it would be a good indicator when the kernel/drivers are good enough to get used.

But since Q is faster, I will firstly focus on Q and replace the 4.14 kernel with 4.9 there.

Ahh, regarding the photos, gcam is just an app which uses the camera 2 api and its RAW.

The uploaded photos are compressed, but be sure that the quality will get upgraded and you won't miss stock (and its DRM) completely.

Regarding the blobs, OEMv9 for 4.9 was the last one.

Future monthly OEM blobs are for 4.14 until 4.14 freezes (4.19 should be next in 2020) & the OEM blobs are in a good, stable shape.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Sounds like a great plan! It seems to me, in the respect of the camera, 4.14/Q combination should be as good as 4.14/P, as long as OEM blobs are updated for 4.14/P. As we have to compile image for Sailfish separately, we should be able to compile 4.14/P. I'll keep an eye on the progress and feel free to post first impressions regarding photos. Then will have to think about the port :).

Thank you very much for the fast replies and great insights!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You're welcome and I hope for a sailfish port :)

Luckily the OEM for P and Q is identical like the kernel.

Ah, by the way, the differences between xz2, XZ2 compact and xz3 aren't high (apart from xz3 being launched on P -> partition layout), the hardware board is mostly the same, the SODP device trees unified where it is possible.

Sooo in theory after the first sailfish os port is done, the other devices aren't far away. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nicholes:
Does this rom has call recording (automatic)?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
That's a good news regarding kernel. This promises longer term investment. As for port running on xz2, xz2c, and xz3: something similar was done by Jolla for XA2 and Xperia 10 variants - they used as mach as possible unified approach
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nicholes:
Deleted
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yeah, XA2 and Xperia 10 are almost identical, too.

I assume Sony had too much unused XA2 boards left to produce the Xperia 10.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Danj1:
New OEM v10 binaries are out:

https://developer.sony.com/develop/open-devices/downloads/software-binaries
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Thanks but that's OEMv1 (without 0) for kernel 4.14.

There won't be any v10 for kernel 4.9

And 4.14 will take a few months to mature for daily driver usage (maybe up to OEMv5)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Danj1:
Thanks for clarification. I thought the blob quality would just continue to improve with new kernel and binaries.

This sounds more like "back to start" for me.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
You're welcome.

Yes, a back to Start with the benefits of a newer kernel.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] shoey63:
AOSP build guide for Android 10 and kernel 4.14 software binaries are now available. :cowboy:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] nicholes:
Looks like I am being ignored. :confused:

Am I spamming by asking this?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Umh, sorry, as far as I remember it has no default app to record your phone calls on your device storage.

(I use OmniROM as daily driver and it hasn't this feature by default, too.)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Just got XZ2 and I am going to work on getting Sailfish on it. As far as I understand, this ROM is built using https://developer.sony.com/develop/...ild-instructions/build-aosp-android-p-9-0-0-2, right?

To get into the best state, I updated stock to the most recent one and should unlock after that. Anything else I should do before entering AOSP @ Sony?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yeah, just newest stock first. Maxbe you want until Q.

And yes that's enough :)

And yes kernel 4.9 and 9.0 :)

4.14 and 10.0 are to early to use :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Well, SFOS is currently just getting ready for AOSP 9, Q will be 1 year extra. But I realize that you expect it will be better in terms of unlocking if I wait till Q. I can leave the device to just collect the dust until that. But as far as I understood, Q will be not in October (its actually not known when) and its maybe better to start right away. If I am unlucky, it may take few months of tinkering to make it work anyway

Have you tested camera on Q (that's in another thread though, I guess)?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Just in terms of tz data removal on u locking

Sony allowed to stay more stuff in pie like camera

Maybe in Q even more

But that are just stock functions. :)

Camera development continues in 4.14 and did stop in April 2019 for 4.9.

We can test it with OEMv2 end of October.

I heard at the end of November stock Q with the new bootloader comes. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
With now few weeks passed, do you still expect that it will be possible to use kernel 4.14 and corresponding binary blobs in P as well? As in https://developer.sony.com/develop/open-devices/get-started/supported-devices-and-functionality/ paints somewhat different picture. Although, supported is one thing, but what works in practice could be somewhat stretched. And even unlocking now, we should be getting better with 4.14 work going on on camera, right?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Oh 4.14 should work with Q if you compile it with it :)

Yes, future developments are now on 4.14 :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
You mean 4.14 with P?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Woops, sorry, yes

You can run P with 4.9 too and the inverting.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Thanks! And the blobs (https://developer.sony.com/develop/open-devices/downloads/software-binaries) are kernel version related (aka we can use 4.14 with corresponding blob for Android10-4.14 but on P)? (just rechecking your reply https://xdaforums.com/showpost.php?p=80307143&postcount=907 - maybe some more info became available).
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
9 and 10 are blob compatible

Only the kernel version matters

Oemv9 for 4.9

And now the new ones for 4.14. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] Guangd:
Will you be able to repair Speakers clipping and distortion in the future?:confused::confused:
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
After 4.14 is stable enough we can move to this bug

But it seems that the max volume is just higher than stock
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
Constant reboots

Hey guys,

my first post here, so please be patient with me. I just bought an X2 Compact and strictly followed your rules to install the AOSP Pie ROM as well as TWRP (installed all updates on Stock, then started unlocking bootloader and installation of ASOP ROM+TWRP+Magisk+OpenGApps+DualSimPatch). But I get constant reboots as soon as the screen turns off while the phone is not charging. Even when I install only the AOSP ROM without modifications (hence no TWRP, Magisk or DualSimPatch), same behaviour. Maybe someone already found a solution but I didn't read it?! Thanks for any help…
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
That was a typo, of course it's an XZ2 compact... Sorry for the confusion.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I need a bug report like described here

https://xdaforums.com/showthread.php?p=80379049

Logcat & dmesg too

Are you sure you did everything correctly including full wipe?

It's the first time I hear it.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
I am hitting the same issue. Just unlocked XZ2 (took some time to find USB2 connection for it to work), flashed images and SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_tama.img as oem image. After reboot, device just reboots, shows message regarding unlocked state, SONY, and reboots again. This goes on and goes on, until you manage to catch it with USB inside and VolumeUp to get into fastboot mode.

I wonder whether I should try to get back to stock first, before AOSP boot?

PS: flashed AOSP only, have single sim device, no gapps
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I need logs.

Did you fullwipe the phone ?

Internal storage + userdata?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Correction:

it reboots few times and then tells: Your device is corrupt. It cannot be trusted and will shut down in 5 seconds. After that, I can enter fastboot

---------- Post added at 18:20 ---------- Previous post was at 18:18 ----------

Logs are somehow difficult to get, I have access only to fastboot. How do I get the logs?

---------- Post added at 18:21 ---------- Previous post was at 18:20 ----------

Did you fullwipe the phone? :

How I should have done that? If you mean flashing userdata.img, then yes
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
In twrp you have adb for the pstore and the misc partition (https://xdaforums.com/showthread.php?p=80379049)

Fullwipe by flashing userdata.img
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
OK, so plan is then to

* flash TWRP

* boot into system

* go through reboots

* get to fastboot

* from fastboot, reboot to TWRP

Or is there any other way I can boot into recovery?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Just let the vol power button combination pressed immediately after the crash

Also running newest pie stock once before custom ROM usage is important

And exfat formatted sdcards can cause this issue since the implementation was closed source and under license fee.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
I don't think I ran newest stock before flashing. Is it possible to flash stock then and do that step now?

What's power + vol combination?
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Yes

Use newflasher and xperifirm from XDA :)

The one to boot into twrp
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Any idea how to get CDA or I can just select any from EU? Don't see Estonia nor northern Europe
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
If your region is in as example Central Europe 1 it is fine. :)

Otherwise just grab a region in the same continent.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Back on stock, booted. Let's try again ...

---------- Post added at 21:12 ---------- Previous post was at 21:05 ----------

and the same repeated. I do wonder if the latest blob is an issue...

---------- Post added at 21:15 ---------- Previous post was at 21:12 ----------

not sure its related:

```

fastboot flash boot boot.img

target reported max download size of 536870912 bytes

Sending 'boot_b' (65536 KB)...

OKAY [ 1.874s]

Writing 'boot_b'...

OKAY [ 1.393s]

Finished. Total time: 3.281s

```

---------- Post added at 21:17 ---------- Previous post was at 21:15 ----------

abd2dc545b09e56bb18d9ecc4b3fd86f boot.img

a001518bcde9ce5c7aa9333adc6c841b dtbo.img

54baec09dd342712bc09fc23c6c17886 SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_tama.img

e3732ef34e1960771ad39d42152edae5 system.img

27b3a9a0f5f187a0ff7498665f75b471 userdata.img

83930737115963bd7982bfc79dce2723 vbmeta.img

f4210c95dec7d7f462a03d367fe9ad76 vendor.img
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Could you please try Slut A as stated in the first page :)

There is a bug making bootloops on slot B for non stock ROMs.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
so, that would be

fastboot flash boot_a boot.img

fastboot flash system_a system.img

right? how can I switch it to boot from that slot_a?

---------- Post added at 21:29 ---------- Previous post was at 21:25 ----------

Here is what's done when flashing Sailfish on Xperia 10: https://github.com/mer-hybris/droid-config-sony-ganges-pie/blob/master/sparse/boot/flash.sh#L143

As you can see, the both boots are used and only system_b is with OS (I think its mounted from there later in a boot). Also vendor seems to have multiple partitions...
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
The bug is in the tama bootloader.

To switch it simply "fastboot --set-active=a"

Or boot twrp, mount the vendor partition and switch slots in the reboot menu. :)

Then please flash and boot again the newest stock and then flash the custom rom.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Nope, `fastboot --set-active=a` doesn't help and I am still on bootloop. This is after flashing all on _a and _b partitions.

Before flashing, am I supposed to make factory reset in stock android? Haven't done it since I am told to flash new userdata.

I presume, TWRP would be handy. Which one should I install, one for AOSP?

---------- Post added at 22:05 ---------- Previous post was at 22:03 ----------

Cross-posting. If I flash newest stock, will it overwrite TWRP?

---------- Post added at 22:07 ---------- Previous post was at 22:05 ----------

Reading a bug regarding " "fastboot boot twrp.img" doesn't work ... if using HW buttons", I guess I need to flash stock first
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Did you flash stock after switching to slot A?

Newflasher should tell you that it flashes A then

After that boot the system once and then flash the ROM including the userdata.IMG and the OEMv9 from may 2019 :)

Stock and custom ROM TWRP aren't compatible.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Now, I did not boot into stock after setting slot a as active. However, last time, locking at newsflasher logs, I can see it flashed last time into A ("Current slot: a"). After that I booted into stock and entered fastboot via HW buttons. Then flashed both a and b, as done by SFOS, set active slot to a and got into bootloop. From logs, I can see that newflasher was flashing into A for all partitions as well.

So, it seems we tried that already...

---------- Post added at 22:26 ---------- Previous post was at 22:25 ----------

Flashing stock now and it stated again that "Current slot: a"
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
What does the pstore right after bootloop say?

(Access by twrp)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
And this as well as previous newflasher finished by "Set slot 'a' active"

---------- Post added at 22:30 ---------- Previous post was at 22:29 ----------

Now question is how do I get TWRP on it? I can either boot into stock or have bootloops in AOSP. When and how can I flash TWRP... and which version (stock/aosp)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Please use stock only for stock.

The instructions are in the twrp thread :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
I have seen the instructions. Now, to avoid known TWRP install issue with fastboot, I will have to enter to fastboot via adb from stock. In the installation instructions, step 6 of https://xdaforums.com/xperia-xz2/development/recovery-twrp-3-2-2-0-touch-recovery-t3821597, requires me to boot into SYSTEM. I presume that will have to reboot into FASTBOOT instead.

The more I read "Known bugs" in TWRP, the less I understand what I should do :)

OK, to be sure that I will not end up in some complete limbo - if I flash TWRP, can I get it all reverted to stock?

What will happen if you have "incompatible" TWRP (AOSP one) installed with stock?

So, before next step, let's agree on specifics, please

* in stock, enable USB debugging

* while in Android Stock, "adb reboot fastboot"

* in fastboot, boot into AOSP fastboot: fastboot boot twrp.img

* in TWRP: Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img

* Reboot into installed TWRP

* TWRP should boot

* Switch somewhere active slot to A

* Now what? reboot into stock system?

* after stock system, enter fastboot

* use fastboot to flash AOSP

* bootloops

* device shuts down after 5-10 bootloops

* I can enter fastboot or flash state using key combinations. How do I get to TWRP?

* In TWRP, how do I get to pstore?

PS: Getting late over here, I will wait for your reply a bit and will continue tomorrow night.

---------- Post added at 23:19 ---------- Previous post was at 22:59 ----------

Additional info - during reboots, I had no SIM card in device. I had it when I received the device, but not today. Not sure whether it makes any difference though.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Just flash the aosp Firmware.

Then you can go into fastboot via hardware buttons and use "fastboot reboot bootloader"

This has the same effect like "adb reboot bootloader" :)

There you can boot twrp and then install it via the "install ramdisk" button.

Now boot into android and on the first crash immediately press the hardware buttons to boot recovery.

Watch out that you don't reboot a second time or the pstore is lost. :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
Will continue later tonight with it.

While on STOCK and before flashing any recovery on my side, I checked whether recovery as provided by Sony is accessible. Did two tests: one via shutdown and HW buttons (Vol- and power) and one via "adb reboot recovery". Outcome was the same, device booted into recovery mode, but without showing anything, rebooted again into system. Hence a question: does stock Sony have any recovery at all? Or is my device in some really funky mode now...
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
No worry, you can't **** up the device.

Only if you kill manually the ta and the bl partitions or repartition the device in a wrong way. :)

You saw just the normal stock recovery.

This makes a recovery solution like twrp so important.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
No worries yet :)

you mean that normal stock recovery does not really exist? or it has, as a functionality, its own bootloop only.
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Nice!

It doesn't really exist and acts only as minimal minimal environment as far as I know :)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] rinigus:
* Flashed stock,

* booted into TWRP via "fastboot boot twrp-xz2.img"

* In TWRP, under "Advanced -> "Install recovery ramdisk" -> Choose twrp.img" I can see only folder TWRP, but that's empty without anything in it. Where I am expected to have TWRP.img?

Or is it possible to install TWRP via ADB while I am in it?

---------- Post added at 18:17 ---------- Previous post was at 18:05 ----------

Looks like adb push to the rescue.

---------- Post added at 18:28 ---------- Previous post was at 18:17 ----------

Have logs, will open an issue and link it over here

---------- Post added at 18:45 ---------- Previous post was at 18:28 ----------

Issue submitted with log: https://github.com/sonyxperiadev/bug_tracker/issues/483

---------- Post added at 19:00 ---------- Previous post was at 18:45 ----------

And the resolution found and booted to AOSP! [MENTION=6031898]MartinX3[/MENTION] - thanks a lot for help! Now need to test AOSP and get ready for porting
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I'm so sorry!

I forgot to add the "flash vbmeta" into the instructions!

Our AvB 2.0 needs a matching vbmeta make ensure the partitions aren't modified by a virus

I am happy that it works now!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
[/COLOR]

Hope so! Definitely flashed userdata.img (which means full wipe, from what I read...)

My procedure was:

FASTBOOT (booted to fastboot not via buttons)

fastboot flash boot boot.img (took the version with the working touch patch)

fastboot flash dtbo dtbo.img

fastboot flash system system.img

fastboot flash vendor vendor.img

fastboot flash oem oem_*.img (Tama (latest) -> https://developer.sony.com/file/down...rnel-4-9-tama/

fastboot flash userdata userdata.img

then for twrp:

fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

fastboot boot twrp.img (the version with working touch patch)

boot into TWRP

Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img (again the version with working touch patch)

Reboot into installed TWRP

Flash Magisk 19.4 or newer

flash dual SIM patch

flash openGApps

Reboot into SYSTEM

Install the official Magisk App to gain root.

On page 93, you mentioned the issues with the SD-Card. I removed mine and that helped a bit, reboots are now less frequent (was every 10-30secs after the screnn turned off, is now several minutes, up to 15mins...)

I'm working on the logs...
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Did you flash the touch patch vendor.IMG, too?

Does it work without the touch patch boot.IMG and vendor.IMG?

And yes, logs are mandatory and the touch patch needs the vbmeta disabling. :)

Right after a crash you can immediately boot to twrp and give me the pstore files.

(Another reboot clears the pstore again)
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
Yes, vendor.img was also from touch patch. Tried several things to find out what is the root cause for the reboots (w or w/o touch, w or w/o dual sim Patch, w or w/o root or gapps, ok not any combination) but even the pure AOSP showed the same behaviour. Of course I didn't try without SD-card.

Attached my logs!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
I see personal apps in the logs, but it happened on a clean aosp without any other patch and without additional apps, too?

Did you boot the newest PIE stock firmware once, before switching to this custom rom?

Do you run the custom rom on slot A?

(If you flash stock newflasher will tell you the current slot)

(Need to ask another person, since the logs doesn't clearly give me a reason while the crash did happen).
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] bluep:
Yes to both. Tried to find out myself what is causing the reboots but even a clean AOSP rebooted and I did boot the newest firmware once.

TWRP says Boot Slot A.

Thanks for you help!
[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
Will prepare a bug hunt marathon debug kernel build later :)