maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N800 (https://talk.maemo.org/forumdisplay.php?f=25)
-   -   Battery depletion on reboot (https://talk.maemo.org/showthread.php?t=26170)

thorbo 2009-01-12 18:18

Battery depletion on reboot
 
Hello All,

I have done a little browsing on the forums, but can't find anything totally definitive. I have heard that on reboot there are quite a few processes which need to run, but why on earth does it use 30% of my battery every time I reboot?

I can understand that if it sprinted at 2 ghz for 30 seconds or something, but there is no single (or multiple) thing that I could do for 45 seconds that would use 30% of my battery life. And as I understand it, 400 MHz is still the max speed. Any light shed on this great mystery would be greatly appreciated.

Am I the only one that suffers this much battery usage on reboot?

Thanks. Thor

allnameswereout 2009-01-12 18:23

Re: Battery depletion on reboot
 
Which Maemo version do you run?

During a boot tons of processes run hence in general rebooting costs a lot of resources, and is not something a user should do a lot. There are some ways to increase general performance, and making sure you do not have to reboot also helps a lot.

Have you turned things like Metacrawler off?

thorbo 2009-01-12 18:34

Re: Battery depletion on reboot
 
Yes, the meta crawler is off, and the system is generally in good shape. I guess my question was more along the lines of "What can happen in 45 seconds" that can possibly use that many resources, and why can't I harness that power if I need it for something else? or when I am plugged in.

Oh, and I am running the latest Diablo.

Picklesworth 2009-01-12 18:38

Re: Battery depletion on reboot
 
Or, in other words, how can that possibly happen within the laws of physics in our universe? :P

As I understand it, the battery metering is a bit off so after a reboot it just detects 30% less battery life than before while really the change isn't that significant.

lcuk 2009-01-12 18:52

Re: Battery depletion on reboot
 
losing 30% each time, wow.

have you noticed any other effects, like clocks not being at the time you expect, a feeling of weightlessness?
maybe some sort of anal discomfort?

if so, it might be aliens.

2 reboots should not drain 50% of your battery, I would speculate that you are seeing the difference between reading the battery scale "whilst idle" and "whilst busy".

I'm not sure if it attempts to compensate, but its likely that calculation thats going askew.

BrentDC 2009-01-12 19:45

Re: Battery depletion on reboot
 
Try this:

Check your battery level.
Reboot. Check level again.
Then, go into "Offline Mode" and "Lock Touchscreen and Keys".
Wait 30 minutes.

Is battery level closer to before the reboot or after?

thecubed 2009-01-12 19:47

Re: Battery depletion on reboot
 
Interesting-- someone else with the symptoms of my poor OS2008 N800...

Upon reboot my N800 also looses most of its charge (battery low warning) yet it continues to keep powered on and working for the rest of the day with wifi and Canola2.

I don't believe this issue has anything to do with the startup process, I think this is more an issue of the power management controller's firmware. It appears as if it only remembers the battery calibration data while powered on (which may attest to the fact that I may have a dead internal clock battery).

Even after checking the battery with kcbatt and battery-status console tools, the battery is at 50% or lower-- yet it just keeps on going despite the warning of 'impending doom' every five minutes.

My suggestion: turn off low battery alerts and just keep working... It's not much of a solution, but since it happens so rarely for me (I haven't had to reboot my tablet for 4 months), I just disable the warning until I get home and am able to recharge the battery.

lcuk 2009-01-12 19:47

Re: Battery depletion on reboot
 
just reboot and wait for a while for the dust to settle.
changing settings and faffing wont give you the reason.

Matan 2009-01-12 19:52

Re: Battery depletion on reboot
 
Reboot does not take 30% of the battery, since that would require the tablet to draw much more current than the system can actually stand. The system at maximum cannot draw more than something like 3W, and since the battery has about 5Wh, it takes about half an hour (at full draw) to waste 30%.

I saw a similar effect many times - battery appears half full, or even
3/4 bars, then I reboot and it has one bar, or none at all.

What I suspect happens is this: Estimating battery charge by voltage is not very accurate, as it depends on temperature and current draw, among other factors. Since Nokia don't want the values the tablet display to jump all the time (like reporting there are 7 days of standby and then after a few minutes
of use but no charge reporting 9 days), they don't display the raw value read from hardware, but apply some smoothing algorithm, which obviously depends on past readings. After a reboot there are no past readings. so the same (or similar) readings from hardware translate to different values reported to the user.

BrentDC 2009-01-12 20:07

Re: Battery depletion on reboot
 
Is it possible to read the raw battery level (direct from the hardware)?

I'm thinking of an application that reads battery level every minute and adds it to a max 120 line log in /tmp/. The application then weights the readings slightly more toward present, to compute a more accurate reading (that would survive a reboot).

Possible?

prk60091 2009-01-12 20:10

Re: Battery depletion on reboot
 
there are a number of threads (just check the tag for battery and battery drain) that discuss this issue. a reboot on diablo will burn up about a full days worth of juice (normally the tablet burns about .5%/hour which translates to about 10-15% battery loss due to rebooting which is why it is suggested not to reboot your tablet. it is more power efficient going to sleep than to turn off.
I recently had an issue where i thought there was a firmware problem with the battery level. it turned out to be a bad battery (mine was 13 months old)

qwerty12 2009-01-12 20:19

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 256936)
Is it possible to read the raw battery level (direct from the hardware)?

I'm thinking of an application that reads battery level every minute and adds it to a max 120 line log in /tmp/. The application then weights the readings slightly more toward present, to compute a more accurate reading (that would survive a reboot).

Possible?

http://mrrau.dyndns.org:23280/n800/kcbatt/

BrentDC 2009-01-12 20:56

Re: Battery depletion on reboot
 
Quote:

Originally Posted by qwerty12 (Post 256944)

Hmm, looking at the source, there is no algorithm for estimated battery level, just a linear return value.

That is cool though, it at least seems to draw the data directly from the hardware (the "retu", I think).

My C/C++ skills are very weak, but maybe I can modify the source and add some sort of algorithm to more accurately predict battery level. Or maybe not :)

Matan 2009-01-12 20:59

Re: Battery depletion on reboot
 
I also wrote a simple program: See retu-adc.c (or retu-adc for the binary) here:http://my.arava.co.il/~matan/770/

Run retu-adc to read all ADCs, or retu-adc 8 9 to read the battery voltage only.

To get a reasonable battery level, you need to take into account the temperature, charging status, and current draw, if it is also available somehow.

Matan 2009-01-12 21:09

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 256960)
My C/C++ skills are very weak, but maybe I can modify the source and add some sort of algorithm to more accurately predict battery level. Or maybe not :)

If you come up with a good algorithm, I am sure someone will be able to implement it in whatever language.

To find such an algorithm I suggest log values from full battery to empty on a few usage profiles:

- low power draw: standby, not connected

- medium power draw: low CPU usage, screen on low brightness.

- high power draw: play a movie that takes 100% cpu in a loop over WiFi with maximum brightness and GPS on.

Try to find an algorithm that fits all those logs.


Just a small note: /tmp will not survive a reboot, it is on tmpfs.

BrentDC 2009-01-12 21:39

Re: Battery depletion on reboot
 
Matan, I'm a little confused. When I run your program, I just get this:

Code:

~/scripts $ ./retu-adc
0: ffffffff  1: ffffffff  2: ffffffff  3: ffffffff
4: ffffffff  5: ffffffff  6: ffffffff  7: ffffffff
8: ffffffff  9: ffffffff  10: ffffffff  11: ffffffff
12: ffffffff  13: ffffffff  14: ffffffff  15: ffffffff

Is this expected?

Matan 2009-01-12 22:12

Re: Battery depletion on reboot
 
I did not expect it, but it is a permission problem. Either run it as root, or run (once every boot)

chmod a+x /dev/retu

BrentDC 2009-01-12 22:41

Re: Battery depletion on reboot
 
Matan, could you please change the output of retu-adc to decimal instead of hex?

I would do it myself, but, again, my C skills are lacking :(

Benson 2009-01-12 22:54

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 256993)
Matan, could you please change the output of retu-adc to decimal instead of hex?

