sailfishos-sony-tama / main

Documentation, releases, and issues
MIT License
38 stars 7 forks source link

XZ2 Compact Support (apollo, H8314 and H8324) #38

Closed ApostolosB closed 4 years ago

ApostolosB commented 5 years ago

As stated in the Readme.md. An issue for monitoring the status/development of the single sim XZ2 Compact.

rinigus commented 4 years ago

I have looked through the logs and nothing really strikes me as failing. Except ofono does not have something like

Dec 14 19:42:55 Sailfish ofonod[3302]: data reg changed 0 -> 2 (searching), attached 0
Dec 14 19:42:56 Sailfish ofonod[3302]: Requested file structure differs from SIM: 6fb7
Dec 14 19:42:57 Sailfish ofonod[3302]: data reg changed 2 -> 1 (registered), attached 1
Dec 14 19:42:57 Sailfish ofonod[3302]: Activating context: 1
Dec 14 19:42:59 Sailfish ofonod[3302]: setting up data call

and your log has instead

Dec 14 18:37:36 Sailfish ofonod[3251]: Requested file structure differs from SIM: 6fb7
Dec 14 18:37:38 Sailfish ofonod[3251]: Unable to read mailbox identifies from SIM
Dec 14 18:37:40 Sailfish ofonod[3251]: export_entries_one_storage_cb with ME failed
Dec 14 18:38:05 Sailfish ofonod[3251]: sms received, smsc_len is 7
Dec 14 18:38:06 Sailfish ofonod[3251]: sms received, smsc_len is 7

Please check whether it does actually work with AOSP. I want to be sure before digging further that its not SIM/Operator/AOSP error. I presume that you see in Settings/Mobile network connection disabled or something similar.

ApostolosB commented 4 years ago

Can you point me to the correct file to download from the links??? I looked to the linked websites and see stuff for android 8 android 9 10 and other stuff.

Also do i need TWRP or i can get something usable with only the first part of https://forum.xda-developers.com/showpost.php?p=77635765&postcount=2 ??

ApostolosB commented 4 years ago

Also one observation regarding the reboot issue (migh be unrelated but here goes) While i had the phone shut i plugged the usb cable to charge it. It showed the usual SFOS usb cable plugged in etc. In this state of the phone it wasn't rebooting. I could press the button to wake it > press again blank the screen with no issue. No idea if this helps. Just an observation.

rinigus commented 4 years ago

We don't need TWRP, fastboot flashing is sufficient.

As for files, I think this should be enough for our tests:

http://www.dhsfileserver.de/ftp/MartinX3/Xperia%20XZ2%20Compact/android_9/custom_rom/aosp/2019-10-27_13-41-39_sonyaosp_xz2c_ss.tar.gz

While its a single-sim, I presume that we can test with that. We don't need GAPPS and as you have flashed OEM already, we don't need it either. You also don't need to flash oem during installation.

So, after download, follow FASTBOOT installation. For you, points 1,2,3,4,5,7 under fastboot section

ApostolosB commented 4 years ago

OK. No idea if it is because we used a single sim image but i have no mobile network at all. I can't even place a phone call with aosp (while i can in SFOS).

if you have a link for a dual one i can try this.

rinigus commented 4 years ago

Reading now that install by MartinX3, I can see that dual sim version requires Dual Sim Patcher. I presume that we get it from http://www.dhsfileserver.de/ftp/MartinX3/Xperia%20XZ2%20Compact%20Dual/android_9/sony-dualsim-patcher-v4alpha.zip

