[Pkg-utopia-maintainers] Bug#827621: upower: inconsistent handling of multiple batteries

Yves-Alexis Perez corsac at debian.org
Sat Jun 18 19:24:33 UTC 2016


Package: upower
Version: 0.99.4-3
Severity: normal

Hi,

my laptop (ThinkPad X250) has two batteries: one internal, non
replaceable, and an external one, swappable. The EC makes sure only one
is (dis)charging at any given time.

It seems that upower has some issues handling them correctly.

For example, right now, I'm just unplugged, the external battery is
still quite full so it's the only one discharging, the internal one is
not:

grep . /sys/class/power_supply/BAT?/*now*
/sys/class/power_supply/BAT0/energy_now:21190000
/sys/class/power_supply/BAT0/power_now:0
/sys/class/power_supply/BAT0/voltage_now:12272000
/sys/class/power_supply/BAT1/energy_now:18920000
/sys/class/power_supply/BAT1/power_now:7365000
/sys/class/power_supply/BAT1/voltage_now:12214000

BAT1 is discharging at 7.3W, BAT0 is at 0W.

But upower disagree:

upower --dump
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              sam. 18 juin 2016 21:04:43 CEST (779 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SONY
  model:                45N1111
  serial:               XXXXX
  power supply:         yes
  updated:              sam. 18 juin 2016 21:16:43 CEST (59 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              21,19 Wh
    energy-empty:        0 Wh
    energy-full:         21,33 Wh
    energy-full-design:  23,2 Wh
    energy-rate:         9,521 W
    voltage:             12,272 V
    time to empty:       2,2 hours
    percentage:          99%
    capacity:            91,9397%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          BAT1
  vendor:               LGC
  model:                45N1127
  serial:               XXXXX
  power supply:         yes
  updated:              sam. 18 juin 2016 21:16:43 CEST (59 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              18,91 Wh
    energy-empty:        0 Wh
    energy-full:         20,93 Wh
    energy-full-design:  23,48 Wh
    energy-rate:         7,378 W
    voltage:             12,216 V
    time to empty:       2,6 hours
    percentage:          94%
    capacity:            84,9233%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (charge):
    1466277403	94,000	discharging
  History (rate):
    1466277403	7,378	discharging

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              sam. 18 juin 2016 21:16:43 CEST (59 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              40,1 Wh
    energy-full:         42,26 Wh
    energy-rate:         16,899 W
    time to empty:       2,4 hours
    percentage:          94,8888%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  0.99.4
  on-battery:      yes
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: PowerOff

Here, it considers BAT0 is discharging at 9W and BAT1 at 7W. fpr a total of
17W, which doesn't make sense and obviously confuse the time estimate.

It seems that upower doesn't handle the fact that BAT0 is not
discharging at all, and reports the last non zero value it has, or
something like that. The reported energy-rate for BAT0 doesn't change at
all.

If you need more information, please ask.
Regards,

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (450, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-2-grsec-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages upower depends on:
ii  dbus               1.10.8-1
ii  libc6              2.22-11
ii  libglib2.0-0       2.48.1-1
ii  libgudev-1.0-0     230-3
ii  libimobiledevice6  1.2.0+dfsg-3
ii  libplist3          1.12-3.1
ii  libupower-glib3    0.99.4-3
ii  libusb-1.0-0       2:1.0.20-1
ii  udev               230-2

Versions of packages upower recommends:
ii  policykit-1  0.105-15

upower suggests no packages.

-- no debconf information



More information about the Pkg-utopia-maintainers mailing list