| Richard Hughes ( @ 2007-03-09 23:17:00 |
gnome-power-manager time remaining profile code
GNOME Power manager often sucks at predicting the amount of battery time you have left. To fix this, I've been working on a new time remaining profile class for gnome-power-manager. I'm using a self-adjusting discharge and charge profile that adjusts for the specific battery and computer that's being used, and also how it is being used. Why is this important?

Sub-screenshot of data-profiling
Main problem: How do we prevent collecting bad data? Lots of things break the accurate profiling.
All of the new stuff is already in gnome-power-manager trunk, but some bits won't work unless you have pretty similar hardware to mine - plus it's got pretty minimal testing. The time remaining in the UI is currently all still based on the old method, but this new method will probably be selectable via gconf. So things are getting better.
GNOME Power manager often sucks at predicting the amount of battery time you have left. To fix this, I've been working on a new time remaining profile class for gnome-power-manager. I'm using a self-adjusting discharge and charge profile that adjusts for the specific battery and computer that's being used, and also how it is being used. Why is this important?
- BIOS's frequently lie to us pretty badly.
- So called "smart" battery discharge chips are often really, really dumb.
- Batteries sometimes have old or degraded cells that really don't hold much charge.
- Batteries discharge faster if you are typing than if the computer idle. There's no point knowing how much time you have when idle, users want how much time they have when the computer is being used like normal.
- Some batteries (like the OLPC or N800) don't give us much useful information and we have to be a bit clever.
- Some BIOSes from Lenovo are REALLLLLY REALLLLLY BROKEN.
- Sometimes machines with multiple batteries discharge in series or parallel, which completely change the way we calculate total capacity, and it's often pretty random when they change over.
- We have a lot of floating point processing power available for some fairly advanced statistics when we are in userspace, rather than in the hardware or in the kernel.

Sub-screenshot of data-profiling
- The OpenGL screensaver starting
- The laptop screen doing DPMS off
- Beagle doing a re-index while charging (large effect)
- Lots of CPU load (like a kernel compile)
- Large temperature variations.
All of the new stuff is already in gnome-power-manager trunk, but some bits won't work unless you have pretty similar hardware to mine - plus it's got pretty minimal testing. The time remaining in the UI is currently all still based on the old method, but this new method will probably be selectable via gconf. So things are getting better.