Bug 498590

Summary: Power profiles stopped working with tuned
Product: [Plasma] plasmashell Reporter: Iyán M. V. <me>
Component: Power and Battery widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 6.2.90   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Iyán M. V. 2025-01-13 08:39:19 UTC
SUMMARY
tuned (with tuned-ppd) was working with Plasma 6.2. After updating to Plasma 6.3 Beta 1, the Power and Battery applet shows "Power profiles are not supported on your device"

STEPS TO REPRODUCE
1. Install tuned and tuned-ppd as a replacement for power-profiles-daemon
2. Update to Plasma 6.3 Beta 1

OBSERVED RESULT
Power profiles are not recognized anymore.

EXPECTED RESULT
tuned-ppd works as in Plasma 6.2

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.90
KDE Frameworks Version: 6.10.0
Qt Version: 6.9.0
Kernel Version: 6.12.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 22 × Intel® Core™ Ultra 7 155H
Memory: 30.9 GiB of RAM
Graphics Processor: Intel® Arc
Manufacturer: LENOVO
Product Name: 21KDS00600
System Version: ThinkPad X1 Carbon Gen 12
Comment 1 Nate Graham 2025-01-13 19:44:59 UTC
Fedora 42 ships tuned-ppd instead of the original, and it's working as expected for me. The detection is based on whether the original PPD DBus methods are implemented and detected, so is it possible that Arch's packaging of it doesn't implement them the same way?
Comment 2 Iyán M. V. 2025-01-13 20:13:13 UTC
Arch Linux started to offer tuned-ppd as well since October last year. It is supposed to be a simple replacement for power-profiles-daemon, and it was working like in Fedora (I also have a server running F40) for me before I updated to Plasma 6.3 Beta + Frameworks 6.10.0 + Qt 6.9 Beta 1 using the [kde-unstable] repo.

I'm almost sure this is not a packaging issue.

I can try to do a git bisect if you think that would be useful.
Comment 3 Nate Graham 2025-01-13 20:17:44 UTC
If you can bisect the KDE code, that would be very useful, yeah!
Comment 4 Antonio Rojas 2025-01-13 20:38:07 UTC
tuned-ppd does not understand the new upower dbus namespaces which are used in 6.3

https://invent.kde.org/plasma/powerdevil/-/commit/223b927a8351f35d7c2c2a70ea6d78568051ba3c
Comment 5 Iyán M. V. 2025-01-13 20:50:07 UTC
223b927a8351f35d7c2c2a70ea6d78568051ba3c is the first bad commit
commit 223b927a8351f35d7c2c2a70ea6d78568051ba3c (HEAD)
Author: Jakob Petsovits <jpetso@petsovits.com>
Date:   Mon Sep 2 17:28:02 2024 +0200

    daemon/actions/powerprofile: Use the new D-Bus names for p-p-d
    
    power-profiles-daemon was moved into the UPower namespace,
    where it changed its bus, path & interface names from the original
    net.hadess.PowerProfiles to org.freedesktop.UPower.PowerProfiles.
    
    These new names are advertised starting with v0.20 released in
    February 2024. The old names are still supported at least in the
    current v0.21, but we don't know for how long (or on all distros,
    given that OpenSuse already tried to remove it early on).
    
    A February 2024 release seems long enough ago that we shouldn't
    require support for the old interface anymore. Rather than adding
    a second interface and introducing complexity, let's just make
    a clean switch to the new name while both are supported.
    
    BUG: 484868

 applets/batterymonitor/plugin/powerprofilescontrol.cpp                                            |  2 +-
 autotests/applets/NetHadessPowerProfiles.py                                                       | 10 +++++-----
 daemon/actions/bundled/CMakeLists.txt                                                             |  2 +-
 daemon/actions/bundled/{net.hadess.PowerProfiles.xml => org.freedesktop.UPower.PowerProfiles.xml} | 15 +++++++++++----
 daemon/actions/bundled/powerprofile.cpp                                                           |  8 ++++----
 daemon/actions/bundled/powerprofile.h                                                             |  4 ++--
 6 files changed, 24 insertions(+), 17 deletions(-)
 rename daemon/actions/bundled/{net.hadess.PowerProfiles.xml => org.freedesktop.UPower.PowerProfiles.xml} (93%)
Comment 6 Iyán M. V. 2025-01-13 20:51:01 UTC
Antonio is faster as usual :)
Comment 7 Iyán M. V. 2025-01-13 20:54:56 UTC
Alright, so not really a bug, but it will affect users unless tuned makes a new release with this (https://github.com/redhat-performance/tuned/pull/684) before Plasma 6.3 Final.
Comment 8 Nate Graham 2025-01-13 21:00:16 UTC
Cool, I'll ping folks upstream to see what can be done there.
Comment 9 Nate Graham 2025-01-13 21:09:20 UTC
Apparently what could be done was to merge it immediately, since that's now been done! Hopefully they make a new release soon. If not, https://github.com/redhat-performance/tuned/commit/84a58f2d4e66ab82ae92fc251ba090da9cc920f2can be backported at least.