sailfishos-sony-tama / main

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

Battery level is not always reflecting its actual state #157

Closed rinigus closed 2 years ago

rinigus commented 3 years ago

I had several times observed battery percentage, as reported by SFOS, getting stuck for some time and later reducing again. As a result, it has also happened that battery dropped from some value to zero unexpectedly. This has happened from 20% and from 50%.

It looks like the battery calibration is somewhat messed up now with the charging also increasing battery percentage from zero to 60% rather quickly (10-15 min). It wasn't a jump, as I could see battery percentage increasing steadily, but still such speed is not expected with the regular charger.

As I have not seen that earlier, it could be related to zgovernor. I have a feeling that the first time I saw battery % getting stuck was with the zgovernor development. Will run for some time with zgovernor configuration keeping all CPUs as they are and just changing GPU frequency.

pagism commented 3 years ago

i noticed that twice so far, the first time bat level was 62%before connected to charger, after connection it dropped to 60%, and then for the rest of the day it was stuck to 87%

lal883 commented 3 years ago

Wonder if it would be worth checking what the following file reads during these circumstances?

"/sys/class/power_supply/battery/capacity"

rinigus commented 3 years ago

Good call. As I switched to simplified zgovernor and testing that, I hope I will not get such battery-stuck state. @pagism, if you do, please check capacity file.

As for reported voltage, I have logs and will upload them later today

pagism commented 3 years ago

I am not sure, but I think I checked that capacity file and there was no difference from the main top bar battery level figure.

pagism commented 3 years ago

i think it happened today, battery level is stuck at 82% the whole day, 'cat /sys/.../capacity' shows 82 too. while at 82 i used the phone for 30min ride with kuri app on and took a couple of pic, battery level still at 82.

i put the phone to charger and battery level went to 85, i turned the ohine off while charging and meanwhile bat level increased to 87. then i took the phone off charging and boot it, battery level shows 87%.

rinigus commented 3 years ago

Long ago promised graphs. Notice how detected voltage seems to have slightly shifted to slightly larger values in the last recorded iteration.

Context: phone switched off by itself due to low battery % last two iterations.

After I dropped changes in CPU policies by zgovernor, I seem to be getting reasonable readouts and changes for battery %. Took few charge/discharge cycles to get to what I would expect to be full range in readouts (today went down to 15% or so).

I plan to drop aggressive zgovernor policy with CPU switched off or conservative and just keep GPU handling.

Battery_charge Battery_voltage

pagism commented 3 years ago

I do not know much on battery management, and I do not know how the % figures are derived from. Battery voltage should be an easy and reliable measurement, battery voltage readouts seem ok to me, it's like the computation of % had stopped updating(?) maybe a restrictive zgovernor is affecting battery management operations.

rinigus commented 3 years ago

New config packages are out. By accident, also kernel packages got repackaged by OBS and will be pulled as an update if you do

zypper ref
zypper up

Nothing harmful should be there, just not needed. I would still suggest to update and reboot after that. As it is with the kernel update, device will boot into SONY logo, then reboot again, and then should start up GUI.

ApostolosB commented 3 years ago

The battery meter level/percentage seems to behaving sanely. Battery consumption doesn't feel different though.

ApostolosB commented 2 years ago

The battery meter level/percentage seems to behaving sanely.

I take that back. I noticed today that i went to bed with 40% charge and some 8 hours later it was at 39% which kind of seems impossible. So there might be something fishy there still.

pagism commented 2 years ago

I've disabled zgovernor service and keep monitoring the battery level goes down and not getting stuck, it needs some more time to report results properly there are few glitches on screen but not a big deal.

pagism commented 2 years ago

3rd day without running zgovernor, reported battery levels seems to be ok, ie going down, I will keep monitoring

rinigus commented 2 years ago

Don't have it much anymore with the latest zgovernor. Suggesting to close over here

rinigus commented 2 years ago

As no objections, closing

ApostolosB commented 2 years ago

I've seen it get stuck in the last few days but i doubt i run the latest zgovernor if it was updated after the last release.

rinigus commented 2 years ago

We can in principle reopen it if you see the same after 4.2 release. but there isn't much I can do about it :)

ApostolosB commented 2 years ago

I'll let you know after 4.2. Its not like a BIG issue. Well other than knowing when to charge the phone.