Support and General Use > Hardware
Does battery estimation take in account power settings
questions2000:
(Might not be worth reading)
I mentioned above that I had already typed out a post before realizing that there was another reply with these instructions.
Because already typed, I figured I might as well post, still some info that would be good to know.
@saratoga / anyone else interested
Thank you for reply.
Sorry I did not realize there were two different indicators available, all the themes I have tested I believe just have shown the "battery state of charge" based on your description. So this is the battery indication that I was referencing in my question, so now my question probably does not make as much sense because I guess it was more based on "runtime estimation" rather than "battery state of charge"
Also apologize the following reply is going to be a bunch of random information I have come across.
IPOD FIRMWARE
I imagine this is similar what the orginal iPod firmware uses for battery indication, which was just a picture of battery outline with a fill inside giving a general indication of how much power currently available, but this was not very accurate (in my opinion) just a visual.
3RD PARTY THEME BATTERY METER
However the theme I was testing not only includes battery graphic meter, but it also includes an actual number percentage value, for example "85%". To me this is more of a helpful indication (if it is accurate).
Here are some items I narrowed down from that theme regarding the battery
--- Code: ---# Numeric Power %
%V(164,168,38,10,0)%Vf(cccccc)%Vb(000000)
%ac%bl%%
--- End code ---
--- Code: ---%xl(B,batt.bmp,0,0,9)
%V(164,186,44,47,-)
%t(1)%?bp<%?bc<%xd(Bh)|%xd(Bi)>|%?bl<||%xd(Ba)|%xd(Bb)|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bg)>>;%t(1)%?bp<%?bc<%xd(Bg)|%xd(Bi)>|%?bl<||%xd(Ba)|%xd(Bb)|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bg)>>
--- End code ---
I thought it was the following variable mentioned in the manual
%bv The battery level in volts
but I think it is using this variable instead
%bl
also here is the estimation variable you had mentioned, I do not see this one in the themes code
%bt Estimated battery time left
I would be curious to see how this variable displays / how accurate this would be.
Wonder if this one would be more informative then the volt percentage.
QUESTION 1
Does anyone know how accurate the
%bv The battery level in volts
and or the
%bl
are?
(I might be looking at this incorrectly also? not that familiar with how voltage works, anyways)
Reason I ask this is because the battery power value ##% shown in theme seems to adjust in both directions often.
I would imagine it would just keep going lower show less of a value, but on occassion I have noticed the value also going up as if the battery is magically being charged :)
------------------------------------------------------------------------------------
QUESTION 2
Might as well ask this again then just for curiosity.
Lets say user/theme uses this variable which is "runtime estimation"
%bt Estimated battery time left
So as far as I know, the estimation is based on what "Battery Capacity" setting is choosen, for example 550mAh.
Does anyone know if any of the following settings are taken into account by the "runtime estimation"?
-Backlight = Off
-Display = Sleep when Backlight is Off
-Brightness = Lower values
-Accessory Power Supply = Off
etc.
Meaning for example does turning "off" backlight completely alter the battery estimation shown in the battery meter?
Or is the estimation a static setting based only on the size battery choosen in the "Battery Capacity" setting section?
Or is it just exactly what developer saratoga has mentioned
Runtime estimation is the battery state of charge times battery capacity in mah divided by the run current for the device.
Thank You to anyone who reads all of this.
speachy:
--- Quote from: questions2000 on May 18, 2025, 06:28:49 PM ---QUESTION 1
Does anyone know how accurate the
%bv The battery level in volts
and or the
%bl
are?
I would imagine it would just keep going lower show less of a value, but on occassion I have noticed the value also going up as if the battery is magically being charged :)
--- End quote ---
%bv is what the hardware reports. %bl is computed by first looking up the voltage in a table, and linearly interpolating.
(Note there are exceptions here; some hardware with a "smart" PMIC only reports the battery percentage instead of a voltage)
The reason you see it go back up sometimes is that the measured battery voltage is affected by the load on said battery. Spinning up the hard drive is particularly heavy; this is why rockbox has a "critical battery level" threshold under which it won't try to spin up the storage (eg to save playback state) as that could corrupt data or crash the device outright.
--- Quote from: questions2000 on May 18, 2025, 06:28:49 PM ---QUESTION 2
So as far as I know, the estimation is based on what "Battery Capacity" setting is choosen, for example 550mAh.
Runtime estimation is the battery state of charge times battery capacity in mah divided by the run current for the device.
--- End quote ---
Runtime estimation is just that, an estimation. It takes the configured battery capacity and percentage level to compute a "X mAh remaining" value. It then divides that by the estimated power consumption *at that exact time* (ie does not try to do any sort of usage pattern analysis). What goes into this consumption estimate depends on the individual device, but typically takes into account: (a) the baseline idle power consumption, (b) if the display is on, and (c) if the storage device is active. The power consumption numbers for each of those situations can vary widely in accuracy; they may be taken from datasheets, measured carefully in a controlled setting, simply guessed at, or in some cases, supplied by the hardware in realtime.
This can be made as fine-grained as one would like, it's just a matter of carefully measuring the current in isolation.
Further details can be found in firmware/powermgmt.c, in the battery_current() function.
Navigation
[0] Message Index
[*] Previous page
Go to full version