[Karmic] power management icon says laptop is connected to power when it isn't

Bug #393008 reported by Laura Czajkowski on 2009-06-27
This bug affects 17 people
Affects Status Importance Assigned to Milestone
devicekit-power (Ubuntu)
Nominated for Karmic by Emilio
gnome-power-manager (Ubuntu)
Nominated for Karmic by Emilio

Bug Description

What I expect to happen:
When the power supply is unplugged it should show a battery

What happens:
It shows a plug

Random notes:
The command
$ acpi
Battery 0: Discharging, 72%, 00:57:41 remaining
knows it's on battery but the applet doesn't.

Laptop Notes:
This laptop is a Toshiba Equium. Running Ubuntu Karmic Alpha 2.

Program Notes:
Power manager 2.27.1

Ubuntu Version:
Description: Ubuntu karmic (development branch)
Release: 9.10

Laura Czajkowski (czajkowski) wrote :
Scott Howard (showard314) wrote :

Thanks for your report and helping make Ubuntu better. Confirming because of duplicate.

Possible regression: bug #250649

Changed in gnome-power-manager (Ubuntu):
status: New → Confirmed
summary: - power management icon says laptop is connected to power when it isn't
+ [Karmic] power management icon says laptop is connected to power when it
+ isn't
Scott Howard (showard314) wrote :
Download full text (3.8 KiB)

From Bug #386778 reported by Patrick (patrick-voegeli):

Using Karmic, gnome-power-manager doesn't work fine. It won't detect that the battery is discharging or even running on battery. Also, when pluging in the AC to charged, it acts flacky.

When running on battery:
atrick@patrick-laptop:~$ acpi -ab --details
Battery 0: Unknown, 34%
Battery 0: design capacity 5200 mAh, last full capacity 4587 mAh = 88%
Adapter 0: off-line

When running on ac:
patrick@patrick-laptop:~$ acpi -ab --details
Battery 0: Charging, 34%, 01:12:51 until charged
Battery 0: design capacity 5200 mAh, last full capacity 4587 mAh = 88%
Adapter 0: on-line

Running on battery and plugging the AC:
patrick@patrick-laptop:~$ lshal -m

Start monitoring devicelist:
20:27:54.653: computer_power_supply_battery_BAT0 property battery.remaining_time = 1569 (0x621) (new)
20:27:54.659: computer_power_supply_battery_BAT0 property battery.charge_level.percentage = 33 (0x21)
20:27:54.662: computer_power_supply_battery_BAT0 property battery.charge_level.rate = 0 (0x0)
20:27:54.665: computer_power_supply_battery_BAT0 property battery.charge_level.design = 56976 (0xde90)
20:27:54.668: computer_power_supply_battery_BAT0 property battery.charge_level.last_full = 50259 (0xc453)
20:27:54.671: computer_power_supply_battery_BAT0 property battery.charge_level.current = 17060 (0x42a4)
20:27:54.688: computer_power_supply_battery_BAT0 property battery.reporting.current = 1557 (0x615)
20:27:54.689: computer_power_supply_battery_BAT0 property battery.rechargeable.is_discharging = true
20:27:54.690: computer_power_supply_battery_BAT0 property battery.reporting.rate = 0 (0x0)
20:27:54.691: computer_power_supply_battery_BAT0 property battery.voltage.current = 10957 (0x2acd)
20:27:54.770: computer_power_supply_ac_adapter_ADP1 property ac_adapter.present = true

Running on ac and unplugging:
patrick@patrick-laptop:~$ lshal -m

Start monitoring devicelist:
20:28:26.272: computer_power_supply_battery_BAT0 property battery.remaining_time = 4357 (0x1105)
20:28:26.279: computer_power_supply_battery_BAT0 property battery.charge_level.current = 17504 (0x4460)
20:28:26.280: computer_power_supply_battery_BAT0 property battery.reporting.current = 1577 (0x629)
20:28:26.282: computer_power_supply_battery_BAT0 property battery.voltage.current = 11658 (0x2d8a)
20:28:26.367: computer_power_supply_ac_adapter_ADP1 property ac_adapter.present = false

