Bug 494497

Summary: Screen brightness is being changed even though "change screen brightness" is disabled.
Product: [Plasma] Powerdevil Reporter: Tom Dzmelyk <tddzmely>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: germanp82, josef.schabasser, jpetso, kdebugs, natalie_clarius, nate, postix, simeon.danailov.andreev, xaver.hugl
Priority: NOR Keywords: regression
Version: 6.2.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=494408
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tom Dzmelyk 2024-10-11 00:29:54 UTC
SUMMARY

Powerdevil is controlling screen brightness even though it's disabled. When I first logged in after upgrading to Plasma 6.2 both my monitors popped up the Dell "Adjusting this value will increase power consumption above the default level" but didn't actually successfully change the brightness because it wanted me to confirm. I double checked that the setting was disabled and it was, but the greyed out slider said "70", which is lower than the percent threshold to trigger that warning on my monitor, so it seems to be defaulting to 75+ internally even though the UI said 70.

I enabled the setting and tried a couple values and then turning off "change screen brightness" and it changed the brightness to the value every single time after rebooting and adjusting the brightness manually.

STEPS TO REPRODUCE
1. Turn off "Change screen brightness" in Energy Saving
2. Manually adjust screen brightness to a different value.
3. login/logout

OBSERVED RESULT

Screen brightness changes.

EXPECTED RESULT

No changes.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Arch
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3

ADDITIONAL INFORMATION

Two Dell G2724D monitors, AMD 7700XT GPU

Wayland session, haven't tested Xorg.
Comment 1 Simeon Andreev 2024-10-11 12:29:46 UTC
Same here, 2x LG 24MK600M-B displays, AMD 6900 XT GPU. Seen after updating from 6.1.5 to 6.2.0. Also Wayland session.

Any workarounds for this?
Comment 2 Tom Dzmelyk 2024-10-11 15:41:53 UTC
(In reply to Simeon Andreev from comment #1)
> Same here, 2x LG 24MK600M-B displays, AMD 6900 XT GPU. Seen after updating
> from 6.1.5 to 6.2.0. Also Wayland session.
> 
> Any workarounds for this?

For now I've just set my desired brightness in the settings panel since my display setup is homogeneous and I had both displays configured to the same brightness anyway. Once the value is set it seems to persist.

If your displays or configurations aren't homogeneous I don't think there's anything you can do other than try to pick the least offensive brightness level.
Comment 3 Jakob Petsovits 2024-10-11 20:59:06 UTC
This is the same root cause as (but different symptom than) Bug 494408 comment #4. I'm looking into it. Not the easiest fix, but I have a general understanding of what needs to be done. I hope we can make it so that the fix can land in 6.2.x and doesn't have to wait until 6.3.

(In reply to Simeon Andreev from comment #1)
> Any workarounds for this?

As mentioned, the straightforward way is to manually set a brightness value through Plasma. Both the Brightness and Color applet and the Power Management page in System Settings would do the job, if you're on desktop then probably the applet is what you want.

Alternatively, the PowerDevil README describes how to set the POWERDEVIL_NO_DDCUTIL environment variable, which will disable brightness controls for external DDC/CI monitors: https://invent.kde.org/plasma/powerdevil/-/blob/master/README.md#troubleshooting-ddcci-monitor-brightness-controls.
Comment 4 Josef Schabasser 2024-10-12 11:21:53 UTC
This is happening to me, tooI understand that there might be an underlying bug, but Powerdevil shouldn't get asked to do something if the option isn't enabled. Please respect user settings before introducing over-complicated fixes that were never needed in the first place. If Powerdevil must always perform an action and display brightness is required, then why not query and set it to the same value?
Comment 5 Jakob Petsovits 2024-10-12 16:50:09 UTC
(In reply to Josef Schabasser from comment #4)
> This is happening to me, too. I understand that there might be an underlying
> bug, but Powerdevil shouldn't get asked to do something if the option isn't
> enabled. Please respect user settings before introducing over-complicated
> fixes that were never needed in the first place. If Powerdevil must always
> perform an action and display brightness is required, then why not query and
> set it to the same value?

I get where you're coming from. The thing is that PowerDevil by itself does in fact query and adopt the initial value. If you run it in an X11 session, PowerDevil will humbly leave things untouched as you suggest. The complexity comes from the integration with KWin/Wayland, which honestly at this point I kind of wish we had left disabled for 6.2 by default until edge cases like this one are resolved. But here we are, so the best way forward is to fix things in order to get the best of both worlds.
Comment 6 Josef Schabasser 2024-10-12 18:29:17 UTC
Wait a second, is this caused by the new brightness controls for individual screens? Because even if I disable screen brightness in KCM, it resets to 100% after a reboot (individual sliders untouched at 100%). I think to further enhance the individual sliders, KCM needs to be taken into account, too. I would make brightness controls configurable in KCM: (a) disabled, (b) enabled with a single slider, (c) enabled with individual sliders.

For now I will just disable DDC/CI through `POWERDEVIL_NO_DDCUTIL` because my LG UltraGear 34GN850 behaves really weird. It drops to an insanely low level only to increase it to the requested level and resets to 100% all the time.
My LG 24QP550 on the other hand respects the brightness requested by Powerdevil and then stays there.
Comment 7 Simeon Andreev 2024-10-14 15:33:17 UTC
(In reply to Jakob Petsovits from comment #3)
> (In reply to Simeon Andreev from comment #1)
> > Any workarounds for this?
> 
> As mentioned, the straightforward way is to manually set a brightness value
> through Plasma. Both the Brightness and Color applet and the Power
> Management page in System Settings would do the job, if you're on desktop
> then probably the applet is what you want.

I have tried to use the setting. Unfortunately I see odd behavior.

As first mentioned, I have 2x of the same LG display. One I use for my desktop, the other I share between my desktop and my laptop (for work I use the display for my laptop, in my free time I use it for my PC; my desk has no room for 3 displays). My desktop is on KDE 6.2, my laptop is on KDE 5.24 (for reasons).

As long as I use a static setup (e.g. this weekend I used the 2 displays only for my PC), the setting works fine.

As soon as I start switching the display between my PC and my laptop, there is odd behavior. My 2nd display drops in to very very low levels of brightness, after starting to use it from my PC. I do use dccutil to switch around the inputs of the 2nd display, maybe that somehow interferes with what KDE is doing...

> Alternatively, the PowerDevil README describes how to set the
> POWERDEVIL_NO_DDCUTIL environment variable, which will disable brightness
> controls for external DDC/CI monitors:
> https://invent.kde.org/plasma/powerdevil/-/blob/master/README.
> md#troubleshooting-ddcci-monitor-brightness-controls.

I have done that and disabled the KDE brightness setting (I'm not sure if the latter was necessary or I just observed more weird behavior)... For the last few switches between displays I've not observed weird behavior. Hopefully there are no further issues.
Comment 8 Bug Janitor Service 2024-10-19 16:28:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6667