"Turn off screen" option dissapeared and not wokring after Plasma 6.0.2 update

Hi there,

As the title reads, no more “turn off screen” option and functionality after 6.0.2 update.

In topic 11111, post 17, jpetso promissed some fixes for “turn off screen” issues. I definitely wasn’t expecting this kind of fixing.

So, what gives? Any way I can get this back?

Thanks in advance.

I did not change the code for displaying this. The fix I mentioned was unrelated to what you’re seeing. Same file, different code path.

The visibility of this control is determined by whether or not the PowerDevil “DPMS” action is “supported” on your system, which in turn is decided by the KScreen::Dpms class in libkscreen. And none of the files making that decision have been changed since January 23, 2024, before Plasma 6.0.0. PowerDevil’s use of this has also not changed, it looks the same as ever:

bool DPMS::isSupported()
{
    return m_dpms->isSupported();
}

So something else is behind this.

If you’re on Wayland, the KScreen::Dpms class defers to KWin, and I haven’t followed the trail that far but it’s possible that something changed on their end. If you’re on X11, everything happens within those few files so the difference would be related to your system in some way.

As an example of “weird things that could theoretically happen”: My laptop appears to have a faulty battery connection pin, which continues delivering power but sometimes the extra battery info doesn’t get transmitted and Linux now doesn’t consider my system battery-powered anymore. When that happens, I also lose the “screen brightness” setting temporarily, until it snaps back again. Super annoying.

Now, I’m not saying that your system is broken in that way. And it sucks that (for the time being?) the setting is gone. And it’s possible that somewhere in the Plasma 6.0.2 update there’s a new change that’s responsible for this. Hard to tell without following the code, or at least enabling debug output for a few systemd-managed Plasma components and reading the system logs carefully. But I’m pretty confident it’s not related to changes of the code that I’m familiar with or have changed in the recent past.

1 Like

Is PowerDevil using libddcutil? I thought it was. In which case a change to libddcutil/ddcutil could cause a change in the result (ddcutil 2+ has had some major changes so that it auto-tunes the i2c timings).

It could also be the GPU driver. In the past few months I experienced an issue with DDC/ddcutil and the Nvidia driver. An upgrade to the driver caused a DP-HDMI connected monitor to stop working with DDC, switching to a DP-DP cable fixed in (Nvidia eventually fixed the driver - I’m using 550.54.14 with no issues).

Yes for brightness, no for turning displays on/off. Anything DPMS-related goes directly to X11 or KWin/Wayland, neither of them uses libddcutil. I figure both would use the kernel’s DRM interface more or less without an extra middleman, which is sufficient to handle on/off even for displays that don’t support DDC/CI?

:point_up_2:

1 Like

DPMS support is just “turning the screen off” in the modern kms interface, the kernel has no way to not support that.

KWin always advertises support for it on Wayland. I don’t know how things look on the X11 side of things though

1 Like

Maybe we have a race in KScreen::Dpms again, such that m_supported gets initialized async although it should be synchronous nowadays? I thought we fixed the last of those async issues for 6.0.0 though.

@mdcclxv, please let us know whether you’re using X11 or Wayland. If you could, also check if the respective other session does show the setting.

Thanks for your involvement. The issue is happening on X11, it doesn’t on Wayland. I’m running Arch Linux, with powerdevil installed. I have a Radeon RX 550X, so nVidia here.

Please let me know if I can provide any more helpful info for fixing this.

Just bumping the issue :slight_smile:

And what exactly were you hoping to accomplish with that, might I ask? In case you’re not aware, things like that tend to annoy developers, and annoyed developers tend not to want to perform free work.

In case you were not aware. Nobody replied anything to my offer. Someone has a bad day here.

1 Like

Right, I guess everyone was busy and you’ll just have to be patient. This is a free service here.

We all do both free and payed work. A simple “We’ll get back to you” would have sufficed.

One bump is fair imho, @mdcclxv has been helpful with info and honestly this would have probably fallen off my radar entirely, with no associated bug report existing. (Another great way to bump a thread: “I’ve created a bug report at this link: …”)

