ubports-oneplus6 / documentation

Documentation on Ubports / Halium for Enchilada / Fajita
21 stars 3 forks source link

OP6 turns itself off, can't turn screen back on #4

Closed tomoqv closed 3 years ago

tomoqv commented 4 years ago

After a week of enjoying my OP6 with UBports, it started to act up a bit, particularly with wifi and mobile data connection. I usually solved this by doing a complete reboot, but the last few times the phone would only reboot into UBports with screen at max brightness and then shortly turn itself off. The battery is at over 90% and I am able to ssh into the phone, just like before, but the screen remains off.

calebccff commented 4 years ago

That's quite odd! You say you still have SSH so can you run the following to obtain logs and upload them to a gist or pastebin?

ssh phablet@10.15.19.82 dmesg > dmesg.log
ssh -t phablet@10.15.19.82 sudo lxc-attach -n android -- /system/bin/logcat > logcat.log

If the second command doesn't exit after a few minutes then just hit ctrl+c, you should now have dmesg.log and logcat.log on your host.

tomoqv commented 4 years ago

Here is the first one. logcat.log seems to take forevever...

dmesg.log

Found the logcat.log now:

logcat.log

tomoqv commented 4 years ago

Something seems to be wrong with logcat.log. ssh:ed into the device to check and got the following:


Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.9.112-g75a70cc1a-dirty aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
Last login: Thu Jul 30 14:00:39 2020 from 192.168.1.199
phablet@ubuntu-phablet:~$ sudo lxc-attach -n android -- /system/bin/logcat > logcat.log
[sudo] password for phablet: 
lxc-attach: cgroups/cgfs.c: lxc_cgroupfs_enter: 1230 No such file or directory - Could not add pid 9830 to cgroup //lxc/android: internal error (couldn't find any writable mountpoint to cgroup filesystem)
lxc-attach: cgroups/cgfs.c: lxc_cgroupfs_attach: 2562 could not move attached process 9830 to cgroup of container
calebccff commented 4 years ago

Looks like badly written commands have finally failed me with that logcat log 😂.

Nothing jumps out to me, although I suspect @MrCyjaneK will spot something. Perhaps you can actually SSH in, obtain logcat and then copy it off the device with scp or similar.

MrCyjaneK commented 4 years ago

@tomoqv Hey! For me rebooting the device to bootloader a few times and then back to ubuntu fixed it after about 10 times of restarting.

If you have PC nearby you can dirty flash GSI, and it will fix it

tomoqv commented 4 years ago

@MrCyjaneK I have booted into bootloader at least 10 times and also reflashed the GSI installer from twrp, but still the same. Device turns screen off after about 30 seconds and won't turn on.

calebccff commented 4 years ago

@MrCyjaneK I have booted into bootloader at least 10 times and also reflashed the GSI installer from twrp, but still the same. Device turns screen off after about 30 seconds and won't turn on.

You'll need to delete the rootfs img from /data before flashing, looks like an issue with the ubports rootfs

tomoqv commented 4 years ago

@MrCyjaneK Ok, bear with me here. Could we take it step by step. I deleted the rootfs.img and reflashed the GSI installer from twrp and rebooted. Problem persists. What am I doing wrong? Also, I never managed to flash the dtbo image that you suggested in the how-to. Could that be causing a problem?

Thanks

MrCyjaneK commented 4 years ago

Step-by-step for reflashing will be:

MrCyjaneK commented 4 years ago

Also, I never managed to flash the dtbo image that you suggested in the how-to. Could that be causing a problem?

I'm not sure, probably that shouldn't cause the issue I don't remember if I've flashed it... and you said device worked before, so I'm almost sure that it's not the issue.

MrCyjaneK commented 4 years ago

Also as I see in logs "/vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service you are running on older GSI, try the one that I've given above

I need to update releases and readme...

calebccff commented 4 years ago

Also, I never managed to flash the dtbo image that you suggested in the how-to. Could that be causing a problem?

I'm not sure, probably that shouldn't cause the issue I don't remember if I've flashed it... and you said device worked before, so I'm almost sure that it's not the issue.

This idea of flashing a custom dtbo needs to disappear, it's not at all relevant for this device

tomoqv commented 4 years ago

Also as I see in logs "/vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service you are running on older GSI, try the one that I've given above

I need to update releases and readme...

Hmm, I downloaded the GSI from your "OldPC", is there a newer one I should use? Downloaded again today and it is the exact same size as the one I used (824.8MB).

tomoqv commented 4 years ago

Step-by-step for reflashing will be:

* flash boot.img from fastboot

* flash target.zip GSI (https://oldpc.mrcyjanek.net/ci/job/ubports-gsi-make-flashable-zip/)

* reboot your device.

boot.img? Do you mean halium-boot-2020.07.09.img? Or have I missed a file here?

tomoqv commented 4 years ago

Downloading now the target.zip from link above. Must admit that I am trying to do too many things at once here. Cooking dinner also at the same time :-).

