baskerville / plato

Document reader
Other
1.25k stars 103 forks source link

[Bug] Insane Battery Usage? Libra 2 #307

Closed seniorm0ment closed 1 year ago

seniorm0ment commented 1 year ago

Not sure if it is specifically Plato related, but it seemed to happen around the same time.

Kobo Libra 2, the device can be around 96% charged. Then after about a day and a half of it being in sleep, using the sleep cover (shows Plato's sleeping menu when opening the cover and then switches to Plato) so it seems like it is sleeping.

But after about a day and a half of no usage just being in sleep, I turn the device on (open sleep lid) and it's already at 17%. From just being at 96% a day and a half ago.

seniorm0ment commented 1 year ago

Been playing around with it. It's really hard to tell if Plato is the exact cause, but it seems that way. I exited Plato and left it on Kobo's main screen, and put it to sleep. I checked back 2 days later and it still had plenty of battery.

I did the same but launched Plato first, and then put it to sleep. 2 days later I check on it, and it is completely dead. The backlight is not on when the cover is shut (I peeked). And it shows it's sleeping. So it seems to be working as intended, but it seems like maybe there is some CPU or Memory leak possibly that is killing the battery, despite being in "sleep" mode.

baskerville commented 1 year ago

Can you replace your Plato binary with the one attached in this comment and post the contents of info.log after having witnessed a battery drain?

plato-0.9.38-log_events-01.zip

neabb commented 1 year ago

I want to corroborate that I too experience massive battery drain when idle with sleepcover on my Libra 2 whilst Plato is running. I installed Plato pretty much immediately after I purchased my Kobo - it is a lot better than stock! But I noticed stock is able to operate for weeks - Plato seems to run down after a few days.

I will also install the file you have provided and send through logs when I get home.

neabb commented 1 year ago

Want to follow up - either I have installed the file into ".adds\plato\" and overwritten the binary, currently I can not get it to work as Plato gets stuck at launch and crashes back to Nickel.

Total reinstall of OCP Plato from mobileread fixed it, collecting logs now!

seniorm0ment commented 1 year ago

Haven't had a chance to do the log events Plato, but if I can find some time I will. I have done a reinstall of Plato though since this issue, and I didn't notice resolution. But curiously @neabb can you link the mobileread page you downloaded from? Because I am using the one click install that has NickelMenu+Plato (no KOReader)

neabb commented 1 year ago

Hi @seniorm0ment

I believe we are getting it from the same source. Here is the link to the MobileRead forum topic: https://www.mobileread.com/forums/showthread.php?t=314220 I just use the one called Plato but it shouldn't really matter which you choose after installing KFMon (I don't believe they interact with eachother at all).

Kobo Plato One Click

neabb commented 1 year ago

I haven't experienced any egregious battery drain since installing the events log binary (which I'm guessing is identical to the latest release. In about 2 days, I have lost 9% battery without usage. I'll keep you posted and submit the logs when something egregious happens.

baskerville commented 1 year ago

the events log binary which I'm guessing is identical to the latest release

The only difference is that it writes every input event to standard error.

neabb commented 1 year ago

Touching base with a development.

Attached is the info file.

info.log

Last night I launched Plato on my Libra 2, shut the sleep cover on the main menu and left it over night on ~93%. Ideally I wanted to leave it over the span of several nights but... when I opened the sleep cover this morning (~10 hours)... it was back on NickelMenu and with 10% battery drained. I had noticed I had been seeing a lot more of Nickel recently... figured it was just because of the drain...

So not only is something seemingly intensive happening in the background draining the battery, something dubious is causing a crash... sounds like a mystery for the great Baskerville...

NiLuJe commented 1 year ago

@baskerville: Devices with physical keys have key repeat enabled. Assuming the code knows this and doesn't just assume the device should be kept awake because it keeps getting new input events, this should be pretty harmless and not prevent the kernel from ultimately entering suspend (although, admittedly, it's been a while since I double-checked). And since everything is terrible and sleep covers are implement as an EV_KEY and not an EV_SW, they do repeat, which is hilarious, as the log perfectly shows (value is 2 for a repeat, and 59 is one of two codes for a SleepCover) ;).

Because I neither actually trust the fact that it shouldn't prevent suspend to hold true; because it make logs a right old mess; and because it's just plain useless noise & work for the input loop; we disable key repeat on suspend in KOReader (via the EVIOCSREP ioctl).

(I don't recall if I ever checked what Nickel does, because it takes a patch to prevent it from grabbing event0, and I'm too lazy ;p).

baskerville commented 1 year ago

@neabb Thanks for the log.

@NiLuJe The device never goes to sleep (otherwise the log would contain a Went to sleep on… entry): Plato ignores the VAL_REPEAT for this key code and unfortunately, the cover goes straight into VAL_REPEAT without any VAL_PRESS beforehand!

NiLuJe commented 1 year ago

Well, that's... new ;D.

I've seen some janky logs from all kinds of wonky or chattering hall sensors, but that one is weird.

I... don't really see a sensible way of handling that that couldn't backfire in fun and interesting ways. (e.g., assuming the first REPEAT is a PRESS if a PRESS was never caught, but then you have to hope that you'll actually get a RELEASE at some point ;D).

baskerville commented 1 year ago

@neabb Could you, using the same binary, provide the log for the following sequence of actions :

neabb commented 1 year ago

@baskerville info.log

baskerville commented 1 year ago

Please try the attached binary: the device should now sleep properly when the cover is closed.

plato-0.9.38-cover_repeat-01.zip

neabb commented 1 year ago

Just wanted to report my usage with the latest binary 'plato-0.9.38-cover_repeat-01':

Last night battery status: 99% This morning battery status: 99% Tonight's battery status: 99% Needless to say, I haven't done much reading...

Otherwise a tremendous success - Plato on Libra 2 with Sleep Cover is fixed! No more massive drain. Thank you very much for fixing that @baskerville

seniorm0ment commented 10 months ago

Just updated to the latest Plato release

It seems like battery life has improved, however still seems like a good bit of drain. I read for about 30min the other night on a full charge, put it to sleep, it's been 2 days sitting on the table idle sleeping, checked today and it has about a quarter of battery left.

Edit: It turned on for a min, now it seems like it's dead so maybe it was on the verge of dying. So yeah battery life still seems not amazing like it should be

rafcon-dev commented 5 months ago

Just updated to the latest Plato release

It seems like battery life has improved, however still seems like a good bit of drain. I read for about 30min the other night on a full charge, put it to sleep, it's been 2 days sitting on the table idle sleeping, checked today and it has about a quarter of battery left.

Edit: It turned on for a min, now it seems like it's dead so maybe it was on the verge of dying. So yeah battery life still seems not amazing like it should be

Might want o try the latest version, some battery isues have been solved