rmkit-dev / rmkit

| remarkable app framework | https://rmkit.dev
https://build.rmkit.dev
364 stars 32 forks source link

[remux] battery drain #43

Open raisjn opened 3 years ago

raisjn commented 3 years ago

from https://old.reddit.com/r/RemarkableTablet/comments/kwsp6h/remux_andor_koreader_drain_my_battery_fast/

I recently installed rm2fb, remux and koreader via toltec. This turns the remarkable2 into the perfect device for me: Having koReader's features (especially DAV and wallabag sync) completes the amazing note taking abilities for me.

But then I noticed how fast my battery gets drained. With remux active I lose 5-10% percent of my battery per hour, even if I have the wifi off and don't switch often between koReader and xochitl.

The battery usage is fine when I disable remux, but as soon as I restart it, the battery levels start to drop again. This battery life would make my remarkable less long lasting then a normal tablet, and thats just not an option...

Is this a known problem that I somehow missed? I didn't find any issues regarding power problems in any of the repos I looked at.

If not: Where should I start to troubleshoot? I don't see anything super suspicipus in log.txt or journalctl

I also have the ddvk-hacks installed, by they don't seem to affect the battery life as drastically, when remux is disabled.

tobbsn commented 3 years ago

Oh, thanks for reposting :D I'm here too, btw ;)

raisjn commented 3 years ago

how do you test - through one hour of active usage?

and what version of remux? (should say in opkg info remux or similar command)

Eeems commented 3 years ago

Could this be related to rm2fb?

tobbsn commented 3 years ago

After unregularly checking the battery status for an afternoon, I started looking every ten minutes and the battery kept draining. I then tested by disabling remux and there was no recognizable battery decrease in the next half hour. But when I turned it back on, I lost several percent in the first half hour.

I did not actively disable rm2fb for that tests, tho. But I don't know if it would even be active without remux running.

reMarkable: ~/ opkg info remux
Package: remux
Version: 0.1.4-1
Status: install user installed
Section: launchers
Architecture: armv7-3.2
Maintainer: raisjn <of.raisjn@gmail.com>
Size: 179962
Filename: remux_0.1.4-1_armv7-3.2.ipk
Description: App launcher that supports multi-tasking applications
Installed-Time: 1610393897
Eeems commented 3 years ago

When remux is running (both foreground and background) what kind of CPU usage does it have?

tobbsn commented 3 years ago

top shows for remux

PID    PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 5485     1 root     S    75004   7%   0% /opt/bin/remux   (in the background)
...
 5485     1 root     S    75012   7%   1% /opt/bin/remux   (active)
raisjn commented 3 years ago

after speaking to eeems, some next steps could be:

then can collect usage logs and see what usage with and without remux looks like.

it will also help if anyone else can report in on battery usage and which rM version they are on

raisjn commented 3 years ago

updated comment from reddit:

it seems to have gotten a bit better with the last update to version 0.1.5-1, but I couldn't log a comparable time frame yet to verify that.

i think that i will try to add some logging mechanism for battery life that will let me analyze it later down the line, along with what apps were running.

makbeta commented 3 years ago

I am running remux on reMarkable (original) and noticed the battery drain as well. I installed the remux through opkg on my tablet. Part of the issue I found is that remux is still running even if I turn off the power via reMarkable UI. This may or may not be the cause of battery drain, but adding it here in case it is.

Reproduction steps:

raisjn commented 3 years ago

if this is on rm1, i believe there is two sleep states and in the first one, the front buttons will wake the tablet but xochitl ignores them.

your tablet might wake up if you press middle button (and not hold it) without remux, try plugging it into pc and you will get network connected event when middle button wakes it

raisjn commented 3 years ago

when i have time, i will give out scripts to log your battery life over time so you can see what is happening. it is simple to log a timestamp + current charge + whether it is charging and then look at it later.

with remux installed, i get 0.8% drain per hour during sleep on rm1

raisjn commented 3 years ago

rM1 Power Cases:

case 1 (xochitl sleep, front button wake):

case 2 (xochitl sleep, front button summon remux):

case 3 (sleep from remux):

makbeta commented 3 years ago

@raisjn Thanks for the detailed response.
I could not connect to SSH on the tablet once it's powered off and keypresses didn't wake it up. But I'm not looking at it with the same approach as you are. I think the power off details I noted are a tangent and perhaps unrelated.

The power down issue aside, I also noticed a big power drain once I started to use remux and keywriter. So I don't quite know which one causes power drain. I'm going to try another launcher and provide more details if I find that the battery drain is not as big with a different launcher.

