Bug 414921

Summary: PowerDevil does not check DPMS extension availability
Product: [Unmaintained] Powerdevil Reporter: Ralph Moenchmeyer <rm>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate, pip.kde
Priority: NOR    
Version First Reported In: 5.12.8   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.17.5
Sentry Crash Report:

Description Ralph Moenchmeyer 2019-12-07 12:22:54 UTC
After an Opensuse Leap 15.0 to 15.1 upgrade enegry saving functionality is no longer available in KDE5 Plasma. systemsettings 5 does not give you the possibility to configure - and power saving is not available as a KDE background service. 

This is user independent. upower.service is running. 
Relevant journal messages might be:  

---

2019-12-07T13:10:51.754833+01:00 mytux dbus-daemon[2469]: [system] Activating via systemd: service name='org.freedesktop.UPower' unit='upower.service' requested by ':1.30' (uid=1022 pid=4980 comm="kded5 [kdeinit5]                                  ")
2019-12-07T13:10:51.757410+01:00 mytux systemd[1]: Starting Daemon for power management...
2019-12-07T13:10:51.813860+01:00 mytux systemd[1]: Started Daemon for power management.
2019-12-07T13:10:54.794343+01:00 mytux ksmserver[4999]: ksmserver: Starting autostart service  "/etc/xdg/autostart/powerdevil.desktop" ("/usr/lib64/libexec/org_kde_powerdevil")
2019-12-07T13:10:56.211447+01:00 mytux org_kde_powerdevil[5506]: QDBusArgument: read from a write-only object
2019-12-07T13:10:56.212673+01:00 mytux org_kde_powerdevil[5506]: message repeated 2 times: [ QDBusArgument: read from a write-only object]
2019-12-07T13:10:56.417652+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Backend loaded, loading core
2019-12-07T13:10:56.418431+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Core loaded, initializing backend
2019-12-07T13:10:56.435028+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Xrandr not supported, trying ddc, helper
2019-12-07T13:10:56.435214+01:00 mytux org_kde_powerdevil[5506]: powerdevil: [DDCutilBrightness] compiled without DDC/CI support
2019-12-07T13:10:56.435359+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Falling back to helper to get brightness
2019-12-07T13:10:56.451908+01:00 mytux dbus-daemon[2469]: [system] Activating service name='org.kde.powerdevil.discretegpuhelper' requested by ':1.61' (uid=1022 pid=5506 comm="/usr/lib64/libexec/org_kde_powerdevil ") (using servicehelper)
2019-12-07T13:10:56.464289+01:00 mytux org.kde.powerdevil.discretegpuhelper: QDBusArgument: read from a write-only object
2019-12-07T13:10:56.464553+01:00 mytux org.kde.powerdevil.discretegpuhelper: message repeated 2 times: [ QDBusArgument: read from a write-only object]
2019-12-07T13:10:56.465196+01:00 mytux dbus-daemon[2469]: [system] Successfully activated service 'org.kde.powerdevil.discretegpuhelper'
2019-12-07T13:10:56.465756+01:00 mytux dbus-daemon[2469]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.61' (uid=1022 pid=5506 comm="/usr/lib64/libexec/org_kde_powerdevil ") (using servicehelper)
2019-12-07T13:10:56.471266+01:00 mytux backlighthelper[5726]: powerdevil: no kernel backlight interface found
2019-12-07T13:10:56.476014+01:00 mytux org.kde.powerdevil.backlighthelper: QDBusArgument: read from a write-only object
2019-12-07T13:10:56.476249+01:00 mytux org.kde.powerdevil.backlighthelper: message repeated 2 times: [ QDBusArgument: read from a write-only object]
2019-12-07T13:10:56.476799+01:00 mytux dbus-daemon[2469]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'
2019-12-07T13:10:56.483745+01:00 mytux org_kde_powerdevil[5506]: powerdevil: org.kde.powerdevil.backlighthelper.brightness failed
2019-12-07T13:10:56.483966+01:00 mytux org_kde_powerdevil[5506]: powerdevil: ""
2019-12-07T13:10:56.495839+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Backend is ready, KDE Power Management system initialized
2019-12-07T13:10:56.518190+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Session path: "/org/freedesktop/login1/session/_31"
2019-12-07T13:10:56.519698+01:00 mytux org_kde_powerdevil[5506]: powerdevil: ACTIVE SESSION PATH: "/org/freedesktop/login1/session/_31"
2019-12-07T13:10:56.519869+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Current session is now active
2019-12-07T13:10:56.520009+01:00 mytux org_kde_powerdevil[5506]: powerdevil: fd passing available: true
2019-12-07T13:10:56.522531+01:00 mytux org_kde_powerdevil[5506]: powerdevil: systemd powersave events handling inhibited, descriptor: 22
2019-12-07T13:10:56.522680+01:00 mytux org_kde_powerdevil[5506]: powerdevil: systemd support initialized
2019-12-07T13:10:56.526141+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Got a valid offer for  "DPMSControl"
2019-12-07T13:10:56.532205+01:00 mytux org_kde_powerdevil[5506]: org.kde.bluez: Cannot open /dev/rfkill for reading!
2019-12-07T13:10:56.535136+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Core is ready, registering various services on the bus...
2019-12-07T13:10:56.538419+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Can't contact ck
2019-12-07T13:10:56.538593+01:00 mytux org_kde_powerdevil[5506]: powerdevil: We are now into activity  "a711eadd-9aeb-4856-8d78-1cf6fee07ffe"
2019-12-07T13:10:56.538731+01:00 mytux org_kde_powerdevil[5506]: powerdevil: () ()
2019-12-07T13:10:56.538860+01:00 mytux org_kde_powerdevil[5506]: powerdevil: () ()
2019-12-07T13:10:56.538982+01:00 mytux org_kde_powerdevil[5506]: powerdevil: No batteries found, loading AC
2019-12-07T13:10:56.539103+01:00 mytux org_kde_powerdevil[5506]: powerdevil: Activity is not forcing a profile
2019-12-07T13:10:56.539227+01:00 mytux org_kde_powerdevil[5506]: The X11 connection broke: Unsupported extension used (code 2)

