ThinkPad battery applet shows incorrect information

Bug #626025 reported by David Strauss
76
This bug affects 18 people
Affects Status Importance Assigned to Milestone
devicekit-power (Ubuntu)
Invalid
Undecided
Unassigned
Nominated for Lucid by David Strauss
upower (Fedora)
Fix Released
Medium
upower (Ubuntu)
Confirmed
Undecided
Unassigned
Nominated for Lucid by David Strauss

Bug Description

Binary package hint: devicekit-power

The GNOME applet shows the actual capacity divided by ten (8.8% when the battery is at 88%). I've attached output from /usr/share/gnome-power-manager/gnome-power-bugreport. The time to depletion and time to full charge do not show at all.

I've verified using tp-smapi-dkms that the applet shows incorrect data.

This laptop runs Ubuntu 10.04.1 64-bit.

== Correct data excerpt ==

Battery Information:
  battery.charge_level.current = 8406 (0x20d6) (int)
  battery.charge_level.design = 9324 (0x246c) (int)
  battery.charge_level.last_full = 9527 (0x2537) (int)

== Incorrect data excerpt ==

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:09/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
  vendor: SANYO
  model: 42T4799
  serial: 9443
  power supply: yes
  updated: Sat Aug 28 23:12:48 2010 (25 seconds ago)
  has history: yes
  has statistics: yes
  battery
    present: yes
    rechargeable: yes
    state: charging
    energy: 8.388 Wh
    energy-empty: 0 Wh
    energy-full: 95.35 Wh
    energy-full-design: 93.24 Wh
    energy-rate: 1.913 W
    voltage: 12.811 V
    percentage: 8.79706%

Tags: glucid
Revision history for this message
David Strauss (davidstrauss) wrote :
Revision history for this message
David Strauss (davidstrauss) wrote :

This may actually be a bug in upower, but I don't know how to switch the target of this bug.

Revision history for this message
David Strauss (davidstrauss) wrote :

acpi -V shows the correct charge percentage, too.

Revision history for this message
David Strauss (davidstrauss) wrote :

Running this fixes the percentage and shows accurate "time to charged" information in the applet:

$ sudo killall upowerd
$ sudo /usr/lib/upower/upowerd --verbose 2>&1 | tee /tmp/dkp.log

However, running the commands above causes the current and "full" capacities to both show as 10% of what they should be.

Changed in devicekit-power (Ubuntu):
status: New → Invalid
Revision history for this message
David Strauss (davidstrauss) wrote :

Retargeting to upower. Marking devicekit as "invalid."

summary: - ThinkPad T510 battery applet shows incorrect information
+ ThinkPad battery applet shows incorrect information
Revision history for this message
David Strauss (davidstrauss) wrote :

Linking similar Fedora issue. The Fedora issue is about upower showing 10x the expected full capacity but the correct charge capacity. This is the opposite of my issue, but the root cause is probably the same. Both issues affect ThinkPads and show an order-of-magnitude problem.

Revision history for this message
Andrew Ferrier (andrew-ferrier) wrote :

I see very similar symptoms on a Thinkpad W510. Applying David's workaround as per comment #4 "fixes" the applet for me also.

Revision history for this message
Andrew Ferrier (andrew-ferrier) wrote :

It's a nasty hack, I know, but so far, putting a script containing the following in /etc/apm/resume.d seems to work round the problem for me (based on David's workaround):

#!/bin/sh

sleep 15
killall upowerd
/usr/lib/upower/upowerd --verbose &

Any improvements to that welcomed.

Revision history for this message
Henryk Plötz (henryk-ploetzli) wrote :

I think I might have found a clue as to where the bug originates:

henryk@aurora:~$ upower -d | grep energy:
    energy: 9.025 Wh
henryk@aurora:~$ grep remaining\ capacity: /proc/acpi/battery/BAT0/state
remaining capacity: 9025 mAh

It may very well be that the acpi interface changes units under certain circumstances: A <-> W. This would explain why the values are off by approximately, but not exactly, a factor of 10: The voltage is 11-13 V, which is almost 10.

