No APM yet for AMD?

John Baldwin jhb at freebsd.org
Tue Jan 10 13:25:41 PST 2006


On Tuesday 10 January 2006 11:10 am, Francisco Reyes wrote:
> John Baldwin writes:
> > It would be nice if we could add the ability to guess the rate based on
> > the amount of power lost in the last interval
>
> I don't know much about ACPI... but that method sounds to me like could be
> very inaccurate. I have noticed a very big difference in drain whether I am
> running text screens or running X.

Eh?  You do realize that right now all I have is '-1', not even a hopeful 
guess?  I think you don't understand what I am suggesting.  Suppose my laptop 
is up for 3 sample times with these values for the current charge:

5300
5000
4400

Now the first delta is 300, so at the second update, it would take 300 (the 
difference) and divide it into the remaining charge (5000) to get the number 
of sample times remaining (in this case 16).  At the third check, the delta 
is 600 (5000 - 4400), so it divids 600 into 4400 giving a remaning time of 7 
sample times.  There are some edge cases with state transitions (if the AC 
comes online you have to reset your timer and now you are extrapolating a 
charging rate and the remaining time to full charge, etc.) but it would give 
a somewhat decent estimate that would basically be based on what your usage 
was in the last sample time.  So, say the sample time is 30 seconds, then if 
you switch from X to text mode, it will notice the change in rate in a minute 
or less and revise the time upward.  The rate will not be an instaneous rate 
but an average across the sample time, but this is far better than the -1 I 
currently get.  Note that I think this should be used on laptops that don't 
provide a current rate as a way to extrapolate what the rate probably is.

>
> > periodically, and if we lost X mAh since the last check and are
> > discharging, assume that is the discharge rate for time calculations)
>
> That would imply a fixed discharge rate, which seems to me is not fixed.

No it doesn't.  The discharge rate can vary at each sample time.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-acpi mailing list