--

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.12.18
(available in About System)
KDE Plasma Version: 5.12
KDE Frameworks Version: 5.55.0
Qt Version: 5.9.7
xcb window ssystem 

---
Any idea what to do about this? I googled but found nothing which helped. 

Regards 
Ralph
Comment 1 Paul 2019-12-07 14:47:42 UTC
FWIW, no problem here on a HP255G7 laptop with openSUSE 15.1

Plasma 5.12.8
Frameworks 5.55.0
Qt 5.9.7
Comment 2 Ralph Moenchmeyer 2019-12-25 10:25:21 UTC
"Solved" it. It had nothing to do with KDE. It is/was due to some xorg.conf setting, which probably occurred during some Nvidia driver update.

The error information which put me in the right direction was 
"The X11 connection broke: Unsupported extension used (code 2)"

I studied the xorg.conf and found a statement 
    Option         "DPMS" "false"
in the Monitor section: 

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL U2515H"
    HorizSync       30.0 - 113.0
    VertRefresh     56.0 - 86.0
    Option         "DPMS" "false"

Commenting the statement out or setting the option to "true" did the trick. 
I do not exactly know why and since when the statement happened to be there. 
Probably it has to do with a monitor mix in a Xinerama configuration. 

Sorry to have bothered you.    

At least I have learned that powerdevil needs monitor DPMS.
Comment 3 Kai Uwe Broulik 2019-12-25 12:58:11 UTC
Thanks for reporting back! However, I think PowerDevil shouldn't die when DPMS isn't available. 
Originally DPMS was an optional feature in PowerDevil but is now compiled as part of the core set. It checks for XRandR extension in brightness controls but it just unconditionally uses DPMS extension and is then killed when it is disabled. So while I don't think it is a high priority to fix that, given you have to disable it manually in xorg.conf (I believe), imho it should still be addressed.
Comment 4 Kai Uwe Broulik 2019-12-25 13:11:27 UTC
Possible patch: https://phabricator.kde.org/D26219
Comment 5 Kai Uwe Broulik 2019-12-27 09:04:55 UTC
Git commit 18e53dbaaea261e1e07a75e01955baa7e373071b by Kai Uwe Broulik.
Committed on 27/12/2019 at 09:04.
Pushed by broulik into branch 'Plasma/5.17'.

Check for DPMS extension being present

It might be disabled. Don't die in this case.
FIXED-IN: 5.17.5

Differential Revision: https://phabricator.kde.org/D26219

M  +11   -2    daemon/actions/dpms/xcbdpmshelper.cpp

https://commits.kde.org/powerdevil/18e53dbaaea261e1e07a75e01955baa7e373071b