Which means that we have to install TWRP as well. Which was not exactly as was in instructions (https://forum.xda-developers.com/showpost.php?p=77177196&postcount=2), at least for me.

  1. get http://www.dhsfileserver.de/ftp/MartinX3/Xperia%20XZ2%20Compact/android_9/twrp/custom_rom/2019-08-10_17-49-21_twrp_sodp_xz2c.tar.gz

  2. get http://www.dhsfileserver.de/ftp/MartinX3/Xperia%20XZ2%20Compact%20Dual/android_9/sony-dualsim-patcher-v4alpha.zip

  3. go to fastboot mode

  4. boot into twrp: fastboot boot twrp.img

  5. we can try to avoid installing twrp fully, by pushing patcher to it:

5a: on PC: adb push sony-dualsim-patcher-v4alpha.zip /sdcard

5b: in TWRP, install that ZIP

5c: reboot into system

  1. alternative is to install TWRP.

6a: on PC: adb push twrp.img /sdcard

6b: Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img

6c: Reboot into Recovery

6d: on PC: adb push sony-dualsim-patcher-v4alpha.zip /sdcard

6e: in TWRP, install dualsim patcher zip.

6f: reboot into system

I wrote it down according to my memory, hopefully its all correct. In the end of the day, we need to know whether that

rinigus commented 4 years ago

PS: That dual sim patcher should allow you to transform single-sim into dual-sim variant.

ApostolosB commented 4 years ago

i assume you need an sd card in the phone right??

ApostolosB commented 4 years ago

The sim works fine on my J1. I also tried with another SIM on SFOS with the same results. That SIM was the one i tested before unlocking the bootloader and stuff.

rinigus commented 4 years ago

OK, so it's a question of combination of then all of them: device + sim + aosp9. I hope it all works. If it does, I will make an image that is based exactly on your model. Maybe that will make a difference. But let's take it one step in a time.

/sdcard is emulated, so no need for real sdcard in those instructions.

ApostolosB commented 4 years ago

ehhhh. the first link doesn't contain a twrp.img file

rinigus commented 4 years ago

it has twrp-xz2c.img - that's the same :)

ApostolosB commented 4 years ago

fastboot boot twrp-xz2c.img gets stuck in the sony logo boot.

ApostolosB commented 4 years ago

meh known bugs > https://forum.xda-developers.com/xperia-xz2/development/recovery-twrp-3-2-2-0-touch-recovery-t3821597

edit. probably not for us. misread that

rinigus commented 4 years ago

that's right, please use fastboot reboot bootloader when you enter fastboot from hardware buttons. then after that you could make fastboot boot twrp-xz2c.img

rinigus commented 4 years ago

I'll be afk for about 1 hour.

ApostolosB commented 4 years ago

And now the touchscreen doesn't work when on twrp. Nice hehe.

rinigus commented 4 years ago

I think there was someone complaining about non-working touch on twrp. I'll try to find some info regarding it at XDA tomorrow. Either someone complained on TWRP or AOSP9 thread.

As far as I understood, you haven't tested that SIM (or maybe other) using stock? From your messages, I can summarize it as follows:

Have you tried your or some other SIM on stock before or after unlocking? Was network working then? I presume yes.

Tomorrow, we probably should try to see if we can make AOSP9 work for testing. I will make a new SFOS image which is using XZ2c as a base, instead of XZ2 as it is now. There are just few packages that I can prioritize while building images. For XZ3, XZ2 was fine. Maybe, its not for XZ2c. Although, I don't know why. However, its relatively simple to test and we will do that.

Re reboot: mode when switched off and put on charging is different. But let's try to get 4G working first.

rinigus commented 4 years ago

RE TWRP with touch issue: Try to use image from http://www.dhsfileserver.de/ftp/MartinX3/Test%20Builds/SODP/4.9/Touch%20Issues/Xperia%20XZ2%20Compact/apollo_twrp_v8.zip

ApostolosB commented 4 years ago

It went like this. When i got the phone out of the box i updated to latest & tested everything i could. I put in my brothers SIM -didn't have a nano sim at that point- and browsing worked fine.

Flashed SFOS -and after all the stuff we went through- we came to something that has the reboot and 4G issue. (calls messages BT wifi and everything i tested with the mce tool worked)

Before i installed AOSP i tested the phone again with my brothers SIM again. The same results as with mine which works fine on the J1.

ApostolosB commented 4 years ago

Ok. After installing the patch we are at the same point -on AOSP- as with SFOS. I can make/receive calls but no internet over 4G. So probably its not SFOS here to blame but something on the AOSP side.

rinigus commented 4 years ago

So, we will need help then from AOSP side. Maybe relevant post, https://forum.xda-developers.com/showpost.php?p=79815582&postcount=728, but it sounds like you actually did it.

If you have done it, then please register at XDA and ask for help at https://forum.xda-developers.com/xperia-xz2/development/aosp-aosp-8-1-h8266-t3843269 . I will join you and I am sure we will get it fixed, as there are no major complaints over there...

rinigus commented 4 years ago

@ApostolosB : I think to identify the issue with 4G, logcat will be needed. You should be able to grab it without rooting, as far as I remember. I would suggest to use https://forum.xda-developers.com/showthread.php?t=2774386 with the part corresponding "from PC". When doing it from Linux, you just need to install adb from your distribution (maybe something like android tools, you probably have it together with fastboot already).

In Android, you would have to enable developer options first: https://developer.android.com/studio/debug/dev-options . After that, proceed with grabbing logcat while you are in AOSP. Check if it has some IMEI or serial numbers and delete them. Then either upload it here or in XDA thread.

ApostolosB commented 4 years ago

Is it ok to wait for martin to reply and give us instructions??

rinigus commented 4 years ago

we may as well generate logcat as well. it will proceed faster then :) . for dmesg we may have to root the device, but maybe something is clear from logcat already

ApostolosB commented 4 years ago

I am to blame i know but i flashed SFOS back on the device cause i wanted to test/play with stuff. I asked to wait just in case we need to do something different.

rinigus commented 4 years ago

Fair enough :) . Then we can wait - maybe there is some known issue with AOSP that we hit

ApostolosB commented 4 years ago

Another issue i noticed. Minor i know and not important at all at this point. Is there a way to make the key press haptic feedback a bit stronger (when typing). It seem to be inconceivable. Vibration in general works.

rinigus commented 4 years ago

For haptic feedback, please open an issue. We started discussion at XDA regarding your device :)

ApostolosB commented 4 years ago

