HAL does not update Gnome-Power-Manager with battery readings

Bug #253073 reported by HillerD
10
Affects Status Importance Assigned to Milestone
HAL
Won't Fix
High
Linux
Invalid
Medium
gnome-power
Invalid
Undecided
Unassigned
hal (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: hal

the issue is observed in Ubuntu 8.04 (hardy heron) with up to date packages.

Gnome-Power-Manager does not update the battery reading of the laptop.
I believe something messed up HAL because of the following:
When I check the battery manually (acpi -b), lshal -m produces

10:56:42.004: computer_power_supply_battery_BAT0 property battery.remaining_time = 700 (0x2bc) (new)
10:56:42.009: computer_power_supply_battery_BAT0 property battery.charge_level.percentage = 21 (0x15)
10:56:42.013: computer_power_supply_battery_BAT0 property battery.charge_level.rate = 21223 (0x52e7)
10:56:42.016: computer_power_supply_battery_BAT0 property battery.charge_level.current = 13556 (0x34f4)
10:56:42.020: computer_power_supply_battery_BAT0 property battery.reporting.current = 916 (0x394)
10:56:42.022: computer_power_supply_battery_BAT0 property battery.rechargeable.is_charging = true
10:56:42.023: computer_power_supply_battery_BAT0 property battery.reporting.rate = 1434 (0x59a)
10:56:42.025: computer_power_supply_battery_BAT0 property battery.voltage.current = 16706 (0x4142)

and gpm updates the battery reading.

On Feisty (gpm working) I observed, that lshal -m produces every minute this output:

acpi_BAT0 property battery.charge_level.percentage = 93 (0x5d)
acpi_BAT0 property battery.remaining_time = 3781 (0xec5)
acpi_BAT0 property battery.charge_level.current = 16605 (0x40dd)
acpi_BAT0 property battery.voltage.current = 15882 (0x3e0a)
acpi_BAT0 property battery.reporting.current = 1122 (0x462)

which is missing in 8.04.
So g-p-m is not updated regularily on the battery status.

Further data:
----------------
$ apt-cache policy hal
hal:
  Installiert:0.5.11~rc2-1ubuntu8.1
  Mögliche Pakete:0.5.11~rc2-1ubuntu8.1
  Versions-Tabelle:
 *** 0.5.11~rc2-1ubuntu8.1 0
        500 http://de.archive.ubuntu.com hardy-updates/main Packages
        100 /var/lib/dpkg/status
     0.5.11~rc2-1ubuntu7 0
        500 http://de.archive.ubuntu.com hardy/main Packages

$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04

Revision history for this message
In , Hillerd-tiscali (hillerd-tiscali) wrote :
Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

Binary package hint: hal

the issue is observed in Ubuntu 8.04 (hardy heron) with up to date packages.

Gnome-Power-Manager does not update the battery reading of the laptop.
I believe something messed up HAL because of the following:
When I check the battery manually (acpi -b), lshal -m produces

10:56:42.004: computer_power_supply_battery_BAT0 property battery.remaining_time = 700 (0x2bc) (new)
10:56:42.009: computer_power_supply_battery_BAT0 property battery.charge_level.percentage = 21 (0x15)
10:56:42.013: computer_power_supply_battery_BAT0 property battery.charge_level.rate = 21223 (0x52e7)
10:56:42.016: computer_power_supply_battery_BAT0 property battery.charge_level.current = 13556 (0x34f4)
10:56:42.020: computer_power_supply_battery_BAT0 property battery.reporting.current = 916 (0x394)
10:56:42.022: computer_power_supply_battery_BAT0 property battery.rechargeable.is_charging = true
10:56:42.023: computer_power_supply_battery_BAT0 property battery.reporting.rate = 1434 (0x59a)
10:56:42.025: computer_power_supply_battery_BAT0 property battery.voltage.current = 16706 (0x4142)

and gpm updates the battery reading.

On Feisty (gpm working) I observed, that lshal -m produces every minute this output:

acpi_BAT0 property battery.charge_level.percentage = 93 (0x5d)
acpi_BAT0 property battery.remaining_time = 3781 (0xec5)
acpi_BAT0 property battery.charge_level.current = 16605 (0x40dd)
acpi_BAT0 property battery.voltage.current = 15882 (0x3e0a)
acpi_BAT0 property battery.reporting.current = 1122 (0x462)

which is missing in 8.04.
So g-p-m is not updated regularily on the battery status.

Further data:
----------------
$ apt-cache policy hal
hal:
  Installiert:0.5.11~rc2-1ubuntu8.1
  Mögliche Pakete:0.5.11~rc2-1ubuntu8.1
  Versions-Tabelle:
 *** 0.5.11~rc2-1ubuntu8.1 0
        500 http://de.archive.ubuntu.com hardy-updates/main Packages
        100 /var/lib/dpkg/status
     0.5.11~rc2-1ubuntu7 0
        500 http://de.archive.ubuntu.com hardy/main Packages

$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

One idea that just crosses my mind:
Might it be possible, that in the past (so Feisty Fawn) "acpi" was broadcasting the battery status and that now (Hardy Heron) this should be done by "computer_power_supply_battery" (just guessing from the prefix)?
In that case, it might be possible, that my laptop (3 years old) does not support that feature. How can I check?
I then would have to make acpi do that job instead. How could I do that?
As a very ugly work-around I am now running always a script "watch acpi -b", which obviously makes acpi broadcast battery info.

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

tried with boot option apm=on
This caused g-p-m to not update the battery status any more. Note, previously it showed new values, that were all the same. Interestingly, when unplugging the power cord the values were updated. So there must be different mechanisms running for detecting power cord and battery charge changes. The later is not running on my system and apm just makes it worse.

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

Now following the instructions of https://wiki.ubuntu.com/DebuggingHal:

Computer: Laptop Acer Travelmate 4002LMi

14:48 unplugged power chord (got notification window, laptop-mode is activated (disk turned off <- still need to figure out to stop that)
-> no update of power reading in gnome-power-manager
14:52 plugged power chord in again

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

The same as above but with "watch acpi -b" running in parallel
14:57 unpluggd power chord, started "watch acpi -b"
-> updated power reading EVERY minute (even though watch is updated every 2s!)
14:59 plugged in power chord

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :
Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :
Changed in hal:
status: Unknown → Confirmed
Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

Now following the instructions according to https://wiki.ubuntu.com/DebuggingGNOMEPowerManager:

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

$ hal-find-by-capability --capability "battery"
/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT1
/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

$ dbus-monitor --session "type='signal',interface='org.freedesktop.PowerManagement'"
###unplug power supply
signal sender=org.freedesktop.DBus -> dest=:1.29 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.29"
signal sender=:1.10 -> dest=(null destination) path=/org/freedesktop/PowerManagement; interface=org.freedesktop.PowerManagement; member=OnBatteryChanged
   boolean true
signal sender=:1.10 -> dest=(null destination) path=/org/freedesktop/PowerManagement; interface=org.freedesktop.PowerManagement; member=PowerSaveStatusChanged
   boolean true
###plug power supply
signal sender=:1.10 -> dest=(null destination) path=/org/freedesktop/PowerManagement; interface=org.freedesktop.PowerManagement; member=OnBatteryChanged
   boolean false
signal sender=:1.10 -> dest=(null destination) path=/org/freedesktop/PowerManagement; interface=org.freedesktop.PowerManagement; member=PowerSaveStatusChanged
   boolean false

NB: no intermediate event to show change in battery power state!

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :
Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

$ killall gnome-power-manager
$ gnome-power-manager --verbose --no-daemon 2>&1 | tee gpm.debug.log.txt

at the end of the log I added the command "watch --interval=10 acpi -b" in a 2nd terminal.
This caused the hal messages

=> normally, hal does not produce these messages, thus gpm has no input to change power settings.
Another confirmation that somehow I have to tell hal that the battery status has changed!

HOW???

Revision history for this message
Ludovic Silvestre (hellknight-ludo) wrote :

I have the same problem on Arch Linux, althought since they changed the kernel to version 2.6.26.3, hal updates every 30 seconds the battery status.
There's still some problems, for example it seems hal's battery information might not be correct, because my laptop shuts down when it still has 15% of charge, and hal still shows 2 batteries.
I think the bug comes from the kernel and not hal itself.

By the way, my laptop is a Acer TravelMate 4001WLmi, which is similar to yours.

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

I am using the Hardy Heron Kernel, which is I think 2.6.24.
I found 2 Linux bug fixes for a similar issue:
http://bugzilla.kernel.org/show_bug.cgi?id=9730
and the linked: http://bugzilla.kernel.org/show_bug.cgi?id=9221

Unfortunately, they require recompiling the kernel, if I understood well, which is for beyond my IT knowledge. Could these fixes be inserted in the next Hardy Kernel update?

Changed in linux:
status: Unknown → Invalid
Revision history for this message
Christian Scherrer (krystiann) wrote :

A somehow similar problem occurs over here with an Acer TM 4050 on Ubuntu 8.10, 8.04 and 7.10.
1. After booting g-p-m falsely reports running on battery.
2. The charging remains on 59,6%, although the battery its fully loaded.
- Removing the power-chord and plugging it again shows the right symbol.
- This behaviour seems to be the same on this machine for the last three Ubuntu-releases.

Revision history for this message
HillerD (hillerd-deactivatedaccount) wrote :

try to run this command in a terminal:
watch --interval=10 acpi -b

While this is running, does g-p-m report the correct values?
It is my current work around solution. But I have no clue, why this helps.

Revision history for this message
In , Danny Kukawka (danny-kukawka) wrote :

Sounds to me like a kernel (or acpid) bug and not a HAL issue, since HAL is only listen to acpid or the kernel. If there are no events, HAL can't do anything. But feel free to check with the latest HAL release/git.

Changed in hal:
status: Confirmed → Invalid
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Upstream said on bug 16798, "Sounds to me like a kernel (or acpid) bug and not a HAL issue, since HAL is
only listen to acpid or the kernel. If there are no events, HAL can't do
anything. But feel free to check with the latest HAL release/git.
"
Could you try with latest or open a linux task?

Changed in gnome-power:
status: New → Invalid
Changed in hal:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as requested in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the "Status" column, and change the status back to "New". Thanks again!

Changed in hal (Ubuntu):
status: Incomplete → Invalid
Changed in hal:
importance: Unknown → High
status: Invalid → Won't Fix
Changed in hal:
importance: High → Unknown
Changed in hal:
importance: Unknown → High
Changed in linux:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.