Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot boot G8441 #453

Closed
LadaBr opened this issue Aug 29, 2019 · 39 comments
Closed

Cannot boot G8441 #453

LadaBr opened this issue Aug 29, 2019 · 39 comments

Comments

@LadaBr
Copy link

LadaBr commented Aug 29, 2019

Platform: Yoshino
Device: G8441
Android version: android-9.0.0_r46
Kernel: 4.9

Description
I followed official guide on sony website and device is stuck on bootloop.

Symptoms
It shows Android logo and freezes. Sony logo shows on different positions around the screen on each boot. There are also 1 or 2 green lines randomly showing around the logo. Only once it managed to boot after like 20 reboots but when I touched the power button to wake it up, screen was glitching and I had to turn it off.

How to reproduce
Build android-9.0.0_r46 on Ubuntu 16.04 LTS and flash device

@LadaBr LadaBr changed the title Cannot boot G8441 with latest AOSP 9 Cannot boot G8441 Aug 29, 2019
@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

I managed to boot it but display is broken.

08-29 14:58:34.378 652 3528 I SDM : DisplayPrimary::ResetPanel: Enabling HWVsync
08-29 14:58:34.405 1182 1333 D WindowManager: powerPress: eventTime=1064967 interactive=false count=1 beganFromNonInteractive=false mShortPressOnPowerBehavior=1
08-29 14:58:34.552 652 760 I SDM : HWEventsDRM::HandlePanelDead: Received panel dead event
08-29 14:58:34.625 652 652 W SDM : DisplayPrimary::Prepare: panel is in bad state, resetting the panel
08-29 14:58:34.625 652 652 I SDM : DisplayPrimary::ResetPanel: Powering off built-in/primary 26
08-29 14:58:34.626 652 652 I SDM : DisplayBase::SetDisplayState: Set state = 0, display 26-0
08-29 14:58:34.689 652 652 I SDM : DisplayPrimary::ResetPanel: Restoring power mode on built-in/primary 26
08-29 14:58:34.690 652 652 I SDM : DisplayBase::SetDisplayState: Set state = 1, display 26-0
08-29 14:58:35.250 652 652 I SDM : DisplayPrimary::ResetPanel: Enabling HWVsync
08-29 14:58:35.416 652 760 I SDM : HWEventsDRM::HandlePanelDead: Received panel dead event
08-29 14:58:35.473 652 652 W SDM : DisplayPrimary::Prepare: panel is in bad state, resetting the panel
08-29 14:58:35.473 652 652 I SDM : DisplayPrimary::ResetPanel: Powering off built-in/primary 26
08-29 14:58:35.474 652 652 I SDM : DisplayBase::SetDisplayState: Set state = 0, display 26-0
08-29 14:58:35.544 652 652 I SDM : DisplayPrimary::ResetPanel: Restoring power mode on built-in/primary 26
08-29 14:58:35.546 652 652 I SDM : DisplayBase::SetDisplayState: Set state = 1, display 26-0

@stefanhh0
Copy link

What is the output of fastboot getvar version-baseband? Should be: 47.1.A.16.20
Which OEM binary are you using: Should be: SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.img
On which kernel commit are you? Should be: 4.9.189-g5d08a48d2add (adb shell uname -a)

At least that is a configuration with that most things work fine for me on that device.

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

Baseband: 1307-7511_47.2.A.10.107
I downloaded latest OEM, the one you mentioned.
Also kernel should be 4.9 (flashing boot from 9.0.0_r46)

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

Baseband is the latest one for Pie. I thought 47.1 is Oreo

@wyzco
Copy link

wyzco commented Aug 29, 2019

What is the output of fastboot getvar version-baseband? Should be: 47.1.A.16.20
Which OEM binary are you using: Should be: SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.img
On which kernel commit are you? Should be: 4.9.189-g5d08a48d2add (adb shell uname -a)

At least that is a configuration with that most things work fine for me on that device.

Hey stefanhh0 could you share the images of this build so i could flash them?

What are the things not working if you dont mind saying?

@stefanhh0
Copy link

47.2.A.10.107 is not stable. AOSP works stable only with 47.1.A.16.20.
Therefore please downgrade.
See e.g. here:
#412 (comment)
47.1.A.16.20 works fine with Pie.

Additionally you are then probably using the prebuilt kernel. You should just delete the prebuilts, so that the latest kernel gets built:
rm -r kernel/sony/msm-4.9/common-kernel
Then rebuilt the boot image with
make bootimage

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

Thank you very much.

@stefanhh0
Copy link

@wyzco No new issues with current builds, all the yoshino issues that are open here...
Will get back to you with the info how to download. Will create a tar.xz file for you... May take a little.

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