raisjn commented 3 years ago
``` reMarkable: ~/ pidstat -u -C "(keywriter|remux)" -h 3 Linux 4.9.84-zero-gravitas (reMarkable) 02/20/21 _armv7l_ (1 CPU) # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:24:51 0 3938 0.00 0.98 0.00 0.00 0.98 0 remux # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:24:54 0 3938 0.33 2.33 0.00 0.00 2.67 0 remux # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:24:57 0 3938 1.00 0.33 0.00 0.00 1.33 0 remux 11:24:57 0 4728 7.33 1.67 0.00 0.00 9.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:00 0 3938 1.33 1.33 0.00 0.00 2.67 0 remux 11:25:00 0 4728 11.67 1.33 0.00 0.00 13.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:03 0 3938 0.33 2.67 0.00 0.00 3.00 0 remux 11:25:03 0 4728 13.33 1.67 0.00 0.00 15.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:06 0 3938 0.67 0.67 0.00 0.00 1.33 0 remux 11:25:06 0 4728 1.00 0.33 0.00 0.00 1.33 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:09 0 3938 4.67 2.33 0.00 0.00 7.00 0 remux 11:25:09 0 4728 5.00 0.67 0.00 0.00 5.67 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:12 0 3938 4.67 2.33 0.00 0.00 7.00 0 remux 11:25:12 0 4728 5.00 1.00 0.00 0.00 6.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:15 0 3938 4.33 2.33 0.00 0.00 6.67 0 remux 11:25:15 0 4728 5.00 0.67 0.00 0.00 5.67 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:18 0 3938 4.33 2.67 0.00 0.00 7.00 0 remux 11:25:18 0 4728 5.00 0.67 0.00 0.00 5.67 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:21 0 3938 4.33 2.33 0.00 0.00 6.67 0 remux 11:25:21 0 4728 4.67 1.00 0.00 0.00 5.67 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:24 0 3938 3.00 1.33 0.00 0.00 4.33 0 remux 11:25:24 0 4728 8.33 0.67 0.00 0.00 9.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:27 0 3938 0.33 3.67 0.00 0.00 4.00 0 remux 11:25:27 0 4728 12.00 5.00 0.00 0.00 17.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:30 0 3938 3.00 1.00 0.00 0.00 4.00 0 remux 11:25:30 0 4728 16.00 1.00 0.00 0.00 17.00 0 keywriter # Time UID PID %usr %system %guest %wait %CPU CPU Command 11:25:33 0 3938 1.00 0.67 0.00 0.00 1.67 0 remux 11:25:33 0 4728 8.67 0.00 0.00 0.00 8.67 0 keywriter ^C ```

i installed keywriter and opened it, then did the following:

i don't have a keyboard so i can't check what typing is like. but there's definitely room for remux to reduce CPU usage. (you can get pidstat with sysstat pkg in opkg)

EDIT: 0324d795b4a099105668d00ac4bee1f19ec95a8d could help with stylus associated CPU usage

raisjn commented 3 years ago
``` reMarkable: ~/ pidstat -u -C "(keywriter|remux|xochitl|rm2fb)" -h 3 Linux 4.14.78 (reMarkable) 02/21/21 _armv7l_ (2 CPU) # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:38 0 3722 0.33 0.00 0.00 0.00 0.33 1 remux 00:08:38 0 3731 3.63 1.32 0.00 0.00 4.95 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:41 0 3722 0.67 0.00 0.00 0.00 0.67 1 remux 00:08:41 0 3731 5.00 1.00 0.00 0.00 6.00 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:44 0 3722 0.33 0.00 0.00 0.00 0.33 1 remux 00:08:44 0 3731 4.33 2.00 0.00 0.00 6.33 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:47 0 3722 0.33 0.33 0.00 0.00 0.67 1 remux 00:08:47 0 3731 5.00 1.00 0.00 0.00 6.00 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:50 0 3722 0.00 0.33 0.00 0.00 0.33 1 remux 00:08:50 0 3731 4.67 1.00 0.00 0.00 5.67 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:53 0 3731 0.33 0.67 0.00 0.00 1.00 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:56 0 3731 13.00 1.67 0.00 0.00 14.67 0 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:08:59 0 3731 21.67 5.00 0.00 0.00 26.67 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:02 0 3731 18.33 3.67 0.00 0.00 22.00 0 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:05 0 3722 0.00 0.33 0.00 0.00 0.33 1 remux 00:09:05 0 3731 37.13 5.21 0.00 0.00 42.35 0 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:08 0 3731 56.00 4.33 0.00 0.00 60.33 0 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:11 0 3731 8.33 2.67 0.00 0.00 11.00 0 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:14 0 3731 7.33 3.67 0.00 0.00 11.00 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:17 0 3731 6.67 4.00 0.00 0.00 10.67 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:20 0 3731 2.00 0.00 0.00 0.00 2.00 1 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:23 0 3722 0.33 0.00 0.00 0.00 0.33 0 remux 00:09:23 0 3731 6.00 0.67 0.00 0.00 6.67 0 xochitl # Time UID PID %usr %system %guest %wait %CPU CPU Command 00:09:26 0 3722 0.33 0.33 0.00 0.00 0.67 0 remux 00:09:26 0 3731 5.33 1.00 0.00 0.00 6.33 0 xochitl ^C ```

on the rM2, i did:

i asked for help collecting pidstats samples (sysstat package) from others, so i hope to get more info on keywriter and other apps and how their CPU usage looks (not that CPU is the end all be all)