But yeah, so with X11 being affected and not Wayland, the prime candidate for things going wrong would be XcbDpmsHelper in libkscreen, i.e. the X11 implementation of KScreen::Dpms. The easiest way to debug this would be an actual debugger attached to a binary with symbols available, to see why it (presumably) ends up with setSupported(false). Assuming that you’re not a developer though, we’ll have to make do with logs.

So let’s figure out how to get helpful logs. Here is a page about logging on the KDE community wiki. And here’s a draft README file for PowerDevil. The DPMS action is initialized inside the PowerDevil background service, not in System Settings which just queries the service. Please increase the log level for PowerDevil logs as indicated in the README, but also increase KScreen log levels, so that the environment variable looks like this:

QT_LOGGING_RULES=org.kde.powerdevil=true;org.kde.kscreen=true

Then restart the service also as indicated in the README, and have a look at your system logs e.g. with journalctl --boot (new entries are pretty far down so press End to get to the bottom first). I’m specifically interested if the "DPMS extension not available" message from KScreen will show up. But any other suspicious logs might also help.

If that particular message doesn’t show, the other main possibility would that the expression capableReply && capableReply->capable from a few lines further down in the file equals false, and we don’t have logs when that happens, and at that point a debugger would really, really help. But let’s worry about this if we get there in the first place.

Sorry for the late reply, been out the whole weekend.


Copy that. Will certainly do after we reach any sort of conclusion here.


So, down bellow is the log. Key point is that the DPMS extension not available message does appear. Secondary, I pasted the whole log since it looks like there are a couple more issues there, no idea if they are related to the problem at hand.

