wrong charge level computed/reported

Bug #501500 reported by Todor Todorov on 2009-12-30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
devicekit-power (Ubuntu)
gnome-power-manager (Ubuntu)

Bug Description

Binary package hint: gnome-power-manager

Using the tp_smapi module on my Thinkpad R61, I set the start_charge_threshold to 30 % and stop_charge_threshold at 85 % via sysfs. When the AC is plugged in, the power-manager applet reports that battery is fully charged even though it is not (as reported by sysfs or hal), if the battery is not charging at the moment. Below follows additional information:

Laptop: Lenovo Thinkpad R61

Release: Ubuntu 9.10 Karmic 64bit


62: udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'
  linux.hotplug_type = 2 (0x2) (int)
  linux.subsystem = 'power_supply' (string)
  info.capabilities = { 'battery' } (string list)
  info.subsystem = 'power_supply' (string)
  info.product = '42T4504' (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0' (string)
  battery.type = 'primary' (string)
  battery.reporting.technology = 'Li-ion' (string)
  battery.technology = 'lithium-ion' (string)
  battery.model = '42T4504' (string)
  battery.vendor = 'SANYO' (string)
  battery.voltage.design = 10800 (0x2a30) (int)
  battery.voltage.unit = 'mV' (string)
  battery.reporting.design = 56160 (0xdb60) (int)
  battery.reporting.unit = 'mWh' (string)
  battery.serial = ' 8098' (string)
  battery.present = true (bool)
  battery.voltage.current = 11800 (0x2e18) (int)
  battery.reporting.rate = 0 (0x0) (int)
  battery.is_rechargeable = true (bool)
  battery.rechargeable.is_charging = false (bool)
  battery.rechargeable.is_discharging = false (bool)
  battery.reporting.current = 30700 (0x77ec) (int)
  battery.reporting.last_full = 49020 (0xbf7c) (int)
  battery.charge_level.current = 30700 (0x77ec) (int)
  battery.charge_level.last_full = 49020 (0xbf7c) (int)
  battery.charge_level.design = 56160 (0xdb60) (int)
  battery.charge_level.rate = 0 (0x0) (int)
  battery.charge_level.percentage = 62 (0x3e) (int)
  linux.sysfs_path = '/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0' (string)
  info.parent = '/org/freedesktop/Hal/devices/computer' (string)
  info.category = 'battery' (string)

gnome-power-manager version: 2.28.1-0ubuntu1

I will also post a screenshot which illustrates the problem rather graphically (hal-info vs tooltip of the battery monitor applet).

Thanks for your good work, keep it up.

Best regards


Todor Todorov (ttodorov) wrote :
Pedro Villavicencio (pedro) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. Could you please open a terminal and execute: apport-collect 501500 ? It will attach the necessary information to this report. Also you can submit more information for it by looking to https://wiki.ubuntu.com/DebuggingGNOMEPowerManager , Thanks in advance.

Changed in gnome-power-manager (Ubuntu):
status: New → Incomplete
importance: Undecided → Low

Architecture: amd64
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: gnome-power-manager 2.28.1-0ubuntu1
PackageArchitecture: amd64
 PATH=(custom, user)
ProcVersionSignature: Ubuntu 2.6.32-9.13-core2
Uname: Linux 2.6.32-9-core2 x86_64
UserGroups: adm admin aps cdrom developers dialout lpadmin plugdev sambashare truecrypt vboxusers
XsessionErrors: (thunderbird-bin:4918): GLib-WARNING **: g_set_prgname() called multiple times

Changed in gnome-power-manager (Ubuntu):
status: Incomplete → New
tags: added: apport-collected
Todor Todorov (ttodorov) wrote :

Ah yes, after apport collected all the information, I could see that DeviceKit reports the charge level at 37 something percent. Still, gnome-power-manager shows an incorrect image (fully charged) and the tooltip says "battery is fully charged" just because the battery is not charging right at the moment.

Please note, that left-clicking on the battery icon to open the hibernate/suspend menu correctly shows (in text) the charge level at 37%, albeit with the wrong icon again. I will attach screen shots. I will keep the clock in the picture for any doubting Thomas to see that the two are taken at nearly the same time...

Todor Todorov (ttodorov) wrote :
Todor Todorov (ttodorov) wrote :
Paul Dufresne (paulduf) wrote :

DevkitPower.txt says that the battery is fully-charged (state):
Device: /org/freedesktop/DeviceKit/Power/devices/battery_BAT0
  native-path: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
  vendor: SANYO
  model: 42T4504
  serial: 8098
  power supply: yes
  updated: Thu Jan 14 23:03:29 2010 (12 seconds ago)
  has history: yes
  has statistics: yes
    present: yes
    rechargeable: yes
    state: fully-charged
    energy: 18.57 Wh
    energy-empty: 0 Wh
    energy-full: 48.98 Wh
    energy-full-design: 56.16 Wh
    energy-rate: 0 W
    voltage: 11.494 V
    percentage: 37.9134%
    capacity: 87.2151%
    technology: lithium-ion

So I guess this is NOT a gnome-power-manager bug.
Not sure which package to move it to however.

Todor Todorov (ttodorov) wrote :

What I have packagewise is libdevkit-power-gobject1 from source devicekit-power. I guess that is what this bug needs to be reassigned to. But still, isn't it possible to implement sanity checks using and comparing the info in "percentage:" and "energy-full:" ?

Is it possible for one of the package owners/maintainers to kck-up the bug to devicekit-power with one or two simple click, or do I need to re-submit the same information with a new "affects" value?

Todor Todorov (ttodorov) wrote :

As far as the sanity checks go, here is my rationale: Batteries deteriorate with time and use, especially when there is no battery management by way of the BIOS (unfortunately the kernel tp_smapi module is the only one I'm aware of under Linux, which gives me the option to do something about it). So even if the battery is not charging, it is more useful to the laptop owner to know how full (in percent or absolute capacity) the battery is, instead of just saying "fully charged", when values in the labels "energy:", "energy-full:", and "percentage:" clearly contradict this statement.

So I would suggest that gnome-power-manager only shows a full icon when the values in energy, energy-full and percentage are the same. Other than that the tooltip should supply the current state in the form of "Not charging/Charging/Discharging, at XX% at the moment". A second line in the tooltip text could say something like "Estimated xx hours yy minutes until charged" (if charging) or "Estimated xx hours and yy minutes battery life" (in case the user is not plugged into the AC").

Paul Dufresne (paulduf) on 2010-01-16
Changed in gnome-power-manager (Ubuntu):
status: New → Confirmed
Changed in devicekit-power (Ubuntu):
status: New → Confirmed
Victor Vargas (kamus) wrote :

Please could somebody check if this behaviour is still occurring in latest release included in Ubuntu Maverick? Thanks in advance

Changed in gnome-power-manager (Ubuntu):
status: Confirmed → Incomplete
Colin Rice (dah4k0r) wrote :

It is still occuring. The device manager will report an artificially low power level.

Colin Rice (dah4k0r) wrote :

See #705694

elq (eva-lotte) wrote :

I'm not sure if this is the right bug report for my bug. Comments appreciated.

I'm experiencing this/a similar problem since ubuntu 9.x. The part that bothers me most is not the wrong information (even the history of g-pm- shows the right charge level, really strange!) but that because g-p-m thinks the battery is full even though it's discharging the battery is drained until the computer dies!

Interestingly, this bug only occurs (to me) if the notebook is booted without AC and has not been connected to AC since then. Once I connect AC, the status and icon is updated and shows the right information, even if i unplug it again. Especially annoying when sitting in the train...

Is this part of the bug also happening to you? Or does anyone know about a bug-report describing my bug better than this one? I've been searching launchpad but was not successful.

Thank you for any work on this issue.

elq (eva-lotte) wrote :

Sorry, forget to add that I'm running 11.04 (amd64) on a HP pavilion dv3500.

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

Other bug subscribers