Bug 91003 - Upower reports wrongly high discharge rate when switching between two batteries
Summary: Upower reports wrongly high discharge rate when switching between two batteries
Status: RESOLVED MOVED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
: 91128 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-06-17 08:51 UTC by kitestramuort
Modified: 2018-06-04 13:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description kitestramuort 2015-06-17 08:51:19 UTC
I have a Thinkpad X230s, a laptop with two internal batteries, running Arch. When BAT1 is completely discharged the system switches to BAT0, at this point upower starts reporting an excessively high discharge rate.

I have powertop active correctly reporting that
 
The battery reports a discharge rate of 6.88 W
The estimated remaining time is 2 hours, 12 minutes


whereas upower -d says

Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Wed 17 Jun 2015 08:52:40 AM BST (3111 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:               SANYO
  model:                45N1109
  serial:               95
  power supply:         yes
  updated:              Wed 17 Jun 2015 09:42:41 AM BST (110 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              14.31 Wh
    energy-empty:        0 Wh
    energy-full:         17.11 Wh
    energy-full-design:  23.2 Wh
    energy-rate:         10.478 W
    voltage:             11.682 V
    time to empty:       1.4 hours
    percentage:          83%
    capacity:            73.75%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (charge):
    1434530561	83.000	discharging
  History (rate):
    1434530561	10.478	discharging

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          BAT1
  vendor:               SANYO
  model:                45N1117
  serial:               7057
  power supply:         yes
  updated:              Wed 17 Jun 2015 09:44:11 AM BST (20 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       low
    energy:              1.07 Wh
    energy-empty:        0 Wh
    energy-full:         17.19 Wh
    energy-full-design:  23.2 Wh
    energy-rate:         11.795 W
    voltage:             10.981 V
    time to empty:       5.4 minutes
    percentage:          6%
    capacity:            74.0948%
    technology:          lithium-ion
    icon-name:          'battery-caution-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Wed 17 Jun 2015 09:42:41 AM BST (110 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              15.38 Wh
    energy-full:         34.3 Wh
    energy-rate:         22.273 W
    time to empty:       41.4 minutes
    percentage:          44.8397%
    icon-name:          'battery-good-symbolic'

Daemon:
  daemon-version:  0.99.2
  on-battery:      yes
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep


Restarting the laptop fixes the values.
Comment 1 kitestramuort 2015-06-22 20:43:14 UTC
At a second look the problem seems to be that upower doesn't do its maths correctly.

Once the system has switched to BAT0, the last energy-rate value of BAT1 is retained and never changes, even though BAT1 is not discharging anymore. It is added to BAT0's energy-rate and the DisplayDevice's energy-rate shows the sum of the two. Effectively the battery is shown to be discharging at twice the rate.
Comment 2 Bastien Nocera 2015-07-06 10:06:11 UTC
*** Bug 91128 has been marked as a duplicate of this bug. ***
Comment 3 GitLab Migration User 2018-06-04 13:25:09 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/upower/upower/issues/45.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.