Joel Ebel (jbebel)
Changed in upower (Ubuntu):
status: New → Confirmed
tags: added: glucid
Revision history for this message
In , Bernie (bernie-redhat-bugs) wrote :

Description of problem:
Very often, after I disconnect the AC from my Lenovo X201, the battery icon in the panel becomes immediately red and says 6.2% charge left. The remaining time, however is correct (2h40 left).

The value slowly goes down as the battery discharges. So there seems to be an incorrect multiplication factor applied to the number.

The command line tool acpi reports the correct percentage:

 bernie@giskard:~$ acpi
 Battery 0: Discharging, 59%, 02:46:56 remaining

Version-Release number of selected component (if applicable):
gnome-power-manager-2.32.0-3.fc14.x86_64

How reproducible:
very often (always? not sure)

Steps to Reproduce:
1.disconnect charger
2.look at battery icon

Actual results:
5.7%

Expected results:
56%

Revision history for this message
In , seth (seth-redhat-bugs) wrote :

Same behavior here. My battery estimate is always off by a decimal place.
it'll say 9.3% in the applet but the real battery life is 93%

The time is right - but the battery icon is wrong and the percentage is wrong.

Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

Can you test the kernel from http://koji.fedoraproject.org/koji/taskinfo?taskID=2686910 when it's built?

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

kernel-2.6.35.10-74.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/kernel-2.6.35.10-74.fc14

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

kernel-2.6.35.10-74.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update kernel'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/kernel-2.6.35.10-74.fc14

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

kernel-2.6.35.10-74.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

*** Bug 608341 has been marked as a duplicate of this bug. ***

Revision history for this message
skanev (svilen-kanev) wrote :

Fedora bug #608341 was marked as a duplicate of #656738

Revision history for this message
David Strauss (davidstrauss) wrote :

I can reconfirm this bug existing in Ubuntu 11.04 (Natty) on my ThinkPad T510.

Revision history for this message
Henryk Plötz (henryk-ploetzli) wrote :

Apparently a fix for this had been committed to the linux kernel in January (based on the Fedora fix mentioned in comment 10: https://bugzilla.redhat.com/show_bug.cgi?id=656738 ) but was then removed a couple days later by Linus because it freezed his EeePC. A new fix has been added a few days ago: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.38.y.git;a=commitdiff;h=36d08a041f93f2c5370f95f9611c9065bb79e4fb and is already included in vanilla 2.6.38.5. There even is an Ubuntu bug #775809 to upgrade the kernel to 2.6.38.5, so when that is through it should fix this bug.

I've compiled that kernel myself (based on the current Ubuntu natty kernel sources) and tried it on my Thinkpad T510 and so far the battery capacity display stayed sane over a couple of suspend/resume cycles, while previously it would go wahoonie-shaped after just one resume-on-battery.

This fix introduces a new issue though, which is hopefully mostly cosmetic: Both the menu that pops up when clicking on the battery indicator and the notification overlay, but not gnome-power-statistics, show two batteries (with same "time left") after the first suspend/resume cycle when the bug would normally occur.

Revision history for this message
skanev (svilen-kanev) wrote :

The kernel was updated after bug #775809, which is now marked resolved. I can confirm the exact same behavior as Henryk after the update -- no more wrong reporting, but sometimes two batteries on the notification overlay -- on a Thinkpad T410s.

Revision history for this message
In , Dan (dan-redhat-bugs) wrote :

I've still got this problem with Fedora 16 x64 (EFI boot) on a macbook pro 8,1. Sometimes the "energy when full" value in upower becomes much too large causing the battery to report a low percent. Time is still reasonable. Killing upowerd seems to fix the problem.

Revision history for this message
In , Dan (dan-redhat-bugs) wrote :

Sorry for the double post. Can this bug be reopened? Also I think the effected component should be upower not the kernel.

Revision history for this message
In , Matthew (matthew-redhat-bugs) wrote :

Dan,

Please open a separate bug. You have similar symptoms, but if it was the same problem it'd already be fixed.

Changed in upower (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
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.