Where do I get 47.1.A.16.20 ? I tried to flash some TFT i found but fastboot keeps saying it is 47.2.A.10.107

@stefanhh0
Copy link

Use the flashtool from sony:
https://developer.sony.com/develop/open-devices/get-started/flash-tool/download-flash-tool/

After you have flashed, boot into the flashed stock rom with inserted SIM, that will update the version-baseband

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

So i have 47.1.A.16.20 NOBA now and erased cache and flashed system, boot (latest kernel), vendor, recovery, userdata, oem and it doesn't boot. It is either bootloop while not connected to PC or it always ends up in fastboot after Sony logo. Also same green lines appear like on prebuilt kernel and pie baseband.

Perhaps I could try those images you want to share with wyzco ?

@stefanhh0
Copy link

stefanhh0 commented Aug 29, 2019

Sure, give it a try download via anonymous ftp from 91.11.226.37

Just updated the file:
534431084 Aug 30 00:22 g8441.tar.xz

recovery.img is twrp-3.3.1-0-lilac-pie-4.img from https://androidfilehost.com/?w=files&flid=286272&sort_by=date&sort_dir=DESC
oem.img is SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.img

All other images are from my build to flash use:
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash oem oem.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash vendor vendor.img

After that disconnect from usb and powercycle (hold power button + volume up for some time) after double activation of the vibrator start the device via power on.

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

I tried your images and no difference. I am hopeless. My steps:
fastboot -w
flash oem
flash system
flash vendor
flash boot

@stefanhh0
Copy link

That is unfortunate. You could give it a last try as outlined above...

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

Followed your instructions and nothing changed. Sony logo appears randomly on the screen on each bootloop iteration. Sometimes it is even like this: |NY SO|