I would do it myself, but, again, my C skills are lacking :(

Change this:
Code:

        for(i=s;i<e;i++) {
                printf("%d: %08x  ", i, ioctl(f,RETU_IOCH_ADC_READ, i));
                if((i&3)==3)printf("\n");
        }

to this:
Code:

        for(i=s;i<e;i++) {
                printf("%d: %010d  ", i, ioctl(f,RETU_IOCH_ADC_READ, i));
                if((i&3)==3)printf("\n");
        }

Changes from hex (x) to decimal (d), and also increases the field width from 8 to 10 characters.

Matan 2009-01-12 22:55

Re: Battery depletion on reboot
 
Here:

http://my.arava.co.il/~matan/770/retu-dec

BrentDC 2009-01-13 01:56

Re: Battery depletion on reboot
 
I see why Nokia uses battery "smoothing".

I whipped up a shell script that polls (a hacked version of retu-adc) and this is what I got:

Code:

8:04 PM - 488
8:05 PM - 474
8:06 PM - 486
8:07 PM - 481
8:08 PM - 477
8:09 PM - 475
8:10 PM - 474
8:11 PM - 472
8:12 PM - 481
8:13 PM - 470
8:14 PM - 470
8:15 PM - 477
8:17 PM - 478
8:18 PM - 466
8:19 PM - 475
8:20 PM - 457
8:21 PM - 479
8:22 PM - 485
8:23 PM - 485
8:24 PM - 490
8:25 PM - 485
8:26 PM - 492
8:27 PM - 492
8:28 PM - 492
8:29 PM - 487
8:30 PM - 492
8:31 PM - 492
8:32 PM - 492
8:33 PM - 493
8:34 PM - 493
8:35 PM - 493
8:36 PM - 493
8:37 PM - 476

I was using the device normally from 8:04 to 8:21, you know, debugging the script, looking up linux commands on the web, etc. Then at 8:22 I went into offline mode, locked touchscreen and keys, and went and took a shower. 8:37 I checked what had happened when I was gone. :D Wow. I had no idea bettery levels were so unstable. This is something to work with, though.

thorbo 2009-01-13 18:02

Re: Battery depletion on reboot
 
An interesting note... and so far only hypothetical, but rather than "rebooting" I did a shutdown and restart and my battery actually showed more power than when I shut it down... So, it appears that the system looses track of something on the reboot.

lardman 2009-01-13 20:41

Re: Battery depletion on reboot
 
Well they seem reasonably stable in the period that you were in the shower, obviously the variability in the load (wifi, cpu, backlight) significantly changes the voltage returned by retu-adc. It would be interesting to see the output for the device under constant load (e.g. everything off and trying to sleep, cpu pegged at 100%, wifi on/off, etc.)

BrentDC 2009-01-13 21:01

Re: Battery depletion on reboot
 
I'm trying to come up w/ a better script that puts as little stress on the cpu as possible, so I can get more accurate readings (right now, the script polls retu-adc every minute; I want to build a native C application that just checks the retu value every minute, instead of having to run a whole program).

I'm also thinking of making the output something like CSV so I import it into Openoffice and graph the data.

As for the algorithm, I'm wish I could get the current draw on the battery, to better predict how much time left you have doing the current activity: anyone know how to do this?

qole 2009-01-15 17:32

Re: Battery depletion on reboot
 
I've noticed this phenomenon on both of my N800s, too. I start the reboot with 75% showing on the icon, and I come back into OS2008 with the battery low warning sounding. Once or twice, the tablet has aborted the boot and shut itself off because the battery level was too low... Definitely weird.

I suspect it is something to do with the physics of lithium polymer batteries; my remote controlled planes use these li-poly batteries, and those batteries have very unpredictable lifespans, too.

zanne 2009-06-03 16:26

Re: Battery depletion on reboot
 
Quote:

Originally Posted by BrentDC (Post 257077)
I see why Nokia uses battery "smoothing".

I whipped up a shell script that polls (a hacked version of retu-adc) and this is what I got:

Code:

8:04 PM - 488
8:05 PM - 474
8:06 PM - 486
8:07 PM - 481
8:08 PM - 477
8:09 PM - 475
8:10 PM - 474
8:11 PM - 472
8:12 PM - 481
8:13 PM - 470
8:14 PM - 470
8:15 PM - 477
8:17 PM - 478
8:18 PM - 466
8:19 PM - 475
8:20 PM - 457
8:21 PM - 479
8:22 PM - 485
8:23 PM - 485
8:24 PM - 490
8:25 PM - 485
8:26 PM - 492
8:27 PM - 492
8:28 PM - 492
8:29 PM - 487
8:30 PM - 492
8:31 PM - 492
8:32 PM - 492
8:33 PM - 493
8:34 PM - 493
8:35 PM - 493
8:36 PM - 493
8:37 PM - 476

I was using the device normally from 8:04 to 8:21, you know, debugging the script, looking up linux commands on the web, etc. Then at 8:22 I went into offline mode, locked touchscreen and keys, and went and took a shower. 8:37 I checked what had happened when I was gone. :D Wow. I had no idea bettery levels were so unstable. This is something to work with, though.

2 questions...

1) someone knows how to translate those numeric values in percentage (%) ?

2) http://mrrau.dyndns.org:23280/n800/kcbatt/ is no longer available (browser goes in timeout)...someone knows were can I find the source code of that application?

i have to do some tests on the Nokia N810 and i have to record the trend of the battery draining...in C/C++ (battery-status is in python, but i don't know how to write the same code in C...)

thanks in advance.

bye bye

qole 2009-06-03 16:47

Re: Battery depletion on reboot
 
Quote:

Originally Posted by zanne (Post 293378)
2) http://mrrau.dyndns.org:23280/n800/kcbatt/ is no longer available (browser goes in timeout)...someone knows were can I find the source code of that application?

You can try grabbing the kcbatt binary from Deblet.

EDIT: Oh, you wanted the source code... Here it is.


All times are GMT. The time now is 20:17.

vBulletin® Version 3.8.8