Bug 494497 - Screen brightness is being changed even though "change screen brightness" is disabled.
Summary: Screen brightness is being changed even though "change screen brightness" is ...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Power management & brightness (show other bugs)
Version: 6.2.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-10-11 00:29 UTC by Tom Dzmelyk
Modified: 2025-03-06 18:58 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 9 Jakob Petsovits 2024-12-18 19:26:24 UTC
Git commit b799470e6edef0dd5e26bc6d7ae4d7c47ec64b50 by Jakob Petsovits.
Committed on 18/12/2024 at 19:10.
Pushed by jpetso into branch 'master'.

Initially adopt current brightness of external brightness device

This prevents KWin from amping up every display's brightness
to 100% after a 6.2 update. Subsequent changes through a monitor's
OSD menu or another software's DDC/CI commands are still ignored.

Depends on an interface addition to external-brightness-v1
from plasma-wayland-protocols.
Related: bug 494408

M  +10   -0    src/backends/drm/drm_output.cpp
M  +2    -0    src/core/brightnessdevice.h
M  +18   -1    src/wayland/externalbrightness_v1.cpp
M  +4    -1    src/wayland/externalbrightness_v1.h
M  +1    -0    src/workspace.cpp

https://invent.kde.org/plasma/kwin/-/commit/b799470e6edef0dd5e26bc6d7ae4d7c47ec64b50
Comment 10 Oded Arbel 2025-01-05 10:40:53 UTC
I seem to be confused about the discussion, but the original report - to my understanding - is about being able to use the screen brightness controls (shortcuts or brightness widget) when the Power Management KCM has the "Change screen brightness" unchecked. that seem to me like "working as intended" and not a bug: I understand the Power Management brightness control to be "what brightness to set when entering that power state", and when "Change screen brightness" is unchecked - it means "do not change screen brightness when entering that state". It doesn't mean "disable brightness controls".

I don't think there should be a setting to prevent the user from changing the brightness if they use the correct commands, I think that will be silly. If the user don't want to use the interactive brightness control - they can simply not use them, remove the widget and unbind the shortcuts.
Comment 11 Tom Dzmelyk 2025-01-06 02:07:52 UTC
(In reply to Oded Arbel from comment #10)
> I seem to be confused about the discussion, but the original report - to my
> understanding - is about being able to use the screen brightness controls
> (shortcuts or brightness widget) when the Power Management KCM has the
> "Change screen brightness" unchecked.

That is not accurate. My original report is basically a duplicate of https://bugs.kde.org/show_bug.cgi?id=494408, but my monitors prevented Plasma from yeeting display brightness to 100% without my confirmation.
Comment 12 Mark 2025-01-15 14:56:14 UTC
I don't know if i like KDE taking control of the brightness on my desktop monitor... It's different for HDR and movies but that's not the case here. Can i disable KDE controlling my plugged-in monitor brightness? This is beyond the power option, i already have that disabled. Since 6.2 KDE still controls brightness despite it being disabled in the power options. Probably rightfully so, i think we need another option for that in the display settings, more on that below.

Another reason i ask is the keyboard hardware brightness. If you have an external monitor you quite likely have an external keyboard too. Those external keyboards don't necessarily have hardware keys to control the brightness.. Thus you're "stuck" opening the laptop, using it's brightness keys, ... just a fiddly thing. I rather just turn it off and use my monitor controls to change brightness.

Here's what i think is needed.
In the KCM for display configuration we need a new toggle. One that explicitly allows KDE to control the brightness or the monitor. So a toggle by the name of: "Plasma controls monitor brightness" with an info tooltip reading "When enabled, plasma's brightness and power controls are used for controlling screen brightness. When disabled your monitors OSD and keys control brightness."

Yes, when it's toggled that KDE controls it you end up having 2 places in plasma that affect brightness:
1. KCM Display for even allowing plasma brightness control
2. KCM power for how it's used in relation to power changes

If point 1 is toggled on then plasma brightness keys work and power (point 2) potentially works though that depends on the power settings itself.
If point 1 is toggled off then KDE does not touch the brightness at all.
Comment 13 Jakob Petsovits 2025-01-15 17:10:36 UTC
(In reply to Mark from comment #12)
> Can i disable KDE controlling my plugged-in monitor brightness?

At the moment, only through disabling DDC/CI support by setting the `POWERDEVIL_NO_DDCUTIL=1` environment variable in PowerDevil as described in its README file: https://invent.kde.org/https://invent.kde.org/plasma/powerdevil/-/blob/master/README.md#troubleshooting--reporting-bugs

The upcoming ddcutil 2.2 release will also have an option to ignore specific monitors, accessible through its config file which Plasma/PowerDevil also respects.

Furthermore, on X11, Plasma will always adopt monitor brightness after a reboot, reconnection or (on Plasma 6.3) monitor sleep. As mentioned previously, forcing the configured brightness value is specific to the Wayland session.

I agree an option in the Display Configuration settings is highly desirable. I didn't manage to add one for Plasma 6.3, but we should really have this for 6.4. Thanks for sharing your thoughts on what the user experience should be.

In addition to the settings checkbox though, we can still work on peaceful coexistence between OSD menus and Plasma brightness settings. Plasma should read monitor brightness values at certain times to update its configured brightness value, for example before dimming or regularly in infrequent intervals. This would solve most people's issues and relegate the checkbox to only an edge case fix for buggy monitors or niche use cases.

> (...) you end up having 2 places in plasma that affect brightness:
> 1. KCM Display for even allowing plasma brightness control
> 2. KCM power for how it's used in relation to power changes

I'm currently also preparing a merge request to limit profile-based (power state) brightness settings only to internal displays, and possibly narrow down the scope further, e.g. hide and ignore the setting for systems without a battery. This should reduce unintuitive clashes between the display-specific brightness setting in Display Configuration (which mirrors the brightness applet setting) and the "Change screen brightness" setting in Power Management.

All in all, there's a way forward on all of this, it takes a bit more work to make it all come together optimally.
Comment 14 Mark 2025-01-15 17:29:38 UTC
You're welcome Jakob! What is currently there is already a nice change but has some other usecases that might not have been considered before and are suffering a bit from it now. That's oke, iterative development, right :)

To amend a little on the toggle in the display setting. That new sun/brightness tray icon should look at that value too. For example, if i have 3 monitors attached with 1 of them not being controlled by plasma (thus the future button toggled off) should imho still show up in the list of monitors but should be grayed out. Potentially with a tooltip explaining why it's grayed out. There should potentially also be a settings button per display in that brightness dialog that brings you to the settings page of that monitor.

Have fun developing and thank you for your effort!