Bug 472165

Summary: KDE Power Management System init failed with powerdevil 5.27.6 on Steam Deck
Product: [Unmaintained] Powerdevil Reporter: Dominik K. <dominik.kraues>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: me, natalie_clarius, nicolas.fella
Priority: NOR    
Version First Reported In: 5.27.6   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Dominik K. 2023-07-11 19:47:11 UTC
After upgrade powerdevil from 5.27.5-3 to 5.27.6-1, 5.27.6-2 or 5.27.6-3 powerdevil failed to start on Valve's Steam Deck.

If I start powerdevil from terminal I get these error messages:
org.kde.powerdevil: KDE Power Management System init failed!
org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"

With version 5.27.5-3 everything works fine. However there was the hint "Charge thresholds are not supported by the kernel for this hardware" too. But powerdevil starts and I am able to see the battery and brightness widget an set the standby timings in the KDE settings, which is not possible with powerdevil 5.27.6-1, 5.27.6-2 or 5.27.6-3.

STEPS TO REPRODUCE
1. Install powerdevil >= 5.27.6-1 on the Steam Deck
2. Start KDE
3. Go into the energy settings or try to use the battery and brightness widget.

OBSERVED RESULT
If you open the energy settings in KDE, it tells me that powerdevil couldn't be started.
The battery and brightness widget isn't shown.

EXPECTED RESULT
Energy settings in KDE are shown without errors.
The battery and brightness widget appears.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (6.4.2-arch1-1 (64-bit))
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
With powerdevil 5.27.5-3 everything works fine.
Comment 1 Natalie Clarius 2023-08-10 19:39:09 UTC
Could you please run

QT_LOGGING_RULES="org.kde.powerdevil=true" /usr/lib/org_kde_powerdevil

and post the output here?
Comment 2 Nicolas Fella 2023-08-13 14:11:17 UTC
> org.kde.powerdevil: KDE Power Management System init failed!

This means the backend plugin failed to load, which likely is caused by a setup issue. Fortunately the actual error message is printed, but unfortunately with a logging category that is disabled by default (https://invent.kde.org/plasma/powerdevil/-/merge_requests/207 changes that).

Doing what Natalie said should show the error message
Comment 3 Dominik K. 2023-08-14 14:58:51 UTC
Thanks for the hints. 

I just want to test it so I updated powerdevil to the newest version and voilĂ  it's working as expected! 
So I can tell, that powerdevil 5.27.7-1 is working fine on Steam Deck.

Thank you anyway for your help!