Feature requests for hal battery backend.

Ryan Lortie desrt at desrt.ca
Thu Jul 28 11:06:58 PDT 2005


These are some feature requests for the battery backends in HAL to make
them easier to use by applications.

Currently, ACPI can give readings in lots of different units (so far,
I've only seen mWh and mAh).  If the reading is in mAh then you need to
multiply by the voltage of the battery to determine the number of
watthours left.

Ideally, I'd like HAL to report remaining charge in only one unit ever.
Either Joules or mWh are an appropriate choice.  Everything else should
be normalised to this.  This definitely falls under the category of
'hardware abstraction' (since an application shouldn't have to be aware
of the quirks of certain ACPI implementations).

Also, building on this, it would be nice in multi-battery systems if the
way that time-remaining estimates worked was as follows:

1) All discharge rates are collected from all batteries.
   (note: only one battery is probably discharging at any given time
          but you never know what some strange laptops might do.)

2) A total is taken.  This is how much the laptop is currently using.

3) Each battery's 'time remaining' is based on this draw rate.

4) Therefore the total time remaining of the system is that of the sum
   of the individual time remainings of each battery.

This has the added advantage that if one battery is discharging while
the other is just sitting there then the time remaining on the currently
discharging battery will be equal to its actual time remaining and the
time remaining on the battery that's not currently being used will be an
estimate of how long that battery will last once it starts being used.

Currently (since the global drain rate of the entire computer is not
considered) if a battery is not in use then you get no such estimate.

Thank you for the hard work.

Cheers.

_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list