Just saw that. I'll need some more time for this. My mobile network operator is having a generalized problem and i don't have 4g even on my J1.

rinigus commented 4 years ago

Please let Martin know via XDA as well. Its good to keep communication going and keep him in the loop, as soon as we involved AOSP devs.

ApostolosB commented 4 years ago

The problems with the data provider seem to have started at about the time i was testing with AOSP. And i didn't try another SIM while i had that flashed. It'll be "mad fun" to discover that what i was experiencing there was a problem with the provider. Or the problem being on the SFOS side.

rinigus commented 4 years ago

Its just a bad coincidence. As you wrote at XDA, we have to wait to get the provider side sorted and then take it from there.

ApostolosB commented 4 years ago

@rinigus if you want me to test anything in relation to the reboot bug while we wait for the data provider to get back to normal just tell me what.

rinigus commented 4 years ago

I will have to look and maybe recompile kernel for it. From the logs that you sent, I haven't seen anything and I suspect that we didn't catch reboot moment. Will let you know when new image is ready, probably tomorrow night as I have to recompile Android bits as well.

ApostolosB commented 4 years ago

No rush. In other news. Data still down as we speak.

ApostolosB commented 4 years ago

Ok. I tested with aosp and the internet works. The problem is on the SFOS side. It was the providers problem that didn't let me get 4g on aosp the first time around. Bad luck. I'll inform the xda thread.

@rinigus How we proceed from now on???

rinigus commented 4 years ago

To be clear: after all is working in AOSP, cellular network is NOT working in SFOS, right?

Then, let's get logcat's for SFOS and AOSP. In the both cases, it would simplify to have WIFI disabled.

In AOSP: boot, enable cellular data and after that get logcat.

In SFOS: boot, enable cellular data and after waiting for 10 min to be sure that its not enabling itself, reboot. after reboot, grab logcat and journal from /root (shutdown version).

rinigus commented 4 years ago

I realized that you may use newer AOSP base than the one we have for SFOS. To be sure that its not playing a role, please also test http://www.dhsfileserver.de/ftp/MartinX3/Xperia%20XZ2%20Compact/android_9/custom_rom/aosp/2019-08-08_17-45-03_sonyaosp_xz2c_ss.tar.gz

Its possible, though, that this one doesn't have touch working. But if it works, please check out whether 4G is fine there.

ApostolosB commented 4 years ago

I cant check with the base used on SFOS because i have no touchscreen and i cant unlock the SIM.

Got a logcat anyway.

rinigus commented 4 years ago

:) yes, but with locked sim there is not much internet ... thank you very much for checking. I'll look into all collected logs later tonight

ApostolosB commented 4 years ago

For reasons i cannot explain at all i now have 4G internet after installing SFOS. I didn't do anything different than all the other times. WTF is this shit.

rinigus commented 4 years ago

I will HAPPILY take this. Its possible that your provider was already failing earlier. Or somehow SFOS was not able to establish new sim card connection.

So, we have one issue left - crash / reboot while locking. I think, at least, I will need new kernel for it. Maybe you will be able to try it as OTA update from devel later tonight.

ApostolosB commented 4 years ago

It cant be the provider since i tested with another sim also and that didn't work. I am honestly beyond confused. If someone has an explanation i'd be more than glad to hear it.

Probably someone needs to test without installing an aosp rom. Straight from stock to SFOS.

Other than that (related to sim stuff) the test (SIM card) in the mce tool fails. Could it be that it expects 2 SIMS to be inserted i don't know.

I also run most of the tests (whatever i had available) in the mce tool and it passes them.

So for now only the reboot thing remains which as you said you will handle later tonight. ping me here and tell me if something special is needed.

rinigus commented 4 years ago

Turns out, we have PSTORE enabled already - I did it before. Please check what you have in /sys/fs/pstore after reboot and send me those files via email. If you have any

ApostolosB commented 4 years ago

Nothing there.

rinigus commented 4 years ago

Check zcat /proc/config.gz | grep -i pstore if you have CONFIG_PSTORE set.

If it is set, then I don't really see what's going on. Try to enable persistent store again and send full journal after reboot (journalctl > journal.txt). If we don't see anything there, let's try to make your-device specific image.

ApostolosB commented 4 years ago
[nemo@Sailfish ~]$ zcat /proc/config.gz | grep -i pstore
CONFIG_PSTORE=y
CONFIG_PSTORE_ZLIB_COMPRESS=y
# CONFIG_PSTORE_LZO_COMPRESS is not set
# CONFIG_PSTORE_LZ4_COMPRESS is not set
CONFIG_PSTORE_CONSOLE=y
# CONFIG_PSTORE_PMSG is not set
CONFIG_PSTORE_RAM=y

yep set

rinigus commented 4 years ago

I'll start baking image and you could try meanwhile to catch it in the journal :)

ApostolosB commented 4 years ago

@rinigus a question. When i scroll and in general interact vigorously with the UI there seems to be that lipstick (the compositor AFAI understand) consumes quite a bit of CPU. This is considered normal right??? Is it that the compositor isn't HW accelerated by GL or whatever??