Discussion:
[Bug 60989] HAL reports incorrect battery percentages
John Dong
2006-09-18 02:12:05 UTC
Permalink
Public bug reported:

Ever since the most recent HAL update, GNOME Power Manager and lshal
have been giving me ridiculous values for battery life. It directly
contradicts what acpi -V tells me. For example:

***@jdong-laptop:~$ acpi -V
Battery 1: discharging, 96%, 02:33:40 remaining
Thermal 1: ok, 54.0 degrees C
AC Adapter 1: off-line

-----------

***@jdong-laptop:~$ lshal | grep battery
battery.remaining_time = 14400 (0x3840) (int)
battery.charge_level.percentage = 100 (0x64) (int)
battery.charge_level.rate = 1 (0x1) (int)
battery.charge_level.last_full = 4 (0x4) (int)
battery.charge_level.current = 4 (0x4) (int)
battery.voltage.current = 1 (0x1) (int)
battery.reporting.rate = 1637 (0x665) (int)
battery.reporting.current = 4231 (0x1087) (int)
battery.charge_level.capacity_state = 'ok' (string)
battery.rechargeable.is_discharging = true (bool)
battery.rechargeable.is_charging = false (bool)
battery.is_rechargeable = true (bool)
battery.charge_level.unit = 'mWh' (string)
battery.charge_level.granularity_2 = 473 (0x1d9) (int)
battery.charge_level.granularity_1 = 473 (0x1d9) (int)
battery.charge_level.low = 2590 (0xa1e) (int)
battery.charge_level.warning = 4440 (0x1158) (int)
battery.charge_level.design = 71040 (0x11580) (int)
battery.voltage.design = 14800 (0x39d0) (int)
battery.voltage.unit = 'mV' (string)
battery.reporting.granularity_2 = 32 (0x20) (int)
battery.reporting.granularity_1 = 32 (0x20) (int)
battery.reporting.low = 175 (0xaf) (int)
battery.reporting.warning = 300 (0x12c) (int)
battery.reporting.design = 4800 (0x12c0) (int)
battery.reporting.last_full = 4382 (0x111e) (int)
battery.reporting.unit = 'mAh' (string)
battery.technology = 'LION' (string)
battery.serial = '10320' (string)
battery.model = 'ZB01' (string)
battery.vendor = 'SONY' (string)
battery.present = true (bool)
info.capabilities = {'battery'} (string list)
info.category = 'battery' (string)
battery.type = 'primary' (string)
linux.acpi_path = '/proc/acpi/battery/BAT1' (string)


It continues to report either 100% or 75% until my battery goes dead.

** Affects: hal (Ubuntu)
Importance: Untriaged
Status: Unconfirmed
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
John Dong
2006-09-18 02:12:41 UTC
Permalink
Attached a full lshal.

** Attachment added: "lshal"
http://librarian.launchpad.net/4292283/lshal.txt
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
John Dong
2006-09-29 15:34:54 UTC
Permalink
Removing debian/patches/00upstream-02-mWh-conversion.patch does fix
this problem for me. Attached another lshal.

** Attachment added: "lshal when patch is reversed."
http://librarian.launchpad.net/4542740/lshal.txt
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
John Dong
2006-09-29 15:38:17 UTC
Permalink
Here's what /proc/acpi has to say about my battery.

** Attachment added: "/proc/acpi/battery contents"
http://librarian.launchpad.net/4542743/battery.tar.gz
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Paul Williams
2006-10-09 04:01:22 UTC
Permalink
I can confirm this on an Acer Aspire laptop. I will try your fox
tomorrow. Marked as confirmed.

** Changed in: hal (Ubuntu)
Status: Unconfirmed => Confirmed
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Stefano Costa
2006-10-29 10:47:52 UTC
Permalink
I confirm this too. I'll try your patch. See also
http://www.ubuntuforums.org/showthread.php?t=285689&highlight=battery+edgy

** Attachment added: "output of lshal on Acer Aspire 1652 WLMi, under Edgy"
http://librarian.launchpad.net/4939950/lshal
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Mirco Briosi
2006-10-29 11:46:59 UTC
Permalink
Same problem on an IBM Z60m, should you need any detailed info, just let
me know...
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Lucas Moreno
2006-11-02 12:12:59 UTC
Permalink
I can confirm this on an Acer Aspire 1692 WLMi

Why this bug has no "high" importance? My battery status reports 100%,
66%, 33% and 0% and no hibernation is taken when the battery level is
critical.
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
John Dong
2006-11-02 16:11:30 UTC
Permalink
Mainly because this affects relatively few laptop models, and the "fix"
proposed here will break more laptops than it fixes....
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Stefano Costa
2006-11-02 16:29:21 UTC
Permalink
Yes, but previous versions worked without any problem, so, there has to
be a way to find what's wrong with this version.
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
John Dong
2006-11-02 16:54:23 UTC
Permalink
On our laptops yes, but previous versions had incorrect battery
reporting on many other laptops, too. The fix, a corrected metric unit
conversion, unfortunately breaks our laptops but also fixes the other
ones.
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Lucas Moreno
2006-12-17 14:58:05 UTC
Permalink
Is there any solution/workaround to fix this problem? I have still
incorrect battery levels.

I tried compiling HAL without the patch "00upstream-02-mWh-
conversion.patch" but that didn't fix the problem.
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Martin Pitt
2007-01-10 12:50:19 UTC
Permalink
Can you please test the latest Feisty version? It got this patch:

hal (0.5.8.1-4ubuntu2) feisty; urgency=low

* Add debian/patches/00upstream-01-acpi-low-powerlevels.patch:
- Fix ACPI problems with incorrect low current voltage values.
- Patch taken from upstream git 9c99fc03fbac6380032a6678c641a76ef02ad834.
- Closes: LP#66025


** Changed in: hal (Ubuntu)
Status: Confirmed => Needs Info
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Stefano Costa
2007-01-10 13:53:50 UTC
Permalink
Works for me!
Thanks!

Steko

(Acer Aspire 1650)
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Stefano Costa
2007-01-10 14:34:24 UTC
Permalink
Post by Stefano Costa
Works for me!
Uhm, there must be something wrong because the power led is always
blinking and yellow, no matter if AC is connected or not. But percentage
is correct.
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Martin Pitt
2007-01-11 08:30:26 UTC
Permalink
*** This bug is a duplicate of bug 66025 ***
Post by Stefano Costa
Uhm, there must be something wrong because the power led is always
blinking and yellow, no matter if AC is connected or not. But percentage
is correct.
Ok, but that cannot be due to that hal patch. Any idea what else
changed?

Thanks for testing!


** This bug has been marked a duplicate of bug 66025
gnome-power-manager does not update often enough, only updates every 25% of battery charge
--
HAL reports incorrect battery percentages
https://launchpad.net/bugs/60989
Loading...