Apr 15 00:29:55 amd systemd[999]: Starting Powerdevil...
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                               Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                               If this causes problems, reconfigure your locale. See the locale(1) manual
                                               for more information.
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Backend loaded, loading core
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Creating UPowerDevice for "/org/freedesktop/UPower/devices/DisplayDevice"
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Update: QMap(("BatteryLevel", QVariant(uint, 1))("Capacity", QVariant(double, 0))("ChargeCycles", QVariant(int, 0))("Energy", QVariant(double, 0))("EnergyEmpty", QVariant(double, 0))("EnergyFull", QVariant(double, 0))("EnergyFullDesign", QVariant(double, 0))("EnergyRate", QVariant(double, 0))("HasHistory", QVariant(bool, false))("HasStatistics", QVariant(bool, false))("IconName", QVariant(QString, "battery-missing-symbolic"))("IsPresent", QVariant(bool, false))("IsRechargeable", QVariant(bool, false))("Luminosity", QVariant(double, 0))("Model", QVariant(QString, ""))("NativePath", QVariant(QString, ""))("Online", QVariant(bool, false))("Percentage", QVariant(double, 0))("PowerSupply", QVariant(bool, false))("Serial", QVariant(QString, ""))("State", QVariant(uint, 0))("Technology", QVariant(uint, 0))("Temperature", QVariant(double, 0))("TimeToEmpty", QVariant(qlonglong, 0))("TimeToFull", QVariant(qlonglong, 0))("Type", QVariant(uint, 0))("UpdateTime", QVariant(qulonglong, 1713127656))("Vendor", QVariant(QString, ""))("Voltage", QVariant(double, 0))("WarningLevel", QVariant(uint, 1)))
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Core loaded, initializing backend
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Trying Backlight Helper first...
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: org.kde.powerdevil.backlighthelper.brightness failed
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: ""
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Brightness Helper have failed. Trying DDC Helper for brightness controls...
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Initializing ddcutil API (create ddcutil configuration file for tracing & more)...
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: Initializing libddcutil.  ddcutil version: 2.1.4, shared library: /usr/lib/libddcutil.so.5.1.2
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: Options passed from client:
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: Applying combined options:
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: Library initialization complete.
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Check for monitors using ddca_get_display_info_list2()...
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: [DDCutilBrightness] 3 display(s) were detected
Apr 15 00:29:55 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Opening the display reference, creating a display handle...
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Display supports Brightness, adding handle to list
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Create a Display Identifier: "i2c:1" for display: HS160PC
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Opening the display reference, creating a display handle...
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Display supports Brightness, adding handle to list
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Create a Display Identifier: "i2c:2" for display: HS160PC
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Opening the display reference, creating a display handle...
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Display supports Brightness, adding handle to list
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Create a Display Identifier: "i2c:3" for display: PHL 328E1
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Using DDCutillib
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Screen brightness value:  35
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Screen brightness value max:  100
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: current screen brightness value:  35
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Backend ready, KDE Power Management system initialized
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Battery with UDI "/org/freedesktop/UPower/devices/battery_hidpp_battery_0" was detected
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Session path: "/org/freedesktop/login1/session/_31"
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: ACTIVE SESSION PATH: "/org/freedesktop/login1/session/_31"
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Current session is now active
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: fd passing available: true
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: systemd powersave events handling inhibited, descriptor: 28
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Checking logind inhibitions
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: systemd support initialized
--------------------------------------------------------------------------------------------------------------------------------------------
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.kscreen.dpms: DPMS extension not available
--------------------------------------------------------------------------------------------------------------------------------------------
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Kbd backlight brightness value:  0
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Core is ready, registering various services on the bus...
Apr 15 00:29:56 amd systemd[999]: Started Powerdevil.
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Currently using activity  "d80ae6d1-bddc-4ac7-a7c6-66af4316d496"
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Settings for loaded activity:
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: "InhibitScreenManagement" = QVariant(bool, false)
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: "InhibitSuspend" = QVariant(bool, false)
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: No batteries found, loading AC
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil:
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Can't contact ck
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Screen brightness value:  35
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Screen brightness value max:  100
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Can't contact ck
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Screen brightness value:  35
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Screen brightness value max:  100
Apr 15 00:29:56 amd org_kde_powerdevil[11902]: org.kde.powerdevil: Can't contact ck
Apr 15 00:30:45 amd firefox.desktop[12072]: [12072, Main Thread] WARNING: Locale not supported by C library.
Apr 15 00:30:45 amd firefox.desktop[12072]:         Using the fallback 'C' locale.: 'glib warning', file /usr/src/debug/firefox/firefox-124.0.2/toolkit/xre/nsSigHandlers.cpp:187
Apr 15 00:30:45 amd firefox[12072]: Locale not supported by C library.
                                            Using the fallback 'C' locale.

About debugging. I did do C/C++ development quite some years ago, even (diss)assembly, but it was on Windows, I only turned to Linux two years ago. So, while I do know about debugging binaries with symbols, I never did it on Linux, that is, I’m totally unfamiliar with Linux’s native dev environment. If push comes to shove, I’m willing to give it a go, should be educational :slight_smile:

Okay great, that locates the error to a precise spot in the code. I don’t know much about X11 internals or accessing it via the XCB library, but this is a strong indicator that PowerDevil is doing the right thing based on getting no valid extension back from the xcb_get_extension_data(c, &xcb_dpms_id) function call.

The question now is why your system might not support the DPMS extension for X11/XCB, or not anymore if it used to work before. Especially given that @Zamundaaa mentioned widespread support for display on/off in the kernel itself. I’m a bit of out my depth here, perhaps this can be explained with more research but no good guesses at the moment.

So I started reading about DPMS extension, to understand what’s the deal with it, what it actually does. And I found in an Arch Wiki article the following foot note:

And it hit me, the checkbox actually disappeared after I uninstalled XScreenSaver because it was no longer working with Plasma 6.

Scouring those links I ended up checking /etc/X11/xorg.conf.d/ and, lo and behold, there was a file with this in it:

Section "Extensions"
    Option "DPMS" "false"
EndSection

Deleted the file, logged off and back on, everything back to normal.

So there’s no bug to be reported here :slight_smile:

Thank you guys for your time.

1 Like