sailfishos-sony-tama / main

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

Actdead: Charging when switched off is broken #119

Closed rinigus closed 3 years ago

rinigus commented 3 years ago

After boot,

rinigus commented 3 years ago

After applying latest Seine patches, phone reboots when entering actdead mode. Would have to investigate

rinigus commented 3 years ago

Log from journal after forced reboot:

May 04 22:40:29 XperiaXZ2Compact systemd[1]: Couldn't stat device /dev/twl4030_wdt: No such file or directory
May 04 22:40:29 XperiaXZ2Compact systemd[1]: Couldn't stat device /dev/watchdog1: No such file or directory
May 04 22:40:29 XperiaXZ2Compact systemd[1]: Couldn't stat device /dev/watchdog0: No such file or directory
May 04 22:40:29 XperiaXZ2Compact systemd[1]: /dev/watchdog is not a device.
May 04 22:40:29 XperiaXZ2Compact systemd[1]: Couldn't stat device /dev/alarm: No such file or directory
May 04 22:40:29 XperiaXZ2Compact systemd[1]: Starting DSME...
May 04 22:40:29 XperiaXZ2Compact systemd[1]: Started Mode Control Entity (MCE).
May 04 22:40:29 XperiaXZ2Compact mce[2395]: modules/display.c: mdy_stm_set_compositor_availability_changed(): compositor availability change: pending
May 04 22:40:29 XperiaXZ2Compact kernel: rmnet_perf_config_notify_cb(): rmnet_perf netdevice register, name = lo
May 04 22:40:29 XperiaXZ2Compact kernel: rmnet_perf_config_notify_cb(): rmnet_perf netdevice register, name = ip_vti0
May 04 22:40:29 XperiaXZ2Compact kernel: rmnet_perf_config_notify_cb(): rmnet_perf netdevice register, name = ip6_vti0
May 04 22:40:29 XperiaXZ2Compact kernel: rmnet_perf_config_notify_cb(): rmnet_perf netdevice register, name = sit0
May 04 22:40:29 XperiaXZ2Compact kernel: rmnet_perf_config_notify_cb(): rmnet_perf netdevice register, name = ip6tnl0
May 04 22:40:29 XperiaXZ2Compact dsme[2642]: DSME 0.82.0 starting up
May 04 22:40:29 XperiaXZ2Compact dsme[2642]: dsme wdd: Error setting WD period for /dev/watchdog
May 04 22:40:29 XperiaXZ2Compact DSME[2720]: state: Actdead (charger: off(?), alarm: not set)
May 04 22:40:29 XperiaXZ2Compact DSME[2720]: state: new state: ACTDEAD
May 04 22:40:29 XperiaXZ2Compact dsme[2642]: Device /dev/sailfish/home does not exist or access denied.
-- Reboot --

Spent some time on it, cannot figure out what is wrong, unfortunately.

rinigus commented 3 years ago

Same log as above when it reboots by itself. Currently, configs were updated, but that didn't help. Sometimes it boots and shows (backlit) black screen

rinigus commented 3 years ago

On AOSP10, my build:

On startup, charging battery is shown and screen goes black (no backlight)

Stock works as it should

rinigus commented 3 years ago

There are differences in SFOS and Android charger boot.

Looks like PC reboot in SFOS can be avoided by setting in /init.rc:

on charger
    class_stop charger
    trigger late-init

That would result in phone just hanging and only force reboot brings it out.

rinigus commented 3 years ago

Looks like the issue with actdead can be resolved. For that, AOSP bits need to be patched as well as SFOS script skipped.

Actdead mode in SFOS switches Android init from 'charger' to 'late-init'. However, the switch is probably happening after some other Android init scripts already configured USB and maybe few other things. So, I had to disable all on charger startup services in system init*.rc. The corresponding patch will be generated as a part of the fix.

In addition, running /usr/lib/startup/limit-cpu hangs the device with "/usr/lib/startup/limit-cpu: line 18: echo: write error: Invalid argument" as an output. To avoid this script, I had to disable limit-cpu.service in actdead.target.wants.

Will test now the corresponding changes in a new image

rinigus commented 3 years ago

Fixed by