[PATCH] reduce useless changes on APM battery.remaining_time

Stefan Seyfried seife at suse.de
Fri May 12 11:13:56 PDT 2006


On Sun, May 07, 2006 at 12:26:47PM +0100, Matthew Garrett wrote:
> On Sun, May 07, 2006 at 11:34:31AM +0200, Danny Kukawka wrote:
> 
> > No, we can't trust this values if you poll this interface every 2 seconds, if 
> > you get with every poll a new value changing +/- serveral minutes. They are 
> > not trustable by design. This is the problem.
> 
> Why is the value more trustworthy if you only poll it every minute? 

it simply depends on the APM BIOS. There are bioses that seem to sample
the battery statistics between every polling of /proc/apm - giving them
a little bit more time might actually make them more accureate.
Then there are those, that update the "remaining time" only once per minute
or something like that, those would not suffer from this bug, but they are
rare.
Then there are (IMO the majority) BIOSen that just give the "current rate" at
the time of polling, again probably changing a lot.

> Would it not make more sense to get as many data points as possible and 
> then smooth them?

My experience with APM BIOSen wrt. battery is: trust only the percentage
(if you trust it at all) and compute the rest by yourself. The remaining
time value usually is obscenely inaccurate.
-- 
Stefan Seyfried                  \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices      \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \                    -- Leonard Cohen


More information about the hal mailing list