battstat-applet shows -2147483648% charge

Bug #19165 reported by Thomas Hood
16
Affects Status Importance Assigned to Milestone
hal (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

I just booted my machine with an empty battery.

jdthood@turmeric:~$ apm
On-line, battery status critical: 0%

The battery status applet displays the charge as -2147483648%

Revision history for this message
Thomas Hood (jdthood) wrote :
Download full text (4.1 KiB)

Package: gnome-applets
Version: 2.11.2-0ubuntu1

-- System Information:
Debian Release: testing/unstable
  APT prefers hoary-updates
  APT policy: (500, 'hoary-updates'), (500, 'hoary-security'), (500, 'hoary'),
(500, 'breezy')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-3-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages gnome-applets depends on:
ii debconf [debconf- 1.4.52ubuntu1 Debian configuration management sy
ii gnome-applets-dat 2.11.2-0ubuntu1 Various applets for GNOME 2 panel
ii gnome-icon-theme 2.11.5-0ubuntu1 GNOME Desktop icon theme
ii gnome-panel 2.11.5-0ubuntu2 launcher and docking facility for
ii gstreamer0.8-alsa 0.8.10-1ubuntu1 ALSA plugin for GStreamer
ii gstreamer0.8-esd 0.8.10-1ubuntu1 Enlightened Sound Daemon plugin fo
ii gstreamer0.8-oss 0.8.10-1ubuntu1 OSS plugin for GStreamer
ii libapm1 3.2.2-3ubuntu2 Library for interacting with APM d
ii libart-2.0-2 2.3.17-1 Library of functions for 2D graphi
ii libatk1.0-0 1.10.1-2 The ATK accessibility toolkit
ii libbonobo2-0 2.10.0-1 Bonobo CORBA interfaces library
ii libbonoboui2-0 2.10.0-1 The Bonobo UI library
ii libc6 2.3.5-1ubuntu7 GNU C Library: Shared libraries an
ii libdbus-1-1 0.34-1ubuntu4 simple interprocess messaging syst
ii libdbus-glib-1-1 0.34-1ubuntu4 simple interprocess messaging syst
ii libgail-common 1.8.4-1 GNOME Accessibility Implementation
ii libgail17 1.8.4-1 GNOME Accessibility Implementation
ii libgconf2-4 2.11.1-0ubuntu1 GNOME configuration database syste
ii libglade2-0 1:2.5.1-2ubuntu1 library to load .glade files at ru
ii libglib2.0-0 2.7.3-1 The GLib library of C routines
ii libgnome-desktop- 2.11.5-0ubuntu1 Utility library for loading .deskt
ii libgnome2-0 2.11.1-0ubuntu2 The GNOME 2 library - runtime file
ii libgnomecanvas2-0 2.11.1-0buntu1 A powerful object-oriented display
ii libgnomeui-0 2.11.1-0ubuntu1 The GNOME 2 libraries (User Interf
ii libgnomevfs2-0 2.11.3-0ubuntu1 The GNOME virtual file-system libr
ii libgstreamer-plug 0.8.10-1ubuntu1 Various GStreamer libraries and li
ii libgstreamer0.8-0 0.8.10-2ubuntu1 Core GStreamer libraries, plugins,
ii libgtk2.0-0 2.7.3-1ubuntu1 The GTK+ graphical user interface
ii libgtop2-5 2.11.2-0ubuntu1 Libraries for gtop system monitori
ii libgucharmap4 1:1.4.3-2 Unicode browser widget library (sh
ii libhal1 0.5.2-0ubuntu6 Hardware Abstraction Layer - share
ii libice6 1:6.3.5-3 X11 Inter-Client Exchange library
ii liborbit2 1:2.12.2-1 libraries for ORBit2 - a CORBA ORB
ii libpanel-applet2- 2.11.5-0ubuntu2 library for GNOME 2 panel applets
ii libpango1.0-0 1.9.0-1ubuntu1 Layout and rendering of internatio
ii libpopt0 1.7-5 ...

Read more...

Revision history for this message
Jan Schmidt (thaytan) wrote :

I get the same here on initial boot. Apart from the fact that battstat-applet
should not end up displaying such a bad value, the root cause seems to be wrong
information from hald. Restarting hald/dbus fixes it. On first boot, I have a
different set of properties for the battery in hal-device-manager to what I get
after hald restarts.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug. Could you attach the lshal part about the battery to the bug?

Revision history for this message
Jan Schmidt (thaytan) wrote :

Created an attachment (id=3127)
lshal outputs for my battery

Revision history for this message
Jan Schmidt (thaytan) wrote :

In the battery output, there are a couple of differences. The big one is that on
initial boot, these lines are missing:
  battery.charge_level.design = 4000 (0xfa0) (int)
  battery.charge_level.last_full = 4000 (0xfa0) (int)
  battery.charge_level.unit = 'mAh' (string)

Also, I notice that it says the vendor of my battery is COMPAL the first time,
but Sony after that. COMPAL is the laptop manufacturer, Sony makes the battery
pack.
/proc/acpi/info says at all times that I've seen it:
present: yes
design capacity: 4000 mAh
last full capacity: 4000 mAh
battery technology: rechargeable
design voltage: 14800 mV
design capacity warning: 420 mAh
design capacity low: 156 mAh
capacity granularity 1: 264 mAh
capacity granularity 2: 3780 mAh
model number: PA3098U
serial number: 3658Q
battery type: Li-l
OEM info: Sony

Of course, that doesn't rule out that at some point during the boot, the kernel
reports COMPAL as the OEM info for the battery.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

Sebastien: one of two things is going to happen upstream before 2.12.0:

1) HAL's ACPI support will improve.
2) battstat will stop using HAL and revert to the old methods.

Basically, I'd prefer the first, but if it fails to happen then we can revert
the code to its previous state.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Ryan. I've Cc:ed you so you know about the issue. Should I forward it
upstream?

Revision history for this message
Allison Karlitskaya (desrt) wrote :

Davyd and I know about the issue and have our fingers poised over the button.

I personally consider this to be a hald bug. It might be worth a report in the
freedesktop.org bugzilla. Admittedly, I've done a less-than-awesome job of
communicating with David Zeuthen.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

I talked to David about this. This is a known problem in HAL 0.5.2 which is
fixed in 0.5.3. (with a 0.5.4 release coming soon).

How does the breezy UVF affect this?

Reasonably, HAL could fall under the blanket GNOME exception (and certainly,
gnome-applets 2.12.0 might depend on 0.5.4 since it has a slightly improved API).

Revision history for this message
Martin Pitt (pitti) wrote :

hal (0.5.3-0ubuntu1) breezy; urgency=low

  * New upstram bugfix release.
    - Handles degrading battery capacity. (Ubuntu #12909)
  * Removed debian/patches/property-null-values.patch, adopted upstream.
  * debian/patches/storage-policy-debian.patch: Dropped noatime/sync handling
    hunk since upstream now does the right thing.
  * debian/hal.postinst: Fix dbus init script name to restart dbus and hal
    correctly after package upgrade.

Not yet uploaded, awaiting UVF break approval by Matt.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #10)
> Not yet uploaded, awaiting UVF break approval by Matt.

Uploaded.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.