Bug 169158

Summary: handling of multiple laptop batteries is less than ideal
Product: [Fedora] Fedora Reporter: Jeremy Katz <katzj>
Component: gnome-power-managerAssignee: John (J5) Palmieri <johnp>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: davidz, jkeck, richard
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: fc5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-25 14:58:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeremy Katz 2005-09-23 19:41:47 UTC
If you have more than one laptop battery, the time remaining which is shown only
takes the currently discharging battery into effect as opposed to the sum of the
two.

Comment 1 Bill Nottingham 2005-09-24 01:53:49 UTC
This is probably read directly from HAL...

Comment 2 Richard Hughes 2005-09-25 22:28:20 UTC
It should! The code is there to add the two batteries run-times to make the
total time. Could you send a full bugreport to me please:
http://gnome-power.sourceforge.net/report_bug.php -- thanks.

Comment 3 Richard Hughes 2005-09-25 22:41:22 UTC
Ohh, thinking more I see the problem. The discharging battery does not have a
time-to-discharge value as it's not *discharging*. And there is no rate
information for the non-discharging battery as it's not being used. Is there
*any* clever way HAL could work this out? Maybe using the assumption that
{battery2}.last_full / {battery1}.rate = {battery2}.remaining_time? I don't know
if that is a valid assumption.
The code has been tested with multi-battery setups, but the only testing has
been done where the two batteries discharged simultanously, not one after the other.
Ideas welcome.

Comment 4 Jeremy Katz 2005-09-26 00:33:10 UTC
I think assuming the rate is constant independent of the battery is perfectly
valid.  At least, it's as valid as anything you can do in that case.  It also
seems like that's what everyone else does ;)

Comment 5 Richard Hughes 2005-10-11 08:45:15 UTC
I'm working on a complete solution. In HAL, I can create a virtual battery, with
the other batteries under the virtual object. The virtual object can then report
time_remaining, whilst the non-virtual batteries can continue to provide the data.
This lets us calculate the percentage and time remaining correctly, without
breaking API.

Comment 6 Richard Hughes 2005-11-06 17:14:56 UTC
Can you try g-p-m CVS please, and post the output here. I'm not sure if this
should be solved properly in HAL or in g-p-m. Should HAL just report the data,
or process it and duplicate it for each battery type of the same type. I'm
erring to "fix" it in g-p-m, else HAL is going to get very muddled (taking into
account hot-plugging of batteries).

Comment 8 Jeremy Katz 2006-05-25 14:58:38 UTC
I think this was fixed, but I no longer have a laptop with two batteries to say
for sure :-/