Power used (mAh) to boot?


levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
15,852
Location
Somewhere off the coast of the EU
I'm wondering how much the battery charge decreases when you reboot the device. Is the charge info reported by the System Info PND good enough for at least order of magnitude info for this?


Specifically, I'm trying to work out how long you'd need to leave your Pandora off for the cost of shutting down and powering up again to be less than the battery cost of just leaving in low power mode the whole time.


I'm currently away from a charger, and am about down to 35% at the end of my third day away from the mains. I've been using it for maybe an hour or so a day, so I'm wondering if I'd have been better off shutting down overnight.
 
Interesting question. I think the charge reported by System Info should be accurate enough, if you measure just before and after a reboot. If you shut down for a while, the battery gauge chip may recalibrate and report different values, so you cannot really compare values before and after. But if you do a clean software reboot it should be no problem. You can assume that the battery barely loses any charge when the unit is shut down.
 
FWIW when I have been using it, I've had wifi on all of the time, so three to four hours of actual use and over half the battery used probably isn't that bad compared to the 10 hour reference point.
 
But if you do a clean software reboot it should be no problem. You can assume that the battery barely loses any charge when the unit is shut down.
That's good to know. I'll give that a try (and maybe kingu's approach as well) when I get back to mains supply. I'm currently planning to be away for another 1.5 days, so it's not the best time to be experimenting right now, but if anyone beats me to it, I wouldn't mind.
 
Last edited by a moderator:
Okay, just did a reboot (from xfce, wifi off, screen brightness at max) and according to System Info it only lost 28mWh doing that, including the time the screen was lit while I logged in.


Again, according to System Info my system uses about 400mW while in low power mode (estimated). Slightly surprisingly, a tiny fraction of that it claims to be down to wifi, though I thought that was completely off in low power mode.


That rather suggests you're almost always better off shutting down if you want to get the most out of your battery. If every hour it eats 400mWh in low power mode, then each reboot is equivalent to less than five minutes of that.


That said, I've just retested the low power mode (twice) the power use graph didn't get enough data points in the minute I left it in low power mode, but the battery charge graph showed it used about 1mAh during the minute it was in low power mode. Multiplying by voltage, and up to an hour, that gets me a little over 200mWh, which makes slightly over 5 minutes equal to one reboot (or a shutdown and restart). Low power mode would have to use a lot less juice than that to make it worth using for any length of time rather than shutting down, if you need your battery to last.


That said, just using low power mode my Pandora battery did last the full six days of my trip, just about, which by my maths suggests it actually uses closer to 100mW in low power mode. By that measure it's still worth shutting down if you're not going to use your Pandora again for 15 minutes.


Anyone else fancy testing this out, given I don't seem to be able to get reliable results for the low power mode estimate, and have only done the reboot test once?
 
Okay, just did a reboot (from xfce, wifi off, screen brightness at max) and according to System Info it only lost 28mWh doing that, including the time the screen was lit while I logged in.


Again, according to System Info my system uses about 400mW while in low power mode (estimated). Slightly surprisingly, a tiny fraction of that it claims to be down to wifi, though I thought that was completely off in low power mode.


That rather suggests you're almost always better off shutting down if you want to get the most out of your battery. If every hour it eats 400mWh in low power mode, then each reboot is equivalent to less than five minutes of that.


That said, I've just retested the low power mode (twice) the power use graph didn't get enough data points in the minute I left it in low power mode, but the battery charge graph showed it used about 1mAh during the minute it was in low power mode. Multiplying by voltage, and up to an hour, that gets me a little over 200mWh, which makes slightly over 5 minutes equal to one reboot (or a shutdown and restart). Low power mode would have to use a lot less juice than that to make it worth using for any length of time rather than shutting down, if you need your battery to last.


That said, just using low power mode my Pandora battery did last the full six days of my trip, just about, which by my maths suggests it actually uses closer to 100mW in low power mode. By that measure it's still worth shutting down if you're not going to use your Pandora again for 15 minutes.


Anyone else fancy testing this out, given I don't seem to be able to get reliable results for the low power mode estimate, and have only done the reboot test once?
400mW in low power mode is not right. It should be a lot less. According to my measurements it should be about 110mW. It's hard to measure this accurately. I did it by hacking some script to write out the battery energy and a timestamp on lid open/close events, closing the lid, waiting several hours, opening it again and compute the power consumption from that. I used that technique also to figure out that the power led consumes about 17mW, so disabling it should increase your standby time from ~143 hours to ~170 hours (about one extra day!).

Also, to get a more accurate estimate of the reboot cost, it's probably better to do N reboots in a row or so and divide the result by N. Also it may be better to look at the reported mAh instead of the reported mWh, because I suspect that the mAh gets updated more frequently by the battery gauge chip.

Here are some links to some old threads that may be of interest:

http://boards.openpandora.org/topic/10738-pandora-power-consumption-breakdown

http://boards.openpandora.org/topic/10776-power-saving-tips-tricks
 
Last edited by a moderator:
Yes, I definitely need to do more testing to get accurate numbers out of this. It looks like I can use /sys/class/power_supply/bq27500-0/charge_now to get the charge out in microamp hours (rounded to the nearest mAh, I guess). Poking that is less effort than starting up a PND if that's all I want.


I'm not familiar with scripting events (beyond hacking the scripts in /usr/pandora/scripts), so I'll probably just knock up a two-line script to dump out the value from that file and the current time, and just run it manually before testing and after. Like you say I need to do more than one reboot to get a decent value out of that, and leave it longer than an hour in low power mode - the numbers I'm getting are too close to the base resolution for comfort.


Alright, looks like I've got some work to do.
 
Yes, I definitely need to do more testing to get accurate numbers out of this. It looks like I can use /sys/class/power_supply/bq27500-0/charge_now to get the charge out in microamp hours (rounded to the nearest mAh, I guess). Poking that is less effort than starting up a PND if that's all I want.
That is exactly where Pandora System Info gets its values (it interpolates between updates of that reported value though).
 
Just tested that file while running a game in DraStic, and it seems to chomp 1mAh every six seconds or so. It seems to go down quite predictably, and never go up, so I suspect as long as the charge loss I'm trying to test is, say 10^3 greater than the resolution I should be able to get a result to 3s.f. or thereabouts with just a single sample at beginning and end.


If low power current is around 100mA as your testing, and one of my tests suggest, I should need to leave it in low power mode for ten hours or so to get a value accurate to 3 s.f, for my system and my battery at it's current charge level. Hmm, though if my initial reboot test was a good indication, I'd need to reboot about 400 times in a row to get a 1000mAh charge drop, and for that I'll need some better automation (perhaps using Kingu's suggestion). I'll have to poke around with the xfce session manager I guess, and disable having to log in.
 
