gnome-power-manager doesn't recognize battery removed

Bug #144830 reported by nynexman4464 on 2007-09-25
32
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: gnome-power-manager

When I remove the battery from my IBM T23, gnome power manager doesn't show that the battery has been removed. The system tray icon continues to display that it is charging and that the battery is full (or nearly full). However, when I click on the icon, the dropdown shows the battery as charging, but with 0% charge on it (as does the dropdown icon). When I put the battery back in it shows 100%, like it should.

/proc/acpi/battery/BAT0/info state and alarm all say present: no when the battery is removed. The system does recognize when I unplug the AC power with the battery installed, albeit slowly.

uname -a: Linux conrad 2.6.22-12-generic #1 SMP Sun Sep 23 18:11:30 GMT 2007 i686 GNU/Linux

nynexman4464 (alex-alexrock) wrote :

This has been fixed as of today. Much faster too. thanks.

Pedro Villavicencio (pedro) wrote :

Ok, thanks for let us know about it.

Changed in gnome-power-manager:
status: New → Fix Released
pelle.k (pele2) wrote :

I've got a LG R500 CB-V, and have this behaviour on the hardy heron beta, updated as of April 4:th 2008. It say "running on AC power", and also that the battery is fully charged, even though the battery is not *in* the laptop at all. I disconnected it (always do) while the computer was on, but fully charged.
It supposedly detects the battery removal, because this is the output of /var/log/acpid when puttin the battery in, and the out.
Let me clarify that i do not see the notification icon normally, when booting on AC only, and leave it like that.
"""
[Fri Apr 4 21:39:06 2008] received event "battery CMB0 00000081 00000000"
[Fri Apr 4 21:39:06 2008] notifying client 5711[110:122]
[Fri Apr 4 21:39:06 2008] notifying client 5871[0:0]
[Fri Apr 4 21:39:06 2008] notifying client 5871[0:0]
[Fri Apr 4 21:39:06 2008] executing action "/etc/acpi/power.sh"
[Fri Apr 4 21:39:06 2008] BEGIN HANDLER MESSAGES
[Fri Apr 4 21:39:06 2008] END HANDLER MESSAGES
[Fri Apr 4 21:39:06 2008] action exited with status 0
[Fri Apr 4 21:39:06 2008] completed event "battery CMB0 00000081 00000000"
[Fri Apr 4 21:39:06 2008] received event "battery CMB0 00000080 00000000"
[Fri Apr 4 21:39:06 2008] notifying client 5711[110:122]
[Fri Apr 4 21:39:06 2008] notifying client 5871[0:0]
[Fri Apr 4 21:39:06 2008] notifying client 5871[0:0]
[Fri Apr 4 21:39:06 2008] executing action "/etc/acpi/power.sh"
[Fri Apr 4 21:39:06 2008] BEGIN HANDLER MESSAGES
[Fri Apr 4 21:39:06 2008] END HANDLER MESSAGES
[Fri Apr 4 21:39:06 2008] action exited with status 0
[Fri Apr 4 21:39:06 2008] completed event "battery CMB0 00000080 00000000"
"""

Maxim Levitsky (maximlevitsky) wrote :

I have the same bug.

I have an acer aspire 5720G, and if I unplug the battery,
gnome-power-manger shows that battery is empty, and that it
can't get it status, but it doesn't show the AC icon unless I restart this application.

Maxim Levitsky (maximlevitsky) wrote :

Any progress on that?

Here on hardy I see this bug

Maxim Levitsky (maximlevitsky) wrote :

The comment about released fix is old, I have this issue on hardy

Changed in gnome-power-manager:
status: Fix Released → Confirmed
Chow Loong Jin (hyperair) wrote :

On Hardy, Lenovo Y410: When battery is removed while on AC power, the icon and tooltip stays at what it was before I remove the battery:

Computer is running on AC power
Laptop battery fully charged (100%)
Provides 2 hours 15 minutes battery runtime

I believe that GNOME Power Manager should recognize a battery's removal and show something accordingly. The Battery Charge Monitor applet detects this correctly.

Maxim Levitsky (maximlevitsky) wrote :

More information:

When kernel is compiled with old /proc acpi interface, everything works fine.
When clicking on the icon it even shows that battery is absent.
This is the default behavier in hardy, but I compiled 2.6.27 and turned /sys interface on.

On the other hand interpid has /sys interface by default, and I see that bug there.

On Intrepid, the battery entry in the menu that appears from
left-clicking the g-p-m icon disappears after I remove the battery,
indicating that g-p-m recognizes that the battery is removed. The icon
tooltip remains the same though: "Laptop battery fully charged
(100.0%)".

On a slightly unrelated note, g-p-m doesn't seem to automatically
hibernate my notebook when the battery is at a critical level any more,
even though it's set in the preferences.
--
Chow Loong Jin

Maxim Levitsky (maximlevitsky) wrote :

Exactly.

I test what happens when battery charge is critical, never used that functionality.
I suggest you file a bug report about that.

Maxim Levitsky (maximlevitsky) wrote :

Well, this is a bug in gnome-power-manager.

The /proc battery remains registered in hal all the time, but changes status from present to not present.
it makes sense, since /proc file _is_ present anyway.
gpm detects, when it becomes not present, and changes icon accordantly.

But, the /sys battery actually disappears altogether, together with /sys file, but gpm doesn't handle this action , and thus doesn't update the battery icon.

Maxim Levitsky (maximlevitsky) wrote :

@hyperair, this does actually work, gpm works correctly when it is configured:
"only display icon when charging or discharging".

Since when you pull the battery out it can't do nether, and gpm understands it, it hides the icon. what gpm doesn't understand let me repeat, is that it was removed.

Maxim Levitsky (maximlevitsky) wrote :

It is even worse, when you boot without battery, it will hide the battery options, since it has no way to know if it is present.

Now thinking again about this, maybe kernel should change this behavier first.

I use 2.6.30-rc2 btw.

Maxim Levitsky (maximlevitsky) wrote :

I have noticed few patches on LKML that should fix this issue in kernel by making sysfs interface behave in same way as /proc was.

I hope they include these patches.

Allan Caeg (allancaeg) wrote :

Any update?

Michele (mikelito) wrote :

being bitten twice by this bug, once on a thinkpad t60 w/Intrepid and once on a Dell Studio 15 running Jaunty.
Any ideas for a fix or a workaround?

Maxim Levitsky (maximlevitsky) wrote :

This bug is partially fixed in karamic.

This is, now gnome power manager does recognize the disappearance/reappearance of the battery
However if you boot without battery, gnome power manager will 'think' you don't have one even if you add one.
You have to login/logout to work around this.

I had long talk with kernel developers, and we discovered that patches I did mention don't work correctly.
Besides there is strong opinion that current behavior is correct.

To fix rest of this problem, I was told that the developer will write new interface to indicate that system has a battery 'bay'
When this is done, g-p-m can use that to show battery settings instead of fact that battery is present.

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