Package: hal
Version: 0.5.8.1-4
Severity: normal

On my Acer Travelmate 3002WTCi laptop, /proc/acpi/battery/BAT1/state claims
that the laptop is always drawing a voltage of 1mV:

[EMAIL PROTECTED]:/proc/acpi/battery/BAT1# cat state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            1596 mA
remaining capacity:      2174 mAh
present voltage:         1 mV

This throws off the calculations in hald/linux/acpi.c, which divide a
(current*present voltage) by 1000 to get mWh; this loses most of the precision 
in
the figure ACPI provides in mA.  As a result, the GNOME battery applet
displays very round figures of how much battery time is left (3/2/1 hours,
and 100/66/33/0% remaining).

The patch below fixes the problem by assuming that all voltages <= 1mV count
as unknown and should be ignored, instead of the 0mV used for this
comparison at present.  This makes the battery meter on my laptop usable
again.

=====
--- hal-0.5.8.1.orig/hald/linux/acpi.c  2006-09-20 08:23:25.000000000 +1200
+++ hal-0.5.8.1/hald/linux/acpi.c       2007-01-02 00:16:29.000000000 +1300
@@ -163,7 +163,7 @@
                /* If the current voltage is unknown or greater than design,
                 * then use design voltage.
                 */
-               if (voltage <= 0 || voltage > design_voltage)
+               if (voltage <= 1 || voltage > design_voltage)
                        voltage = design_voltage;

                normalised_current = (reporting_current * voltage) / 1000;
=====

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (900, 'testing'), (300, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-686
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)

Versions of packages hal depends on:
ii  adduser                   3.100          Add and remove users and groups
ii  dbus                      1.0.2-1        simple interprocess messaging syst
ii  libc6                     2.3.6.ds1-8    GNU C Library: Shared libraries
ii  libdbus-1-3               1.0.2-1        simple interprocess messaging syst
ii  libdbus-glib-1-2          0.71-3         simple interprocess messaging syst
ii  libexpat1                 1.95.8-3.3     XML parsing C library - runtime li
ii  libglib2.0-0              2.12.4-2       The GLib library of C routines
ii  libhal-storage1           0.5.8.1-4      Hardware Abstraction Layer - share
ii  libhal1                   0.5.8.1-4      Hardware Abstraction Layer - share
ii  libusb-0.1-4              2:0.1.12-2     userspace USB programming library
ii  libvolume-id0             0.103-1        libvolume_id shared library
ii  lsb-base                  3.1-22         Linux Standard Base 3.1 init scrip
ii  pciutils                  1:2.2.4~pre4-1 Linux PCI Utilities
ii  udev                      0.103-1        /dev/ and hotplug management daemo
ii  usbutils                  0.72-7         USB console utilities

Versions of packages hal recommends:
ii  eject                         2.1.4-2.1  ejects CDs and operates CD-Changer

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to