Just tested that file while running a game in DraStic, and it seems to chomp 1mAh every six seconds or so. It seems to go down quite predictably, and never go up, so I suspect as long as the charge loss I'm trying to test is, say 10^3 greater than the resolution I should be able to get a result to 3s.f. or thereabouts with just a single sample at beginning and end.


If low power current is around 100mA as your testing, and one of my tests suggest, I should need to leave it in low power mode for ten hours or so to get a value accurate to 3 s.f, for my system and my battery at it's current charge level. Hmm, though if my initial reboot test was a good indication, I'd need to reboot about 400 times in a row to get a 1000mAh charge drop, and for that I'll need some better automation (perhaps using Kingu's suggestion). I'll have to poke around with the xfce session manager I guess, and disable having to log in.
It's around 110mW, not mA.

I would just reboot a dozen times or so and if the variance on those numbers is reasonably low, take an average and call it a day.
 
Sorry, quite right. On my last test (to date) based on the fact it lasted 6 days in mostly low power worked out at around 100mW i.e. about 30mA.


I have been getting a bit mixed up between mW, mA and mWh to be honest, and evidently I let one slip through up there. And yes, I'd need to leave it in low power mode for 3.7 times as long as 10 hours to get through 1Ah, so getting a result to 3 s.f is going to be difficult, but 3 sig. fig. is probably overkill for this comparison anyway. I'll set the low power test going before I go to bed, and see where it's at in the morning.
 
Okay, done a low power run. Results:


11:21pm (last night): 3803mAh


3:10pm: 3453mAh


Duration:14h49m


Initial charge:3803mAh


Charge drop:350mAh


Voltage at end: 4.07V


Average power over ~15h: 23.6mA (aka ~96.1mW)


Now to figure out the reboot test.
 
Okay, done a low power run. Results:


11:21pm (last night): 3803mAh


3:10pm: 3453mAh


Duration:14h49m


Initial charge:3803mAh


Charge drop:350mAh


Voltage at end: 4.07V


Average power over ~15h: 23.6mA (aka ~96.1mW)


Now to figure out the reboot test.
Is that with or without the power led enabled? Is this a 1GHz or ReBirth unit? What clock speed / bus speed?

So that corresponds to about exactly 7 days of standby time assuming a 4000mAh battery (a new battery has more than that but an old one has less, so 4000mAh is a good value to calculate with). Sounds about right.
 
Power light on (though dimmed, as it was low power mode). It's a Ghz unit running at 1000Mhz, RAM speed 200Mhz (suspect that's all default, but I forget). Theoretically that last bit shouldn't matter as low power mode should set CPU to 125Mhz, and RAM to something suitably low too, but it will become important if I can ever get my reboot test to work.


At the moment I've got a script that will count down, write out power levels then reboot, but I can't get xfce to launch it as part of bootup, so I'm a bit stumped at the moment.
 
Power light on (though dimmed, as it was low power mode). It's a Ghz unit running at 1000Mhz, RAM speed 200Mhz (suspect that's all default, but I forget). Theoretically that last bit shouldn't matter as low power mode should set CPU to 125Mhz, and RAM to something suitably low too, but it will become important if I can ever get my reboot test to work.


At the moment I've got a script that will count down, write out power levels then reboot, but I can't get xfce to launch it as part of bootup, so I'm a bit stumped at the moment.
Oh it was suspend to ram, not just lid closed idle?
 
Well, it was power switch flick to the right, which as I understand it isn't true suspend. CPU is still running, albeit at the lowest clock it supports. But yeah, not just lid closed idle.
 
Well, it was power switch flick to the right, which as I understand it isn't true suspend. CPU is still running, albeit at the lowest clock it supports. But yeah, not just lid closed idle.
Looks like the difference between "low power mode" and "lid closed idle" is mostly the dimming of the led then. I measured ~109mW for "lid closed idle" with the power led as default (bright), and only ~90mW with the power led disabled. That was on my ReBirth unit though, I should repeat the experiment on my 1GHz unit. The ~96mW you measured seems to agree with "dim led" if 90mW is no led and 109mW is led fully on.
 
Yes, there was some work done to CPU scaling a year or two back that I mostly seemed to miss that I think means that there's not much difference between setting max cpu to 125Mhz and having it higher than that but not doing anything on it - the actual clock will scale back to similar speeds anyway. I just use low power mode now as it's an easy way to turn off wifi etc, quickly.


Good to know our results agree somewhat. Not just to figure out how to run a script as close to the end of the bootup process as I can get.
 
Back
Top