Created attachment 173468 [details] Screenshot of the power management applet in this case. SUMMARY The power management applet doesn't seem to want to communicate with the power-profiles-daemon despite it being running without errors. It reads as if the daemon isn't installed. However, the hotkey to switch power profiles (Super+b by default) works and is able to change the power profile. This coincided with updating power-profiles-daemon to version 0.22-2 on archlinux. STEPS TO REPRODUCE 1. On arch, update power-profiles-daemon to 0.22-2 2. Reboot the system 3. Open the power management applet OBSERVED RESULT (see attachment) the power management applet does not detect the running power-profiles-daemon, and does not allow the user to change the power profile. EXPECTED RESULT The power management applet allows the user to select a power profile. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 6.10.8-arch1-1 KDE Plasma Version: 6.1.4-1 KDE Frameworks Version: 5.116.0-1 Qt Version: 6.7.2-2
(In reply to vis from comment #0) Can you check that the power-profiles-daemon service is running? $ systemctl status power-profiles-daemon.service
(In reply to kilgore.trout from comment #1) > (In reply to vis from comment #0) > Can you check that the power-profiles-daemon service is running? > > $ systemctl status power-profiles-daemon.service ~> systemctl status power-profiles-daemon.service ● power-profiles-daemon.service - Power Profiles daemon Loaded: loaded (/usr/lib/systemd/system/power-profiles-daemon.service; ena> Active: active (running) since Mon 2024-09-09 14:30:51 CDT; 10min ago Invocation: da9e98004ed2464a883de8b5fb3f002f Main PID: 3434 (power-profiles-) Tasks: 4 (limit: 37651) Memory: 2M (peak: 3M) CPU: 91ms CGroup: /system.slice/power-profiles-daemon.service └─3434 /usr/lib/power-profiles-daemon Sep 09 14:30:51 bousfield systemd[1]: Starting Power Profiles daemon... Sep 09 14:30:51 bousfield systemd[1]: Started Power Profiles daemon. It's definitely running, as I can change the power profile via powerprofilesctl and the KDE hotkey.
(In reply to vis from comment #2) Check also that dbus.service is running, for both user and system.
(In reply to kilgore.trout from comment #3) > (In reply to vis from comment #2) > Check also that dbus.service is running, for both user and system. It is, for both user and system.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/425
This is caused by https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/8277adb7cd89293fd4d32407eee1596ffbf6acce ppd starts too late for powerdevil
(In reply to Li Jiajun from comment #6) > This is caused by > https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/ > 8277adb7cd89293fd4d32407eee1596ffbf6acce > ppd starts too late for powerdevil Aah that makes sense. And, when I restarted powerdevil manually (systemctl --user restart plasma-powerdevil) it starts working.
*** Bug 492945 has been marked as a duplicate of this bug. ***
Git commit 8e698dbcdc9ce95095ea2739713fde05ca4822f5 by Jakob Petsovits. Committed on 19/09/2024 at 18:06. Pushed by jpetso into branch 'master'. applets/batterymonitor: React to D-Bus service (un)register events Previously, the "Power and Battery" applet only checked for the presence of PowerDevil's D-Bus services once when it starts up. This appears to (mostly?) work for applets embedded in a panel, but does not work for applets on the desktop itself. Likely there's a timing issue and applets on the desktop start sooner than PowerDevil will advertise its services. A better way to work is for the applet to monitor the bus for when the relevant services appear or disappear. When observing a service registered or unregistered event, the applet gets set up accordingly. This fixes the race condition for two out of three applet parts (power profiles, inhibitions) but does not fix battery status; the data for that is coming from `BatteryControlModel` in plasma-workspace. A similar fix will have to be implemented there. Related: bug 488915, bug 489003, bug 492945 M +88 -12 applets/batterymonitor/plugin/powermanagementcontrol.cpp M +10 -2 applets/batterymonitor/plugin/powermanagementcontrol.h M +77 -1 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +10 -1 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/8e698dbcdc9ce95095ea2739713fde05ca4822f5
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4729
Git commit 0979a34248efa8eac087e418a4cf4419549ece0c by Jakob Petsovits. Committed on 20/09/2024 at 12:26. Pushed by jpetso into branch 'master'. components/batterycontrol: React to D-Bus service (un)register events Previously, the "Power and Battery" applet only checked for the presence of PowerDevil's D-Bus services once when it starts up. This appears to (mostly?) work for applets embedded in a panel, but does not work for applets on the desktop itself. Likely there's a timing issue and applets on the desktop start sooner than PowerDevil will advertise its services. A better way to work is for the applet to monitor the bus for when the relevant services appear or disappear. When observing a service registered or unregistered event, the applet gets set up accordingly. This fixes the race condition for one out of three applet parts (battery state) but does not fix power profiles & inhibitions; these were fixed separately in the powerdevil repository via commit 8e698dbc. Related: bug 488915, bug 489003, bug 492945 M +82 -15 components/batterycontrol/batterycontrol.cpp M +6 -1 components/batterycontrol/batterycontrol.h https://invent.kde.org/plasma/plasma-workspace/-/commit/0979a34248efa8eac087e418a4cf4419549ece0c
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/428
Git commit 5e8cd380806da20d0b12bf97a3629ac70aa2b77c by Jakob Petsovits. Committed on 23/09/2024 at 21:41. Pushed by jpetso into branch 'Plasma/6.2'. applets/batterymonitor: React to D-Bus service (un)register events Previously, the "Power and Battery" applet only checked for the presence of PowerDevil's D-Bus services once when it starts up. This appears to (mostly?) work for applets embedded in a panel, but does not work for applets on the desktop itself. Likely there's a timing issue and applets on the desktop start sooner than PowerDevil will advertise its services. A better way to work is for the applet to monitor the bus for when the relevant services appear or disappear. When observing a service registered or unregistered event, the applet gets set up accordingly. This fixes the race condition for two out of three applet parts (power profiles, inhibitions) but does not fix battery status; the data for that is coming from `BatteryControlModel` in plasma-workspace. A similar fix will have to be implemented there. Related: bug 488915, bug 489003, bug 492945 M +88 -12 applets/batterymonitor/plugin/powermanagementcontrol.cpp M +10 -2 applets/batterymonitor/plugin/powermanagementcontrol.h M +77 -1 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +10 -1 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/5e8cd380806da20d0b12bf97a3629ac70aa2b77c
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4740
The above fixes make the "Power and Battery" applet independent from timing of the PowerDevil daemon itself, which *might* fix this issue. But there is another snag in PowerDevil's applets/batterymonitor/plugin/powerprofilescontrol.cpp that could introduce problems: After having detected the PowerDevil D-Bus service, the code in PowerProfilesControl::onServiceRegistered() checks for the D-Bus service of power-profiles-daemon being present. But if p-p-d appears later than PowerDevil itself, then this code will miss it and won't be looking out for p-p-d to reappear again later. We'll have to tweak this code a little more to be entirely robust against timing issues.
Git commit 43ca4f3bf083651c2ac8b803596e3827ed8d5e76 by Jakob Petsovits. Committed on 23/09/2024 at 21:48. Pushed by jpetso into branch 'Plasma/6.2'. components/batterycontrol: React to D-Bus service (un)register events Previously, the "Power and Battery" applet only checked for the presence of PowerDevil's D-Bus services once when it starts up. This appears to (mostly?) work for applets embedded in a panel, but does not work for applets on the desktop itself. Likely there's a timing issue and applets on the desktop start sooner than PowerDevil will advertise its services. A better way to work is for the applet to monitor the bus for when the relevant services appear or disappear. When observing a service registered or unregistered event, the applet gets set up accordingly. This fixes the race condition for one out of three applet parts (battery state) but does not fix power profiles & inhibitions; these were fixed separately in the powerdevil repository via commit 8e698dbc (master branch) / commit 5e8cd380 (Plasma/6.2). Related: bug 488915, bug 489003, bug 492945 M +82 -15 components/batterycontrol/batterycontrol.cpp M +6 -1 components/batterycontrol/batterycontrol.h https://invent.kde.org/plasma/plasma-workspace/-/commit/43ca4f3bf083651c2ac8b803596e3827ed8d5e76
(In reply to Jakob Petsovits from comment #16) > Git commit 43ca4f3bf083651c2ac8b803596e3827ed8d5e76 by Jakob Petsovits. > Committed on 23/09/2024 at 21:48. > Pushed by jpetso into branch 'Plasma/6.2'. > > components/batterycontrol: React to D-Bus service (un)register events > > Previously, the "Power and Battery" applet only checked for the > presence of PowerDevil's D-Bus services once when it starts up. > This appears to (mostly?) work for applets embedded in a panel, > but does not work for applets on the desktop itself. > Likely there's a timing issue and applets on the desktop start > sooner than PowerDevil will advertise its services. > > A better way to work is for the applet to monitor the bus for when > the relevant services appear or disappear. When observing a service > registered or unregistered event, the applet gets set up accordingly. > > This fixes the race condition for one out of three applet parts > (battery state) but does not fix power profiles & inhibitions; > these were fixed separately in the powerdevil repository > via commit 8e698dbc (master branch) / commit 5e8cd380 (Plasma/6.2). > Related: bug 488915, bug 489003, bug 492945 > > M +82 -15 components/batterycontrol/batterycontrol.cpp > M +6 -1 components/batterycontrol/batterycontrol.h > > https://invent.kde.org/plasma/plasma-workspace/-/commit/ > 43ca4f3bf083651c2ac8b803596e3827ed8d5e76 Hi Jacob, were you able to get this reviewed, by any chance? I'm affected by this issue, and while it's not as bad as I initially feared (PPD is still running in the end, so my battery won't get killed), it's surely a lack of polish. Thanks! https://discuss.kde.org/t/power-and-battery-widget-fails-to-see-power-profiles-daemon-as-running/24716 https://forums.opensuse.org/t/kde-power-profiles-daemon-does-not-start-correctly/179921
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/454
Git commit 46a49ded6e4020e1ae2b0287e01fabc8e527a070 by Méven Car. Committed on 04/11/2024 at 09:37. Pushed by meven into branch 'master'. applets: react to power-profile-daemon dbus registration Made tlpInstalled a bindable property as it can change now. M +25 -13 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +5 -3 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/46a49ded6e4020e1ae2b0287e01fabc8e527a070
Git commit e096c7e24b2e4a9167c735c27b58f709dec95922 by Nate Graham, on behalf of Méven Car. Committed on 04/11/2024 at 20:41. Pushed by ngraham into branch 'master'. Applets/batterymonitor: correct dbus watcher Amends 46a49ded Now properly tested: `sudo systemctl stop power-profiles-daemon.service` / \``sudo systemctl start power-profiles-daemon.service`\ is reflected by the applet immediately. M +18 -5 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +1 -0 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/e096c7e24b2e4a9167c735c27b58f709dec95922
Git commit b159dec4edcb368d56b18dc1985b301ed40d6852 by Méven Car. Committed on 05/11/2024 at 08:32. Pushed by meven into branch 'cherry-pick-492859'. applets: react to power-profile-daemon dbus registration Made tlpInstalled a bindable property as it can change now. (cherry picked from commit 46a49ded6e4020e1ae2b0287e01fabc8e527a070) M +25 -13 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +5 -3 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/b159dec4edcb368d56b18dc1985b301ed40d6852
Git commit b6ba7e1f3f7c04dfd75fe61d50ecb877742f6c6c by Méven Car. Committed on 05/11/2024 at 08:33. Pushed by meven into branch 'cherry-pick-492859'. Applets/batterymonitor: correct dbus watcher Amends 46a49ded Now properly tested: `sudo systemctl stop power-profiles-daemon.service` / \``sudo systemctl start power-profiles-daemon.service`\ is reflected by the applet immediately. (cherry picked from commit e096c7e24b2e4a9167c735c27b58f709dec95922) M +18 -5 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +1 -0 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/b6ba7e1f3f7c04dfd75fe61d50ecb877742f6c6c
Git commit fdaf3a64ca61c611178f9c3cb14d6bf91e884b31 by Méven Car. Committed on 05/11/2024 at 09:47. Pushed by meven into branch 'Plasma/6.2'. Applets/batterymonitor: correct dbus watcher Amends 46a49ded Now properly tested: `sudo systemctl stop power-profiles-daemon.service` / \``sudo systemctl start power-profiles-daemon.service`\ is reflected by the applet immediately. (cherry picked from commit e096c7e24b2e4a9167c735c27b58f709dec95922) M +19 -6 applets/batterymonitor/plugin/powerprofilescontrol.cpp M +1 -0 applets/batterymonitor/plugin/powerprofilescontrol.h https://invent.kde.org/plasma/powerdevil/-/commit/fdaf3a64ca61c611178f9c3cb14d6bf91e884b31