Bug 494408

Summary: Monitor brightness resets to 100% on every monitor wakeup
Product: [Plasma] kwin Reporter: Tomi <steampipe93>
Component: output configurationAssignee: Jakob Petsovits <jpetso>
Status: ASSIGNED ---    
Severity: normal CC: germanp82, jpetso, kde, kdebugs, natalie_clarius, nate, post+kdebugs, postix, swmcd, xaver.hugl
Priority: NOR    
Version: 6.2.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=494497
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tomi 2024-10-10 11:14:05 UTC
SUMMARY
Monitor brightness keeps constantly resetting back to 100%

STEPS TO REPRODUCE
1. Turning monitor off and then on again
2. Just by launching some apps for example firefox
3. By having freesync enabled

OBSERVED RESULT
Brightness goes back to 100% with every monitor

EXPECTED RESULT
It should stay as that value i set it in OSD.

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

ADDITIONAL INFORMATION
 Anyways i have sensitive eyes so white backgrounds at 100% brightness almost get my eyes to watering. If this is some setting that can be changed then it should be in display configuration so it can be easily found
Comment 1 Tomi 2024-10-10 12:24:01 UTC
Managed to fix this issue by installing power-profiles-daemon from arch repo since it was missing from original plasma install now i can change brightness from taskbar. Still it might be better to let users decide between changing monitor brightness from plasma itself or monitor osd. So adding option in monitor configuration page would be ideal in my opinion
Comment 2 Nate Graham 2024-10-10 18:36:43 UTC
Did you not have powerdevil installed as well? I can't see how installing only power-profiles-daemon would have resolved this.
Comment 3 Tomi 2024-10-11 10:03:50 UTC
apparently i didnt have it installed i guess. When i installed arch i installed plasma-meta package but it still was missing power-profiles-daemon. My kde plasma basically let me know i was missing that package when i did some digging. After i installed that package i can set my monitor brightness from taskbar "brightness and color". I guess it defaulted to 100% when i was missing that package so it got resolved that way
Comment 4 Jakob Petsovits 2024-10-11 14:23:48 UTC
KWin defaults the brightness of every monitor to 100% and that's a bug that I can confirm. It happens on session startup, monitor wake-up, and possibly other KWin output configuration change events, until the default brightness is changed. I have seen reports of this on Reddit and Lemmy.

To reproduce:
* Log out of Plasma
* Delete the "brightness" property from your monitor entry in .config/kwinoutputconfig.json
* Manually reduce hardware brightness for your display
* Start a new Plasma Wayland session.

KWin will ask PowerDevil to max out the brightness for any display without this entry, even if hardware brightness is currently lower than max.

The power-profile-daemon installation seems like a red herring, because monitor brightness controls should be available with just PowerDevil by itself. (Without PowerDevil, hardware screen brightness would not be raised.) But the point is that the user needs to change the brightness default to get back to their previously configured monitor brightness, and they shouldn't have to do that.

The bad news is that a fix will require an addition to plasma-wayland-protocols, plus matching patches in PowerDevil (to announce the initial monitor brightness) and KWin (to use it if it was announced). While I know that this can be done in a backwards-compatible way, I'm not sure if the existing guidelines around Wayland protocol versioning will allow me to make it so that PowerDevil will keep working with KWin from 6.2.0. That's a discussion topic for the merge review though.
Comment 5 Zamundaaa 2024-10-12 17:13:40 UTC
I don't think this can be solved nicely... if your monitor resets its brightness on power off (which some do!), you really want KWin to ignore what it says.

Can we somehow detect that the user actually used the OSD to change the brightness level? Or detect that the OSD is open when the brightness gets changed, and only accept the change then?
Comment 6 Jakob Petsovits 2024-10-12 17:25:08 UTC
(In reply to Zamundaaa from comment #5)
> Can we somehow detect that the user actually used the OSD to change the
> brightness level? Or detect that the OSD is open when the brightness gets
> changed, and only accept the change then?

No. The best we can do is poll the monitor semi-regularly (perhaps every 30 seconds) and assume that any observed changes during the KWin session, while the monitor is on, were intentional. That's what the externalBrightnessChangeObserved signal within PowerDevil is meant to do, minus the polling part which is not currently being done for DDC/CI devices (but could be added).
Comment 7 quintus 2024-10-13 11:06:26 UTC
I see this as well on ArchLinux without power-profiles-daemon. powerdevil is installed in version 6.2.0. I did not have this problem before version 6.2.0. Now I can set on my monitor's OSD whatever value I want, as soon as the dimming timeout configured in KDE's power saving settings is reached, or after wakeup from suspend, the monitor's brightness is always set to 100%, which hurts my eyes (just as with the OP).

This only happens on my external monitor (BenQ PD2700U-B), which I use with my laptop's lid closed in a vertical stand (“clamshell” style).
Comment 8 Steven McDougall 2024-10-13 18:52:50 UTC
Monitor brightness resets to 100% on every monitor wake-up.

Software
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.7.0
Qt Version 6.7.2
Kernel Version 6.10.12-300.fc40.x84_64 (64-bit)
Graphics Platform: Wayland

Hardware
Processors: 4 x Intel Core i5-4590 CPU @3.30GZ
Memory 7.6 GiB RAM
Graphics Processor: Mesa Intel HD Graphics 4600
Manufacturere: ASUS

I upgraded to the latest KDE yesterday.
The previous KDE version behaved a bit differently: on every monitor wake-up, the brightness reverted to the value that it had at the last system boot.
Comment 9 Steven McDougall 2024-10-14 00:33:10 UTC
Huh...I did a few reboots and a factory reset of the monitor (Dell U3023E) and the problem seems to have gone away.
Comment 10 Bart Povojnic 2024-10-14 04:28:05 UTC
If using external monitor, workaround is to disable DCC/CI on monitor OSD.
Comment 11 Gavin Liddell 2024-10-15 00:25:02 UTC
I found that on both my Dell S2721DGF and my BenQ GW2480 that disabling DDC/CI worked for me. I don't like controlling my monitors via software anyways (except for some color correction), so that was the fix that works best for me.

Might not be the best solution for those who like controlling their monitor's settings via software or who have no choice but control them via software (laptops being the primary example). Don't know if laptops are affected by this bug, but something worth pointing out.
Comment 12 Bug Janitor Service 2024-10-19 16:28:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6667