Bug 480879 - Battery and Brightness widget not updating Remaining Time
Summary: Battery and Brightness widget not updating Remaining Time
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Power and Battery widget (show other bugs)
Version: 5.27.10
Platform: Kubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-05 07:55 UTC by Krzysztof
Modified: 2024-03-03 00:57 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof 2024-02-05 07:55:55 UTC
SUMMARY

Battery and brightness applet does not update the battery remaining time but does update battery state (charging/discharging) and percentage.

STEPS TO REPRODUCE

1. Just hover the mouse over the Battery and Brightness applet.

OBSERVED RESULT

I am using Kubuntu 23.10 with backports. Fresh install. The applet was not working in default plasma version and is not working with 5.27.10 as well.

Strangely enough it was working for several minutes after the update to plasma 5.27.10 and after a while stopped updating.

The command: upower -i /org/freedesktop/UPower/devices/battery_BAT0
is showing and updating remaining time on battery correctly.

The output of command: 
upower -i /org/freedesktop/UPower/devices/battery_BAT0
is:
  native-path:          BAT0
  vendor:               SMP
  model:                02DL028
  serial:               975
  power supply:         yes
  updated:              pon, 5 lut 2024, 08:32:25 (28 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              76,66 Wh
    energy-empty:        0 Wh
    energy-full:         85,27 Wh
    energy-full-design:  90 Wh
    energy-rate:         6,402 W
    voltage:             12,337 V
    charge-cycles:       34
    time to empty:       12,0 hours
    percentage:          89%
    capacity:            94,7444%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (charge):
    1707118315  89,000  discharging
  History (rate):
    1707118345  6,402   discharging
    1707118315  7,165   discharging
    1707118285  6,567   discharging

The output of command: 
acpi -lb
is:
Battery 0: Discharging, 86%, 10:29:47 remaining
Battery 0: design capacity 7348 mAh, last full capacity 6962 mAh = 94%

The output of command: 
dbus-monitor --system interface=org.freedesktop.UPower interface=org.freedesktop.UPower.Device
is:
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.219" (uid=1000 pid=7475 comm="dbus-monitor --system interface=org.freedesktop.UP" label="unconfined") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
signal time=1707119461.834604 sender=org.freedesktop.DBus -> destination=:1.219 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.219"

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
Kubuntu 23.10
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.10
UPower client version 1.90.2
UPower daemon version 1.90.2

ADDITIONAL INFORMATION

It may or may not be related, but there is also a problem with Power profile selection in this applet.
The slider always returns to the position where it was previously.
Comment 1 Krzysztof 2024-02-05 08:00:54 UTC
It seems that after a reboot the first reading of battery remaining time is displayed and never updated.
Comment 2 Nate Graham 2024-02-06 19:46:55 UTC
What about `upower -D`?

Regardless, a lot has changed here recently so I strongly suspect that it it's fixed in Plasma 6. I can't reproduce the issue myself on Plasma 6.
Comment 3 Krzysztof 2024-02-11 09:51:29 UTC
Result of upower -d:

Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              nie, 11 lut 2024, 10:49:12 (46 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:               SMP
  model:                02DL028
  serial:               975
  power supply:         yes
  updated:              nie, 11 lut 2024, 10:49:52 (6 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              80,99 Wh
    energy-empty:        0 Wh
    energy-full:         84,16 Wh
    energy-full-design:  90 Wh
    energy-rate:         11,127 W
    voltage:             12,531 V
    charge-cycles:       39
    time to empty:       7,3 hours
    percentage:          96%
    capacity:            93,5111%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (rate):
    1707644992  11,127  discharging
    1707644962  8,058   discharging

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              nie, 11 lut 2024, 10:18:29 (1889 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/line_power_ucsi_source_psy_USBC000o002
  native-path:          ucsi-source-psy-USBC000:002
  power supply:         yes
  updated:              nie, 11 lut 2024, 10:49:29 (29 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/DisplayDevice
  power supply:         yes
  updated:              nie, 11 lut 2024, 10:49:52 (6 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              80,99 Wh
    energy-full:         84,16 Wh
    energy-rate:         11,127 W
    charge-cycles:       N/A
    time to empty:       7,3 hours
    percentage:          96%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  1.90.2
  on-battery:      yes
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep
Comment 4 Krzysztof 2024-02-11 09:56:39 UTC
I also have an update to my observations. The battery remaining time is behaving unpredictably. Sometimes it seems to be updating correctly after system startup and updating estimated time regularly. On other occasion when I start the system it is frozen at the first estimation and never updating. I could not figure out yet if this is correlated with anything else.
Comment 5 Nate Graham 2024-02-13 20:35:43 UTC
I should have been more specific, sorry: are the times shown in `upower -d` wrong in either the exact same way, or at least a similar way?
Comment 6 Krzysztof 2024-02-14 17:20:50 UTC
(In reply to Nate Graham from comment #5)
> I should have been more specific, sorry: are the times shown in `upower -d`
> wrong in either the exact same way, or at least a similar way?

Times shown in "upower -d" seem perfectly fine and never frozen.
During my last check the KDE widget was frozen displaying: "Estimating..." while upower -d was displaying estimated time correctly and updating it every 30 seconds.
Comment 7 Nate Graham 2024-02-15 15:19:51 UTC
Ok, thanks. This has gotten an overhaul in Plasma 6 so it would be good to check to see if the same thing is still happening there.
Comment 8 Krzysztof 2024-03-01 08:54:31 UTC
(In reply to Nate Graham from comment #7)
> Ok, thanks. This has gotten an overhaul in Plasma 6 so it would be good to
> check to see if the same thing is still happening there.

FYI recently the applet started working correctly. I assume this was after an update (although I am still on 5.27.10) because I noticed several updates of KDE related packages. Unfortunately I do not know which one exactly.
Comment 9 Nate Graham 2024-03-03 00:57:23 UTC
All right, great! Let's call it fixed. Probably by a kernel or upower change.