Both acpi and hal will detect the change from battery to charging IMMEDIATELY, but gnome-power-manager won't. It doesn't detect it's running on battery at all: the icon is like when running only on AC (only the plug icon), and if under preferences "running on ac" tab I pull the brightness down, it will decrease the brightness. In the general tab, the icon will only display if Display always is checked, the other 3 options hide the power-manager icon. Also, as stated before, when pluging the ac, it will first display discharging (even though it acts as when on AC, icon displayed is a battery) and after half a minute it will show the correct charging state (battery with the plug)



Taneli Leppä (rosmiitto) wrote :

Confirmed on my HP Mini 2140 as well.

Taneli Leppä (rosmiitto) wrote :

Latest updates seems to have fixed this.

Scott Howard (showard314) wrote :

Thanks for the update, could the original reporter test this in karmic? I know they brought a new GPM and dk-p into the karmic archives.

Changed in gnome-power-manager (Ubuntu):
status: Confirmed → Incomplete
NoahY (noahy) wrote :

My laptop also shows the plug, with latest updates as of August 15th, 2009 (Karmic x64).

In the power settings, there is no tab for "when running on battery" as there was in Jaunty. It's as though the power manager doesn't even know I am using a laptop.

Han Si (johannw-fleck) wrote :

I have the same problem here. Acer Aspir One 751
gnome-power-manager 2.27.92

Han Si (johannw-fleck) wrote :

After going to standby and login again, the battery suddenly is recognized and gpm shows correct values of charging. After a restart I have the same problem as described above. Plugin and remove the chord makes no difference.

Emilio (turl) wrote :

Happens also here, with Karmic fully updated on amd64. I just booted using my battery and gnome-power-manager says I'm running on AC Power. Do not hesitate to ask for any information needed.

Changed in gnome-power-manager (Ubuntu):
status: Incomplete → Confirmed
AppleBonker (bonk-adam) wrote :

I am also having the same problem on an HP dv-3500 series laptop. It doesn't appear that acpi is correctly determining the status. I am seeing the same thing as Scott:

$ acpi -ab
Battery 0: Unknown, 82%
Adapter 0: off-line

AppleBonker (bonk-adam) wrote :

Sorry, I meant Patrick, the original poster.

gali98 (korylp) wrote :

It was working fine since I installed the beta, but today after installing updates, gnome-power-manager no longer detects the battery at all.
kory@kory:~$ acpi -ab
Battery 0: Discharging, 26%, rate information unavailable
Adapter 0: off-line


AppleBonker (bonk-adam) wrote :

I just finished installing today's updates and am no seeing a slightly different issue. When I unplug the AC cord, the laptop immediately notices that the battery is discharging. However, the battery capacity hangs at 100% for a while. Then it'll drop down to about 94% remaining. Once that happens, I get a similar message to gali98 when running acpi:

$acpi -ab
Battery 0: Discharging, 94%, discharging at zero rate - will never fully discharge.
Adapter 0: off-line

It seems that gnome-power-manager has gotten a bit better with these updates. I am at least showing that the battery is discharging, which is an improvement from yesterday. However, I obviously can't calculate remaining time as I don't seem to be showing a discharge rate.

gali98 (korylp) wrote :

After today's updates, everything is working fine again.
My acpi -ab still has the same message about rate information available, and it doesn't appear gnome-power-manager is able to calculate charge/discharge rates either.

Jim Popovitch (jimpop) wrote :

$ sudo reboot
$ acpi -ab
Adapter 0: off-line
$ acpi -p -b
Battery 0: discharging, 25%, 01:44:23 remaining

This leads me to assume that the problem lies in /sys somehow.

Troy R. (dsm-iv-tr) wrote :

On my Acer AspireOne 110L, I experience the same issue - with the additional information that

$ acpi -V

reports the correct values for me.

(Installed via update-manager -d from 9.04)

Jim Popovitch (jimpop) wrote :