tomoqv commented 4 years ago

Ok, have flashed the target.zip now and screen stays on long enough that I could start system settings and see that I had a newer version than before. Also initiated update of the three apps I had waiting in updates, whereafter screen turned off again. Upon update completion the screen briefly turned on again, but then went black. Pressing the power button does nothing.

MrCyjaneK commented 4 years ago

@tomoqv That's very weird for me. I'd recommend you to flash stock android 9, and follow porting guide again... I've seen that issue but reboot always fixed that for me.

Also, you can try disabling wifi and mobile data... that's just an idea if I recall correctly wifi is really problematic if it comes to loading stuff.

MrCyjaneK commented 4 years ago

If you don't have any important data on your device (or you have made a backup) you can Format Data from TWRP and flash GSI again, if you don't have android 9 rom anywhere nearby.

calebccff commented 4 years ago

Please can you send the output of /sys/class/backlight/panel0-backlight/brightness

edit: that is, when the screen is black

MrCyjaneK commented 4 years ago

That's not the problem. I've managed to display an alert box when the power button was not working :/

tomoqv commented 4 years ago

Please can you send the output of /sys/class/backlight/panel0-backlight/brightness

edit: that is, when the screen is black

phablet@ubuntu-phablet:~$ cat /sys/class/backlight/panel0-backlight/brightness
0
calebccff commented 4 years ago

@tomoqv

echo 4000 > /sys/class/backlight/panel0-backlight/brightness

(if that fails try 200 instead of 4000) you may have to run sudo -s first (if you get permission denied)

tomoqv commented 4 years ago

Interesting, will try as soon as I get home!

tomoqv commented 4 years ago
phablet@ubuntu-phablet:~$ sudo echo 4000 > /sys/class/backlight/panel0-backlight/brightness
-bash: /sys/class/backlight/panel0-backlight/brightness: Permission denied
phablet@ubuntu-phablet:~$ sudo mount -o remount,rw /
[sudo] password for phablet: 
phablet@ubuntu-phablet:~$ sudo echo 4000 > /sys/class/backlight/panel0-backlight/brightness
-bash: /sys/class/backlight/panel0-backlight/brightness: Permission denied
phablet@ubuntu-phablet:~$ sudo echo 200 > /sys/class/backlight/panel0-backlight/brightness
-bash: /sys/class/backlight/panel0-backlight/brightness: Permission denied
phablet@ubuntu-phablet:~$
tomoqv commented 4 years ago

Device formatted and reflashed and is now in working condition. However, I tried to restore the backup I did previously with the cps command, but files ended up in /home/phablet/backup instead. Now my efforts to move the files to home/phablet is not succeeding. Files copied to e.g. the Pictures folder are not recognized by the Gallery appeared and no paps have been restored.

Oh, by the way, the brightness file still reads '0'.

calebccff commented 4 years ago

You're running the echo command as root, but you aren't writing to the file as root as the bash > operator is separate to the command.

hence

sudo -s

then run the command

calebccff commented 4 years ago

Device formatted and reflashed and is now in working condition. However, I tried to restore the backup I did previously with the cps command, but files ended up in /home/phablet/backup instead. Now my efforts to move the files to home/phablet is not succeeding. Files copied to e.g. the Pictures folder are not recognized by the Gallery appeared and no paps have been restored.

Oh, by the way, the brightness file still reads '0'.

Ah, man I hate ubports quirks. glad it's working now

tomoqv commented 4 years ago

Question is how to restore the backup contents correctly. Right now I have files and folders all over the place, but not where I want them...

calebccff commented 4 years ago

Question is how to restore the backup contents correctly. Right now I have files and folders all over the place, but not where I want them...

I don't think that's in the scope of this issue. Closing as you've resolved the black screen problem.

MrCyjaneK commented 4 years ago

I'd like to reopen this issue as this happened to me today.

u8l-git commented 3 years ago

I have the same issue since I tried to power down my OP6 and it seemed not to power down correctly but only turning off the display. I had not set up ssh yet, so I had no idea how to check whats happening. I just forced a powerdown and since then the screens keeps black on power on. I tried to delete the rootfs.img and the system.img and the folders created from the installation. Also I wiped the system and tried to flash the GSI and the halium-boot.img. Till now nothing solved the problem. I did not want to wipe the data partition because of my lineage I have installed on the other slot. But I guess wiping the data partition is the only thing left to get back in ubtouch... :(

u8l-git commented 3 years ago

Is there any update on this issue and how to fix it?

MrCyjaneK commented 3 years ago

Yes.. It is fixed in newer release of GSI: https://build.lolinet.com/file/halium/GSI/ubports_GSI_installer_v10.zip

Just flash it on top of current system