AC adapter status don't change when unpluged it

Bug #254603 reported by elbowz
6
Affects Status Importance Assigned to Milestone
hal (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: hal

I have a vaio VGN_FE31M with ubuntu hardy 8.04

AC adapter status is not detected entirely correctly.
HAL doesn’t seem to register the ACPI change event for the AC adapter - so the AC status will remain the same as it was on first boot (or if you manually restart HAL…)
This means things like backlight adjustment based on AC status do not work (with gnome-power-manager).

Some report with AC plugged in:

$cat /proc/acpi/ac_adapter/ADP1/state
state: on-line

$ lshal | grep ac_adapter.present
ac_adapter.present = true (bool)

Some report with AC plugged out:

$ cat /proc/acpi/ac_adapter/ADP1/state
state: off-line

$ lshal | grep ac_adapter.present
ac_adapter.present = true (bool) <--- would be false!

and at the end, the result for "lshal -m"

#ac adpater just connetced
12:36:12.050: computer_power_supply_battery_BAT0 property battery.remaining_time = 80910 (0x13c0e)
12:36:12.053: computer_power_supply_battery_BAT0 property battery.rechargeable.is_discharging = true
12:36:12.057: computer_power_supply_battery_BAT0 property battery.rechargeable.is_charging = false
12:36:15.608: computer_power_supply_battery_BAT0 property battery.remaining_time = 61 (0x3d)
#unplugged ac adpater
12:36:15.612: computer_power_supply_battery_BAT0 property battery.charge_level.current = 44780 (0xaeec)
12:36:15.614: computer_power_supply_battery_BAT0 property battery.reporting.current = 44780 (0xaeec)
12:36:15.616: computer_power_supply_battery_BAT0 property battery.rechargeable.is_discharging = false
12:36:15.618: computer_power_supply_battery_BAT0 property battery.rechargeable.is_charging = true

Seems HAL is registering everything about the battery except the AC status, although ACPI is picking this up right. Anyone got any ideas what’s going on here?

Sorry for my bad english...and thanks for help!

Revision history for this message
Moebius (louiscyphre) wrote :

Same problem here on Sony Vaio VGN-FE31M.
Probably this bug is related to https://bugs.launchpad.net/bugs/213128.

Temporary workaround.
Create the files:

/etc/acpi/ac.d/power-switch.sh containing:
hal-set-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present --bool true

/etc/acpi/battery.d/power-switch.sh containing:
hal-set-property --udi `hal-find-by-capability --capability ac_adapter` --key ac_adapter.present --bool false

Hope it helps.

Revision history for this message
Alex Midgley (alex-tapdancinggoats) wrote :

This bug seems to have moved into acpi in Jaunty. I have a Sony Vaio VGN-CR520E, and the above fix corrected the hal problem in Intrepid. However, now even acpi is always reporting that the AC adapter is plugged in.

acpi -V (plugged in)
     Battery 0: Charging, 81%, 04:06:26 until charged
     Battery 0: design capacity 53280 mAh, last full capacity 50890 mAh = 95%
  AC Adapter 0: on-line
     Thermal 0: ok, 47.0 degrees C
     Cooling 0: LCD 0 of 8
     Cooling 1: Processor 0 of 10
     Cooling 2: Processor 0 of 10

acpi -V (unplugged)
     Battery 0: Discharging, 81%, 02:16:47 remaining
     Battery 0: design capacity 53280 mAh, last full capacity 50890 mAh = 95%
  AC Adapter 0: on-line
     Thermal 0: ok, 47.0 degrees C
     Cooling 0: LCD 0 of 8
     Cooling 1: Processor 0 of 10
     Cooling 2: Processor 0 of 10

It detects that the battery is discharging, but not that the AC adapter is off-line.

Revision history for this message
Scott Howard (showard314) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 213128, so it is being marked as such. While their original report was in Guidance-power-manager, it has been determined to be the same problem you are having with hal. I've copied over some of your comments, but please check it out and add anything that is missing.

Changed in hal (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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