Any idea on when we can get new pkgs to test? Anyone? Bueller?

I'm surprised that something this serious (seems to affect most laptops) is going stale....

I wonder if this bug will languish on like this one did: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/60442

-Jim P.

Afer updating my Karmic install yesterday, the bug appears resolved.

Jim Popovitch (jimpop) wrote :

I think it is only partially resolved. See: http://picasaweb.google.com/jimpop/Public#5393220845517413378

Maintainer: Should a new bug be opened?

-Jim P.

Scott Howard (showard314) wrote :

Pointing out two similar bugs:
Bug #381242
Bug #384304

For further debugging try:
'devkit-power --dump'

And see if those values correspond to the real state.

jango (pjalegria) wrote :

After final release i still have this problem on my Acer Aspire One 110L

foggydude (rogier-stekje) wrote :

im affected too

packard bell dot m/ acer aspire 751

it often (not always!) doesnt realise i plugged out my ac. and thus it dies on low batt (lots of fsck trouble) instead of hibernate....

Jim Popovitch (jimpop) wrote :

OK, I finally got around to testing something, and am happy to report that the fix is adding the following to rc.local

cat /proc/acpi/battery/BAT1/state > /dev/null

AppleBonker (bonk-adam) wrote :


That fix did not work for me. The battery state is showing correctly, but my discharge/charge rate is incorrect:

$ cat /proc/acpi/battery/BAT0/state
present: yes
capacity state: ok
charging state: discharging
present rate: 0 mA
remaining capacity: 4511 mAh
present voltage: 11822 mV

cat /proc/acpi/battery/BAT0/state
present: yes
capacity state: ok
charging state: charging
present rate: 0 mA
remaining capacity: 4479 mAh
present voltage: 11808 mV

AppleBonker (bonk-adam) wrote :


Additionally, your recommendation gives the following:

$ devkit-power --dump
Device: /org/freedesktop/DeviceKit/Power/devices/line_power_AC
  native-path: /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
  power supply: yes
  updated: Thu Nov 19 22:12:44 2009 (315 seconds ago)
  has history: no
  has statistics: no
    online: yes

Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor: Hewlett-Packard
  model: Primary
  serial: 00617 10/16/2008
  power supply: yes
  updated: Thu Nov 19 22:17:44 2009 (15 seconds ago)
  has history: yes
  has statistics: yes
    present: yes
    rechargeable: yes
    state: charging
    energy: 51.2265 Wh
    energy-empty: 0 Wh
    energy-full: 55.0449 Wh
    energy-full-design: 55.0449 Wh
    energy-rate: 0 W
    voltage: 12.521 V
    percentage: 93.0631%
    capacity: 100%
    technology: lithium-ion
  History (charge):
    1258690664 93.063 charging

  daemon-version: 011
  can-suspend: yes
  can-hibernate yes
  on-battery: no
  on-low-battery: no
  lid-is-closed: no
  lid-is-present: yes

Again, whether or not the laptop is charging or discharging is correctly identified. However, there is clearly an issue determining the rate at which it is doing so. The percentage will update when checking the battery state multiple times, so it is certainly charging/discharging at a rate other than 0W.

kenburgi (kwburgi) wrote :

This problem is intermittent on my Dell Studio 1537. The command "cat /proc/acpi/battery/BAT0/state" always seems to show correctly whether the AC adapter is present, but the gnome-power-manager in the panel and the output of devkit-power --dump always says the AC adapter is connected.

When I check the power history is shows the laptop battery with the refreshed attribute set to 55876 seconds. Not sure what that is, but if that is how often gnome-power-manager checks for the ac adapter it could be part of the problem.

kenburgi (kwburgi) wrote :

attached screen shot showing refresh attributes of gnome-power-manager.

Chris B (billington-chris) wrote :

Although the issues here are grouped together, it may be that there are a variety of causes. The common factor is that battery state and rate are not correctly reported.

Some possible scenarios are:

If the values in /proc and /sys show state but do not give the rate figure, then the likely cause is a broken DSDT in BIOS. I have a laptop that does this- the DSDT needed to be changed to read the rate values. Other batteries/DSDT may be broken in other ways.

Some batteries do are not read correctly by Devkit-Power, however. I had a battery that contained binary rubbish in one of the fields read by acpi, and this caused devkit-power-daemon to quit (leading to a long 'last update' figure.) You can check for this by killing all running instances of devkit-power-daemon, then running /usr/lib/devicekit-power/devekit-power-daemon -v and watching the output.

My battery issues were resolved by compiling a custom DSDT into the kernel. This is the only way to use a custom DSDT at present on Karmic. Subsequently, the binary rubbish issue was fixed in Devicekit-power, and when the package arrives in the repos. I expect to be able to revert to a standard kernel.

In my experience on about 6 machines, battery/ac adapter problems have all been caused by a broken or badly written DSDT in the BIOS.

Chris B (billington-chris) wrote :

Link to the Launchpad issue where binary garbage was preventing battery state being read:

tom (tom+launchpad-trap) wrote :

For me "cat /proc/acpi/battery/*/*" (as the user, not root) makes gnome-power-manager figure things out (at least until the next time the ac is plugged in)... Also since the karmic upgrade (when this problem started), my only battery shows up as BAT1 under /proc/acpi/battery. I used to be BAT0... Don't have any other karmic machines here to test on.

svasilis (vstamatelatos) wrote :

I have got the same problem here and the suggestions above did not help. I have an Aspire One ZG5 netbook. Power manager was working fine under Jaunty(9.06). I upgraded by doing a clean install and found out the hard way the power manager was not working - battery ran out, netbook did not go to suspension, just crashed (like when you pull the plug) and lost my data on the home folder(separate partition+encrypted), so had to do another clean install. I also tried a suggestion mentioned here https://help.ubuntu.com/community/AspireOne/Ubuntu9.10 It worked fine until I rebooted and then it seized working. :(

Peter Cherriman (pjcherriman) wrote :

I'm also having same problem with my Acer Aspire 110L, if you unplug the power the screen dims, but power manager doesn't detect it. Also if you plug in the power when battery is less than 100% then disconnect a few seconds later it now things the battery is fully charged!

None of the suggested work arounds work for me, just have to keep an eyes on the battery in /proc/acpi for time to time which is really tiresome.

Another possibly related bug is power manager and acpi also thinks the laptop is using 750Watts when charging as reported in bug #451557. It wasn't that much with jaunty.

laurybueno (laury-bueno) wrote :

The best workarround I've seen so far is to install the XFCE4-Power-Manager package. It recognizes the battery state with no problems at all.

Malin Bruland (malinkb) wrote :

I still get this bug with Lucid Lynx 10.04 beta2

tried on different kernels such as 2.6.32, 2.6.33 and 2.6.34

I made it work on 2.6.31 when I used kernelcheck to set ac_adaptor to module. This dosen't work with newer kernels.

Changed in devicekit-power (Ubuntu):
status: New → Confirmed
Girish Adat (girishadat) wrote :

Just to add one more observation.

I am facing the problem described in this bug only after a wakeup from sleep. It is working perfectly just after the boot.

Off-topic: I've been forcefully sleeping my laptop (Toshiba Portege M900) and waking it up, as a work around to get my fan working, after every boot. (The fan problem is a long story, better not to explain here. For more details on that plz visit - http://lwn.net/Articles/244595/). In short, for me, if the battery indicator is perfect then fan is not, and vice versa.

Girish Adat (girishadat) wrote :

More details of my machine:

girish@girish-PORTEGE-M900:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
girish@girish-PORTEGE-M900:~$ uname -a
Linux girish-PORTEGE-M900 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:02:55 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Girish Adat (girishadat) wrote :

Same issue is there migrated in Ubuntu 11.10

girish@girish-PORTEGE-M900:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric

girish@girish-PORTEGE-M900:~$ uname -a
Linux girish-PORTEGE-M900 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers