Bug 361708 - System stuck in ac-plugged in mode ignoring Power management rules
Summary: System stuck in ac-plugged in mode ignoring Power management rules
Status: RESOLVED DUPLICATE of bug 423556
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.5.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Development Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-13 08:39 UTC by Sudhir Khanger
Modified: 2021-10-19 14:21 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot of the problem (30.00 KB, image/png)
2016-04-14 03:36 UTC, Sudhir Khanger
Details
Battery inconsistency (164.44 KB, image/png)
2018-07-05 05:25 UTC, battaglia01
Details
All charging (82.98 KB, image/png)
2018-07-05 05:29 UTC, battaglia01
Details
Showing ac plugged even if unplugged (264.12 KB, image/png)
2021-10-18 17:01 UTC, Gauthier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sudhir Khanger 2016-04-13 08:39:09 UTC
I have noticed it several times that my system won't go into any of the power states like suspend or hibernate according to the rules set in Power management settings. The battery icon will be stuck in ac-plugged in state where as on expanding it, it would show the battery is discharging.

This is very bad because system will eventually shut down and I will lose all my work.

Reproducible: Sometimes


Actual Results:  
Power management settings are ignored. System doesn't go into suspend or hibernate as per power management settings. Battery icon shows charging where as on expanding it shows discharging.


System suspends and hibernates fine via Plasma menu options or via systemctl but not automatically as per power management settings.

$ upower -d
Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Wednesday 13 April 2016 09:31:19 AM IST (16286 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SANYO
  model:                42T4763
  serial:               13920
  power supply:         yes
  updated:              Wednesday 13 April 2016 02:02:33 PM IST (12 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              13.07 Wh
    energy-empty:        0 Wh
    energy-full:         27.43 Wh
    energy-full-design:  47.52 Wh
    energy-rate:         0.415 W
    voltage:             11.234 V
    time to empty:       31.5 hours
    percentage:          47%
    capacity:            57.7231%
    technology:          lithium-ion
    icon-name:          'battery-good-symbolic'
  History (charge):
    1460536353  47.000  discharging
  History (rate):
    1460536353  0.415   discharging

Device: /org/freedesktop/UPower/devices/mouse_0003o046DoC52Fx0002
  native-path:          /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.1/0003:046D:C52F.0002
  vendor:               Logitech, Inc.
  model:                M185
  serial:               03E8C0B4
  power supply:         no
  updated:              Wednesday 13 April 2016 02:02:33 PM IST (12 seconds ago)
  has history:          yes
  has statistics:       no
  mouse
    present:             no
    rechargeable:        yes
    state:               unknown
    warning-level:       none
    percentage:          70%
    icon-name:          'battery-missing-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Wednesday 13 April 2016 02:02:33 PM IST (12 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              13.07 Wh
    energy-full:         27.43 Wh
    energy-rate:         0.415 W
    time to empty:       31.5 hours
    percentage:          47%
    icon-name:          'battery-good-symbolic'

Daemon:
  daemon-version:  0.99.3
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep
Comment 1 Sudhir Khanger 2016-04-14 03:36:38 UTC
Created attachment 98390 [details]
screenshot of the problem
Comment 2 battaglia01 2018-07-05 05:22:24 UTC
Same exact issue - on Neon Xenial running Plasma 5.13. `acpi` and `upower` will show the battery charge/discharge status correctly responding to AC plug on/off events, but the plasmashell battery icon will remain on "plugged in" mode even if I unplug.

Strangely, sometimes the battery icon will still say "plugged in," even though when I click on the battery, it still says "discharging". Screenshot attached below.
Comment 3 battaglia01 2018-07-05 05:25:36 UTC
Created attachment 113771 [details]
Battery inconsistency

Note the tray icon still has the battery in AC mode, even though it is listed as "Discharging" in the panel.

More importantly, the power management settings still respond as if the AC were plugged in. I want it to auto-suspend only if battery is discharging and not suspend if AC is plugged in. The result here is that it thinks the AC is plugged in, discharges, and drains the battery.
Comment 4 battaglia01 2018-07-05 05:29:28 UTC
Created attachment 113772 [details]
All charging

One more - now things are plugged in. Note that the tray icon is "charging", and now the battery icon in the panel dropdown is also "charging." In the previous screenshot, the battery icon in the panel dropdown was the normal "discharging" battery.

However, crucially, in both cases, the battery tray icon was charging -- even though it is only really charging in this one and not the last one. The tray icon seems to dictate which power management behaviors are followed, so that it always does AC mode even if discharging.
Comment 5 battaglia01 2018-07-05 05:32:48 UTC
Finally, I note the problem may result from a discrepancy between upower and acpi. Note the following terminal results. Both of these are in the state where the AC is not plugged in, but the tray icon still says discharging (even though battery panel icon says discharging):

$ acpi -V
Battery 0: Discharging, 50%, 01:55:40 remaining
Battery 0: design capacity 5006 mAh, last full capacity 4092 mAh = 81%
Adapter 0: off-line  <----------------------------------------- NOTE HERE
Thermal 0: ok, 40.0 degrees C
Thermal 0: trip point 0 switches to mode hot at temperature 240.0 degrees C
Thermal 1: ok, 35.3 degrees C
Thermal 1: trip point 0 switches to mode hot at temperature 60.0 degrees C
Thermal 2: ok, 0.0 degrees C
Thermal 2: trip point 0 switches to mode hot at temperature 97.0 degrees C
Thermal 3: ok, 38.0 degrees C
Thermal 3: trip point 0 switches to mode hot at temperature 54.0 degrees C
Cooling 0: x86_pkg_temp no state information available
Cooling 1: Processor 0 of 10
Cooling 2: Processor 0 of 10
Cooling 3: intel_powerclamp no state information available
Cooling 4: pch_skylake no state information available
Cooling 5: Processor 0 of 10
Cooling 6: Processor 0 of 10


Note that Adapter 0 is offline. On the other hand, here's upower -u. Note Adapter 0 (line_power_ADP1) is ONLINE!

~ $ upower -d
Device: /org/freedesktop/UPower/devices/line_power_ADP1
  native-path:          ADP1
  power supply:         yes
  updated:              Thu 05 Jul 2018 12:54:02 AM EDT (2262 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes  <----------------------------- SEE HERE
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          BAT1
  vendor:               SMP
  model:                X910527
  serial:               39135
  power supply:         yes
  updated:              Thu 05 Jul 2018 01:31:23 AM EDT (21 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              15.547 Wh
    energy-empty:        0 Wh
    energy-full:         31.192 Wh
    energy-full-design:  38.152 Wh
    energy-rate:         7.507 W
    voltage:             7.567 V
    time to empty:       2.1 hours
    percentage:          49%
    capacity:            81.7572%
    technology:          lithium-ion
    icon-name:          'battery-good-symbolic'
  History (charge):
    1530768666	49.000	discharging
  History (rate):
    1530768683	7.507	discharging
    1530768682	18.735	charging
    1530768675	7.695	discharging
    1530768666	8.580	discharging

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Thu 05 Jul 2018 01:31:23 AM EDT (21 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              15.547 Wh
    energy-full:         31.192 Wh
    energy-rate:         7.507 W
    time to empty:       2.1 hours
    percentage:          49%
    icon-name:          'battery-good-symbolic'

Daemon:
  daemon-version:  0.99.4
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep
Comment 6 Gauthier 2021-10-18 16:58:52 UTC
Sorry if there is a better place to report this but cold not find any more recent bug report on this issue.

Sometimes my battery indicator in sys tray still says "plugged in" (and the icon has the power plug in it) even though I have unplugged the power adaptor . 
When hovering the mouse over it, it says "Plugged in but still discharging".
When clicking on it, the indicator says, "discharging", and the battery icon inside the popup window is the correct one (i.e. without the power plug in it).

See screenshot attached.

The issue is that he system does not go to sleep any more.

For info, I have rule to stop charging at 85% and start at 45%.

I "think" the issue happens after a wake up from sleep but I'm not sure and it is a bit random.

Plugging back the power adaptor and unplugging it does not solve the issue. The only thing that seem to solve it is rebooting (then it works fine). 

I saw the issue being reported here too:
- https://www.linuxquestions.org/questions/slackware-14/plasma-5-systray-battery-monitor-incorrectly-says-plugged-in-4175671626/
- https://forum.manjaro.org/t/battery-icon-is-constantly-in-charging-mode/27605
- https://bbs.archlinux.org/viewtopic.php?id=236409 (in  here it says it is a bug in upower, but I cannot test that as I cannot downgrade to the version proposed in the article - I run upower version 0.99.11)
- https://www.reddit.com/r/kde/comments/mxampb/having_a_few_problems_with_kde/
Comment 7 Gauthier 2021-10-18 17:01:01 UTC
Created attachment 142583 [details]
Showing ac plugged even if unplugged
Comment 8 Gauthier 2021-10-18 17:04:19 UTC
Using a Lenovo ThinkPad X1 Carbon 6th

Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.0
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-37-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8350U CPU @ 1.70GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620

Upower 0.99.11
Comment 9 Nate Graham 2021-10-19 14:21:23 UTC

*** This bug has been marked as a duplicate of bug 423556 ***