Bug 837345 - Battery plasmoid doesn't show correct charge
Battery plasmoid doesn't show correct charge
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: kde-workspace (Show other bugs)
17
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukáš Tinkl
Fedora Extras Quality Assurance
:
Depends On:
Blocks: kde-4.9
  Show dependency treegraph
 
Reported: 2012-07-03 10:36 EDT by Andreas Petzold
Modified: 2015-07-13 13:35 EDT (History)
8 users (show)

See Also:
Fixed In Version: kde-workspace-4.8.95-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-09 10:54:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
upower dump (1.63 KB, text/plain)
2012-07-03 13:00 EDT, Andreas Petzold
no flags Details
solid battery details (432 bytes, text/plain)
2012-07-03 13:02 EDT, Andreas Petzold
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
KDE Software Compilation 287952 None None None 2012-07-03 12:23:35 EDT

  None (edit)
Description Andreas Petzold 2012-07-03 10:36:37 EDT
Description of problem:

On my Dell E6320 with kde-workspace-4.8.95-1.fc17.x86_64, the battery plasmoid doesn't show the correct charge value of the battery. The plasmoid changes if the AC adapter i splgged in but still doesn't update the charge value.

Version-Release number of selected component (if applicable):

kde-workspace-4.8.95-1.fc17.x86_64

How reproducible:

Always

Steps to Reproduce:
1.Add battery plasmoid to panel
2.Unplug AC adapter and wait some time
3.compare charge value shown by plasmoid and gkrellm or calculate current charge from values in /sys
  
Actual results:
Plasmoid charge value isn't correct

Expected results:
Plasmoid shows correct charge value of battery.

Additional info:
Comment 1 Lukáš Tinkl 2012-07-03 10:54:13 EDT
$ upower --dump 

and 

$ solid-hardware details /org/freedesktop/UPower/devices/battery_BAT0
Comment 2 Christian Gonzalez 2012-07-03 11:02:05 EDT
Same here (Fedora 17 + kde-workspace-4.8.95-1.fc17.x86_64). Oddly enough, if I run the plasmoid in its own window ("plasma-windowed battery"), it shows the correct charge value of the battery.

More info:

[christian@laptop ~]$ upower --dump 
Device: /org/freedesktop/UPower/devices/line_power_ADP1
  native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ADP1
  power supply:         yes
  updated:              Tue Jul  3 10:40:49 2012 (1174 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    online:             yes

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0f/PNP0C09:00/PNP0C0A:00/power_supply/BAT1
  vendor:               SAMSUNG Electronics
  power supply:         yes
  updated:              Tue Jul  3 10:40:54 2012 (1169 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    energy:              27.75 Wh
    energy-empty:        0 Wh
    energy-full:         27.75 Wh
    energy-full-design:  44.4 Wh
    energy-rate:         15.1071 W
    voltage:             12.301 V
    percentage:          100%
    capacity:            62.5%
    technology:          lithium-ion

Daemon:
  daemon-version:  0.9.17
  can-suspend:     yes
  can-hibernate    yes
  on-battery:      no
  on-low-battery:  no
  lid-is-closed:   no
  lid-is-present:  yes
  is-docked:       no


[christian@laptop ~]$ solid-hardware details /org/freedesktop/UPower/devices/battery_BAT0
udi = '/org/freedesktop/UPower/devices/battery_BAT0'
  parent = ''  (string)
  vendor = ''  (string)
  product = ''  (string)
  description = ''  (string)


[christian@laptop ~]$ solid-hardware details /org/freedesktop/UPower/devices/battery_BAT1
udi = '/org/freedesktop/UPower/devices/battery_BAT1'
  parent = '/org/freedesktop/UPower'  (string)
  vendor = 'SAMSUNG Electronics'  (string)
  product = 'Lithium Ion Battery'  (string)
  description = 'Lithium Ion Battery'  (string)
  Battery.plugged = true  (bool)
  Battery.type = 'PrimaryBattery'  (0x3)  (enum)
  Battery.chargePercent = 100  (0x64)  (int)
  Battery.rechargeable = true  (bool)
  Battery.chargeState = 'NoCharge'  (0x0)  (enum)
Comment 3 Lukáš Tinkl 2012-07-03 11:33:37 EDT
Christian, can you do the same "dump" when running on battery please?
Comment 4 Christian Gonzalez 2012-07-03 11:38:00 EDT
Sure, here is it:

[christian@laptop ~]$ upower --dump 
Device: /org/freedesktop/UPower/devices/line_power_ADP1
  native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ADP1
  power supply:         yes
  updated:              Tue Jul  3 11:34:10 2012 (137 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    online:             no

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0f/PNP0C09:00/PNP0C0A:00/power_supply/BAT1
  vendor:               SAMSUNG Electronics
  power supply:         yes
  updated:              Tue Jul  3 11:36:10 2012 (17 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    energy:              26.64 Wh
    energy-empty:        0 Wh
    energy-full:         27.75 Wh
    energy-full-design:  44.4 Wh
    energy-rate:         19.314 W
    voltage:             11.912 V
    time to empty:       1.4 hours
    percentage:          96%
    capacity:            62.5%
    technology:          lithium-ion
  History (charge):
    1341329770  96.000  discharging
    1341329720  97.000  discharging
  History (rate):
    1341329770  19.314  discharging
    1341329750  22.233  discharging
    1341329720  19.625  discharging
    1341329695  21.900  discharging

Daemon:
  daemon-version:  0.9.17
  can-suspend:     yes
  can-hibernate    yes
  on-battery:      yes
  on-low-battery:  no
  lid-is-closed:   no
  lid-is-present:  yes
  is-docked:       no
Comment 5 Rex Dieter 2012-07-03 11:53:42 EDT
so, I think there is a correlation between some plasmoids not updating, but only after a suspend->resume cycle.  I'm seeing some oddness with plasma-nm too recently (the applet displays incorrect signal strength).

Any of you seeing this on a fresh boot without ever having suspended?
Comment 6 Lukáš Tinkl 2012-07-03 12:07:54 EDT
$ solid-hardware details /org/freedesktop/UPower/devices/battery_BAT1

too please :)
Comment 7 Christian Gonzalez 2012-07-03 12:16:49 EDT
[christian@laptop ~]$ solid-hardware details /org/freedesktop/UPower/devices/battery_BAT1
udi = '/org/freedesktop/UPower/devices/battery_BAT1'
  parent = '/org/freedesktop/UPower'  (string)
  vendor = 'SAMSUNG Electronics'  (string)
  product = 'Lithium Ion Battery'  (string)
  description = 'Lithium Ion Battery'  (string)
  Battery.plugged = true  (bool)
  Battery.type = 'PrimaryBattery'  (0x3)  (enum)
  Battery.chargePercent = 91  (0x5b)  (int)
  Battery.rechargeable = true  (bool)
  Battery.chargeState = 'Discharging'  (0x2)  (enum)
Comment 8 Christian Gonzalez 2012-07-03 12:19:36 EDT
Rex, you are right. The problem is triggered by a suspend->resume cycle. After a reboot, the battery plasmoid is working as expected.

BTW, I've seen the plasma-nm bug as well. Is there another bug report for this?
Comment 9 Rex Dieter 2012-07-03 12:20:39 EDT
For me, battery applet is stuck at 94% , but


$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          /sys/devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/AC
  power supply:         yes
  updated:              Mon Jul  2 16:00:50 2012 (69692 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    online:             yes

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor:               SMP
  model:                DELL PD6858
  serial:               297
  power supply:         yes
  updated:              Mon Jul  2 16:00:57 2012 (69685 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    energy:              86.58 Wh
    energy-empty:        0 Wh
    energy-full:         86.58 Wh
    energy-full-design:  86.58 Wh
    energy-rate:         0.0111 W
    voltage:             12.448 V
    percentage:          100%
    capacity:            97.2051%
    technology:          lithium-ion

Daemon:
  daemon-version:  0.9.17
  can-suspend:     yes
  can-hibernate    yes
  on-battery:      no
  on-low-battery:  no
  lid-is-closed:   no
  lid-is-present:  yes
  is-docked:       no



$ solid-hardware details /org/freedesktop/UPower/devices/battery_BAT0
udi = '/org/freedesktop/UPower/devices/battery_BAT0'
  parent = '/org/freedesktop/UPower'  (string)
  vendor = 'SMP'  (string)
  product = 'DELL PD6858'  (string)
  description = 'Lithium Ion Battery'  (string)
  Battery.plugged = true  (bool)
  Battery.type = 'PrimaryBattery'  (0x3)  (enum)
  Battery.chargePercent = 100  (0x64)  (int)
  Battery.rechargeable = true  (bool)
  Battery.chargeState = 'NoCharge'  (0x0)  (enum)



So, seems upower/solid are correct, the applet just isn't getting the update.
Comment 10 Rex Dieter 2012-07-03 12:23:35 EDT
Ah, found https://bugs.kde.org/show_bug.cgi?id=287952  
for this particular issue.
Comment 11 Lukáš Tinkl 2012-07-03 12:47:58 EDT
Yup, looks like it :/ The problem with suspend is that the devices "vanish" from the system (get removed internally) and they reappear upon the resume and the Plasma dataengine holds reference to the stale objects, therefore not receiving any updates.
Comment 12 Andreas Petzold 2012-07-03 13:00:58 EDT
Created attachment 596049 [details]
upower dump
Comment 13 Andreas Petzold 2012-07-03 13:02:06 EDT
Created attachment 596050 [details]
solid battery details
Comment 14 Lukáš Tinkl 2012-07-04 08:30:52 EDT
Just to be sure, is it just the charge percent that isn't getting updated? What about the AC plug state, does the plasmoid correctly react to plugging/unplugging the cable?
Comment 15 Andreas Petzold 2012-07-04 09:53:53 EDT
For me, the AC plug state gets displayed just fine. It's only the charge value that is wrong.
Comment 16 Lukáš Tinkl 2012-07-09 04:56:46 EDT
It looks like this is more related to KDE bug #287952
Comment 17 Lukáš Tinkl 2012-07-09 08:13:25 EDT
The bug is in the battery applet (QML) itself, the powermanagement engine itself is correctly updating the battery charge percent and state, even after suspend/resume.
Comment 18 Rex Dieter 2012-07-09 10:54:33 EDT
%changelog
* Mon Jul 09 2012 Rex Dieter <rdieter@fedoraproject.org> 4.8.95-3
- Battery Monitor widget stops tracking charging state changes after suspend/resume cycle (#837345, kde#287952)

Note You need to log in before you can comment on or make changes to this bug.