Looks like I have to use stock ROM :(

@stefanhh0
Copy link

The sony logo issue is a known issue... see #371.

After you have flashed it takes some time to boot, only if it takes really too long like two minutes or so, then the phone is really stuck and needs another powercycle.

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

So is it supposed to reboot like 20 times? Because i saw Android logo for couple of seconds and then it reboot itself again.

@stefanhh0
Copy link

Ah okay boot loop is for sure not expected... maybe you have a different hw revision of the phone that has not yet reported issues...

@stefanhh0
Copy link

Just to be sure, you have verified with fastboot getvar version-baseband that it now shows 47.1.A.16.20?

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

version-baseband: 1307-7511_47.1.A.16.20
Finished. Total time: 0.015s

@stefanhh0
Copy link

Try booting the device with adb logcat | tee logcat.log maybe we get some output from the boot process. And attach the logcat.log here

Another approach would be to flash once again clean with sony flashtool, boot into it with SIM inserted and then flash all the img files again from my tar.

@stefanhh0
Copy link

stefanhh0 commented Aug 29, 2019

I have a slightly different version-baseband:
1308-8921_47.1.A.16.20
If I remember correctly it is from the G8441_Customized_US_1310-4371_47.1.A.16.20_R8B. Not so sure that the minor difference in the version number has an effect, anyway it would be good to flash that one to eliminate that difference...

@stefanhh0
Copy link

Also wyzco is using the version-baseband that I am using:
#412 (comment)

@LadaBr
Copy link
Author

LadaBr commented Aug 29, 2019

logcat was not possible since adb won't even connect.

I flashed US one and behavior is exactly same like every try before.

Not sure if that is hw revision

adb shell getprop ro.build.version.sdk
28

@stefanhh0
Copy link

No, 28 is not the hardware revision of your phone. It is the API version for Android Pie. I don't know how to get the exact hardware revision for the phone.

There has been a report in the past related to sdcards and boot issues. Are you using an sdcard? If so, you could give it a try booting without any sdcard to see if that is the problem. Maybe also without SIM inserted.

Additionally after you have flashed all the images are you then at least able to boot into recovery via fastboot boot recover.img (for that command you have to be in the directory where the recovery.img is).

Additionally could you upload here your adb shell dmesg >dmesg.log from the flashed stock rom right after boot?

@LadaBr
Copy link
Author

LadaBr commented Aug 30, 2019

I get this response: dmesg: /dev/kmsg: Permission denied

I googled that I need to root the phone. adb root is not working tho. Should I do it some other way?

update
booting without sim and sd card did not change anything

@djselbeck
Copy link

Sounds very similar to #368

@LadaBr
Copy link
Author

LadaBr commented Aug 30, 2019

Whatever I do it always end up in fastboot mode or bootloop if not connected after sony logo. Only stock works or if i let it reboot like 100 times then Android logo appears and there is a small chance that it actually boots. At least thats what happened to me on 47.2.A.10.107.

When I checked logs before there was some error with diskwrite and also display dead event but still it was 47.2.A.10.107. Perhaps some disk encryption? I used it before but I think it is removed with formatting.

@djselbeck
Copy link

Have you tried a wall charger, as in connected to power but not to a computer?

@LadaBr
Copy link
Author

LadaBr commented Aug 30, 2019

Yep. Right after your message.

Additionally after you have flashed all the images are you then at least able to boot into recovery via fastboot boot recover.img (for that command you have to be in the directory where the recovery.img is).

I am able to do that.

@LadaBr
Copy link
Author

LadaBr commented Aug 30, 2019

Is internal storage supposed to look like this?
image

Also when I use TWRP terminal to copy dmesg into txt file on my sd-card, it is empty. When I just print it is not though and I cannot use internal storage because it is encrypted and I have no idea how to decrypt.

@stefanhh0
Copy link

I tried your images and no difference. I am hopeless. My steps:
fastboot -w
flash oem
flash system
flash vendor
flash boot

Internal storage should not look like what you've posted, but when I looked again at what you have flashed you should at least flash as well userdata. The fastboot -w is not needed if you flash all images including cache and userdata.

Please try to flash completely and don't leave out a single img:
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash oem oem.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash vendor vendor.img

@LadaBr
Copy link
Author

LadaBr commented Sep 9, 2019 via email

@stefanhh0
Copy link

Afaik encryption is resetted if one reflashes all images in one go including userdata. Not completely sure, but I think per default on android Pie the internal storage encryption is always applied. An external sdcard can be reformatted as well as new at any time with and without encryption after one has booted to the system. I never heard of something like that there are old encryption remnants when flashing all images... But maybe there is something I am missing.

When you e.g. start twrp recovery, it should just apply the decryption keys automatically, at least that happens with my phone, that is as well a g8441. If you have defined a device pin, which can't be the case for you, since your phone does not boot to the system, twrp would also ask for the device pin.

I haven't tried to flash on top of a stock 47.1.A.16.20 since a longer time, especially I didn't flash userdata.img for quite a while since I was not in need for that. So maybe one of the encryption resp. adoptable storage changes that has been done in the more recent past may have caused a bug when flashing also userdata.img.

Since you can't boot aosp to the system, how did you do the screenshot you have provided, resp. what was the state of the phone when you did the screenshot?

Additionally you are again trying to get aosp running on top of 47.2.A.10.107 which is known to be a bad idea, especially since in general 47.2.A.* is known to have issues with aosp pie. Therefore please follow the instructions:

  • Remove the external sdcard completely (to avoid any interference by external sdcard issues)
  • Flash the stockrom: 1308-8921_47.1.A.16.20 (The full image including the erase of userdata not just firmware update!)
  • Boot once into the Android 8 stockrom with simcard inserted
  • Boot into fastboot mode (blue led) and verify that you are on 1308-8921_47.1.A.16.20 (fastboot getvar version-baseband)
  • Flash all the images in fastboot mode (blue led) that I have provided in one go, including userdata.img and cache.img
  • Disconnect usb and restart the device

Additionally:

  • The very first boot takes a little longer, so just give it the time it requires
  • Once in a while phone hangs a while on first boot and then reboots again. In most cases 2nd time boot is then successful
  • If 2nd boot is as well not successful, powercycle the phone

I may have time to check this weekend if I can reproduce the boot loop issue you have reported when flashing all the images on top of android 8 stockrom and booting into pure aosp 9... However you should be sure you followed the instructions closely since that may already fix the problem...

@LadaBr
Copy link
Author

LadaBr commented Sep 9, 2019

The screenshot provided was taken right after flash of AOSP with 47.1.A.16.20 firmware.

I carefully followed all the steps you provided and repeated them three times in case i did some mistake. Result was always same. Bootloop.

Twrp asks for PIN and it works fine. I can flash any stock rom without any issues and use TWRP too but AOSP just won't run.

@MartinX3
Copy link

MartinX3 commented Sep 10, 2019

If TWRP ask for the PIN and decrypt it successfully:

  1. android encrypted it successfully
  2. the decryption works (in twrp)

Does it reboot to twrp after the bootloop?
Or could you try to press the TWRP boot buttons instant after you saw it crashing again?
Maybe /sys/fs/pstore/ has some tasty logs.

Btw. a permission denied error while using adb shell dmesg sounds weird.
Sure the rom is built as -userdebug and not as -user ?

@stefanhh0
Copy link

Tried today to reproduce your problem but I failed.

I have flashed the stock rom via emma, have a look at the screenshot:
EmmaFlash

Maybe you find any significant differences in how it looked like for you when you did it, afterwards I flashed a clean android 9r46 build from 15th:

stefan@mars:~/android/bin/current$ fastboot flash boot boot.img 
target reported max download size of 536870912 bytes
sending 'boot' (16581 KB)...
OKAY [  0.550s]
writing 'boot'...
OKAY [  0.003s]
finished. total time: 0.553s
stefan@mars:~/android/bin/current$ fastboot flash cache cache.img 
target reported max download size of 536870912 bytes
erasing 'cache'...
OKAY [ 15.101s]
sending 'cache' (164 KB)...
OKAY [  0.020s]
writing 'cache'...
OKAY [  0.000s]
finished. total time: 15.121s
stefan@mars:~/android/bin/current$ fastboot flash oem oem.img 
target reported max download size of 536870912 bytes
sending 'oem' (221048 KB)...
OKAY [  7.299s]
writing 'oem'...
OKAY [  0.000s]
finished. total time: 7.299s
stefan@mars:~/android/bin/current$ fastboot flash recovery recovery.img 
target reported max download size of 536870912 bytes
sending 'recovery' (34548 KB)...
OKAY [  1.169s]
writing 'recovery'...
OKAY [  0.000s]
finished. total time: 1.170s
stefan@mars:~/android/bin/current$ fastboot flash system system.img 
target reported max download size of 536870912 bytes
erasing 'system'...
OKAY [ 13.436s]
sending sparse 'system' 1/3 (524284 KB)...
OKAY [ 17.240s]
writing 'system' 1/3...
OKAY [  0.000s]
sending sparse 'system' 2/3 (524284 KB)...
OKAY [ 21.760s]
writing 'system' 2/3...
OKAY [  0.000s]
sending sparse 'system' 3/3 (132996 KB)...
OKAY [  8.490s]
writing 'system' 3/3...
OKAY [  0.000s]
finished. total time: 60.926s
stefan@mars:~/android/bin/current$ fastboot flash userdata userdata.img 
target reported max download size of 536870912 bytes
erasing 'userdata'...
OKAY [ 15.201s]
sending 'userdata' (4832 KB)...
OKAY [  0.169s]
writing 'userdata'...
OKAY [  0.000s]
finished. total time: 15.370s
stefan@mars:~/android/bin/current$ fastboot flash vendor vendor.img 
target reported max download size of 536870912 bytes
sending 'vendor' (53476 KB)...
OKAY [  1.823s]
writing 'vendor'...
OKAY [  0.000s]
finished. total time: 1.823s
stefan@mars:~/android/bin/current$ ls -la
insgesamt 28
drwxr-xr-x 1 stefan stefan 136 Sep 21 08:16 .
drwxr-xr-x 1 stefan stefan 356 Sep 21 08:17 ..
lrwxrwxrwx 1 stefan stefan  22 Sep 21 08:16 boot.img -> ../2019_09_15/boot.img
lrwxrwxrwx 1 stefan stefan  23 Sep 21 08:16 cache.img -> ../2019_09_15/cache.img
lrwxrwxrwx 1 stefan stefan  58 Sep 21 08:06 oem.img -> ../SW_binaries_for_Xperia_Android_9.0_2.3.2_v9_yoshino.img
lrwxrwxrwx 1 stefan stefan  31 Sep 21 07:20 recovery.img -> ../twrp-3.3.1-0-lilac-pie-5.img
lrwxrwxrwx 1 stefan stefan  24 Sep 21 08:16 system.img -> ../2019_09_15/system.img
lrwxrwxrwx 1 stefan stefan  26 Sep 21 08:16 userdata.img -> ../2019_09_15/userdata.img
lrwxrwxrwx 1 stefan stefan  24 Sep 21 08:16 vendor.img -> ../2019_09_15/vendor.img

Without any other modifications I was then able to boot into the AOSP system just fine.
Sometimes you managed to boot to the system, right? In that case your display is broken you told. If you reach that stage, copy the dmesg and logcat as follows via using adb from your host:
adb logcat -d > logcat.log
adb shell dmesg >dmesg.log

Upload those files here. Someone who is able to read the files may then have a look and figure out what is going wrong (That wouldn't be me, since I am just a user not an android dev...)

@stefanhh0
Copy link

Without providing logs and since no one else could reproduce the problem, there is little that can be done I guess and thus the issue might be eligible for being closed.

@ix5
Copy link
Contributor

ix5 commented Mar 6, 2020

Ping @jerpelea for closing

@jerpelea jerpelea closed this as completed Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants