powermanager icon sometimes shows fully charged when not

Bug #64978 reported by Yuriy Kozlov on 2006-10-10
8
Affects Status Importance Assigned to Milestone
kde-guidance (Ubuntu)
Undecided
Sebastian Kügler

Bug Description

Binary package hint: kde-guidance-powermanager

The power manager icon sometimes (seemingly randomly, so far) starts showing fully charged. Looking at the tooltip, it says fully charged, but gives the actual percentage charge on the battery. The icon and status go back to normal after a few seconds.

This is happening when the laptop is plugged in.

description: updated
Luka Renko (lure) wrote :

Currently powermanager displays 100% picture when battery is over 80% charged. This is probably the root cause if this behavior.
It would probably be better if we would be more conservative regarding this and rather display fully charged if we are on 99% or above...

Changed in kde-guidance:
status: Unconfirmed → Needs Info
Luka Renko (lure) wrote :

Fix is committed in KDE SVN: Committed revision 594268.

New version will be more conservative for selection of icons:
- >= 95% for 4/4 (full),
- 95-70 for 3/4
- 40-70 for 2/4
- 15-40 for 1/4
- 5-15 for 1/4 (red)
- < 5 for empty

Changed in kde-guidance:
status: Needs Info → Fix Committed
Yuriy Kozlov (yuriy-kozlov) wrote :

This is with the battery at 30-50%, not 80. Sometimes the icon just starts showing full and the status at the top of the tooltip says "fully charged" After a little bit, the icon and status go back to the charging state as they should be, "Battery: x:xxh to charge"

Luka Renko (lure) wrote :

Do you have only one battery?
powermanager assumes that if battery is not charging and not discharging and the current is more than zero that battery is fully charged. This does not seem to be the case on your laptop.

Can you attach output of "lshal" and try to reproduce the problem when "lshal -m" is running (and output is captured and attached to this bug).

Yuriy Kozlov (yuriy-kozlov) wrote :

This is an Asus v6j laptop with one battery.

attaching the output of lshal right now (battery is almost fully charged and charging, everything is fine)

Possibly something is malfunctioning in my laptop (hope not!) so that for brief periods of time the battery is not charging when it's plugged in. Perhaps there is a better way to tell if the battery is fully charged, though?

I'll post back with lshal -m if it happens again.

Luka Renko (lure) wrote :

This looks ok:
  battery.charge_level.percentage = 99 (0x63) (int)
  battery.charge_level.rate = 8880 (0x22b0) (int)
  battery.charge_level.last_full = 66765 (0x104cd) (int)
  battery.charge_level.current = 66435 (0x10383) (int)
  battery.rechargeable.is_discharging = false (bool)
  battery.rechargeable.is_charging = true (bool)

So at this level, do you get icon for battery full or something else?

Jonathan Riddell (jr) on 2006-10-12
Changed in kde-guidance:
assignee: nobody → jr
Jonathan Riddell (jr) on 2006-10-13
Changed in kde-guidance:
status: Fix Committed → Fix Released
Yuriy Kozlov (yuriy-kozlov) wrote :

Just happened again, attaching a screenshot.

Changed in kde-guidance:
status: Fix Released → Unconfirmed
David Johnson (dj-david-web) wrote :

I'm also seeing the same behaviour. Specifically, the power level shown on the systray icon doesn't always update as the battery discharges. A power event (connecting/disconnecting AC power) causes the power level to be updated to the correct level.

Let me know if you'd like me to provide anything and/or do some debugging.

Sebastian Kügler (sebasje) wrote :

Please check what lshal reports when you see that problem.

Changed in kde-guidance:
assignee: jr → sebas-kde
status: Unconfirmed → Needs Info
David Johnson (dj-david-web) wrote :

lshal reports the correct remaining percentage. Hovering over the systray icon gives the correct percentage also, but the icon itself shows fully charged.

Attaching lshal output.

Sebastian Kügler (sebasje) wrote :

Hm, really strange. I don't see any place in the code where this is going wrong.

Just to be sure, the lshal output you posted was right at the moment when the strange display problem occurred?

David Johnson (dj-david-web) wrote :

Yes indeed. When I powered on the system the battery was fully charged and this was being shown correctly. I grabbed the lshal output when the battery was at 58% and discharging, with the systray icon still showing fully charged.

Re-connecting AC power caused the icon to be updated and show the correct charge level and the level updated correctly as the battery was charged.

Sebastian Kügler (sebasje) wrote :

Can you check whether the attached patch helps you?

David Johnson (dj-david-web) wrote :

I'm afraid the patch does not make any difference.

Sebastian Kügler (sebasje) wrote :

It's still a mystery to me then. I'll think some more about it.

Thanks for testing though.

Changed in kde-guidance:
status: Needs Info → Confirmed
Luka Renko (lure) wrote :

I think this is caused by this assumption:

            if properties["battery.rechargeable.is_charging"]:
                state = "charging"
            elif properties["battery.rechargeable.is_discharging"]:
                state = "discharging"
            elif not properties["battery.rechargeable.is_discharging"] \
                 and not properties["battery.rechargeable.is_charging"]:
                if current == 0:
                    state = "empty"
                else:
                    state = "charged"

If battery reports both charging and discharging as false, then we current level and if it is zero, it is empty, otherwise we consider it as fully charged.
It may be that your laptop does not consistently report charging=true and this case powermanager wrongly assumes the battery is fully charged.

David Johnson (dj-david-web) wrote :

I've figured out that the problem I'm having is different from the one the reporter of this bug is having, even though the symptoms are similar. I've reported my problem separately as bug #79531.

Sebastian Kügler (sebasje) wrote :

There's some bits fixed in there, which most likely cure your problem. Can you check and reopen if the bug still exists?

Changed in kde-guidance:
status: Confirmed → Fix Released

The upgrade of kde-guidance-powermanager from 0.8.0-0ubuntu3 to 0.8.0-0ubuntu4 has given me this problem: the battery shows as full and as connected to mains -- while really it is unconnected and a few minutes earlier it was at about 70%.

Sebastian Kügler (sebasje) wrote :

I've sent a patch to Jonathan this morning which addresses this problem.

Changed in kde-guidance:
status: Fix Released → Fix Committed

Okay, 0.8.0-0ubuntu5 has fixed this again. Thanks.

Luka Renko (lure) wrote :

Fix released in Feisty

Changed in kde-guidance:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers