Bug 469895 - Cannot change laptop display brightness when connected to external monitor with ddcutil support
Summary: Cannot change laptop display brightness when connected to external monitor wi...
Status: RESOLVED FIXED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.5
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://bugs.archlinux.org/task/78536
Keywords:
: 449263 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-05-17 14:37 UTC by quangngo
Modified: 2023-05-31 17:22 UTC (History)
8 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description quangngo 2023-05-17 14:37:21 UTC
SUMMARY
***
Cannot change laptop display brightness when connected to external monitor with ddcutil support.
***


STEPS TO REPRODUCE
1. Boot system with external monitor attached.
2. Change display brightness using brightness slider.

OBSERVED RESULT
Brightness of external monitor changed.
Laptop display brightness won't change.

EXPECTED RESULT
Since we only have one brightness slider for display, laptop display brightness should be prioritized to change.

SOFTWARE/OS VERSIONS
Linux: 6.3.2-arch1-1
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
ArchLinux enable DDC support by default recently in https://github.com/archlinux/svntogit-packages/commit/7af23ec774d7ac53cf15904765de112cb7b3b934. Which Powerdevil already did in master https://invent.kde.org/plasma/powerdevil/-/commit/e4a5e5d3e017ef45979933e14e47408bb3a59dda.
Comment 1 ratijas 2023-05-18 06:48:05 UTC
Packaging problem, already reported as https://bugs.archlinux.org/task/78536
Comment 2 Nate Graham 2023-05-18 14:28:44 UTC
It's not a downstream issue for a distro to enable our feature and that feature is broken. Distros can certainly disable it again, but it's on us to fix it.
Comment 3 ratijas 2023-05-18 20:37:52 UTC
They keep telling "that this is no longer considered experimental and is enabled by default for Plasma 6". I don't know who said that, and I'd like to have a word with that person. Also, passing an otherwise disabled by default configuration flag certainly does not strike me as "enabled by default".
Comment 4 Nate Graham 2023-05-18 20:50:33 UTC
It was enabled by default here in KDE in https://invent.kde.org/plasma/powerdevil/-/commit/e4a5e5d3e017ef45979933e14e47408bb3a59dda
Comment 5 quangngo 2023-05-21 09:17:10 UTC
I create a merge request here https://invent.kde.org/plasma/powerdevil/-/merge_requests/178. Can someone test this.
Comment 6 Nate Graham 2023-05-23 16:06:31 UTC

*** This bug has been marked as a duplicate of bug 449263 ***
Comment 7 Albert Vaca Cintora 2023-05-24 21:58:44 UTC
I'm the one who enabled compiling with libddc by default. I think it's a great feature to be able to control your monitor brightness from Plasma instead of having to use the wonky built-in buttons, and would be nice to polish this feature before Plasma 6. Maybe it can be one of the "cool new things" for marketing. 

I also told Antonio, the Arch packager, that it was ready to enable in Plasma 5 even if it was not on by default. 

I didn't know that powerdevil could only use one backend though, and that enabling libddc would mean the laptop brightness control would be effectively disabled.

Thanks quagngo for the fix where the laptop brightness backend takes precedence, I'll give a review now. The best fix however would be for both backends to be active at the same time, and for Plasma to show two sliders. It would be awesome if we can get that for Plasma 6.
Comment 8 Albert Vaca Cintora 2023-05-24 22:14:59 UTC
Related issue about supporting multiple brightness backends: https://invent.kde.org/plasma/powerdevil/-/issues/19
Comment 9 Nate Graham 2023-05-25 03:38:50 UTC
*** Bug 449263 has been marked as a duplicate of this bug. ***
Comment 10 Albert Vaca Cintora 2023-05-31 11:25:20 UTC
Git commit ddcabaf93712b953e3ec327416e0332d7e44fc40 by Albert Vaca Cintora, on behalf of Quang Ngô.
Committed on 31/05/2023 at 11:24.
Pushed by albertvaka into branch 'Plasma/5.27'.

Fix ddcutil for laptop user

This will prioritize usage of backlight helper over ddcutil.
If backlight helper fail, fall back to ddcutil.
Expected result:
 * Laptop users can now change the brightness of the internal
display. External display will use its own controls.
 * Does not affect desktop users.

M  +71   -76   daemon/backends/upower/powerdevilupowerbackend.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/ddcabaf93712b953e3ec327416e0332d7e44fc40
Comment 11 Nate Graham 2023-05-31 17:20:11 UTC
Git commit caf26c7d2842b3e81e370f414e859609d2fa607b by Nate Graham, on behalf of Quang Ngô.
Committed on 31/05/2023 at 17:16.
Pushed by ngraham into branch 'master'.

Fix ddcutil for laptop user

This will prioritize usage of backlight helper over ddcutil.
If backlight helper fail, fall back to ddcutil.
Expected result:
 * Laptop users can now change the brightness of the internal
display. External display will use its own controls.
 * Does not affect desktop users.


(cherry picked from commit ddcabaf93712b953e3ec327416e0332d7e44fc40)

M  +71   -76   daemon/backends/upower/powerdevilupowerbackend.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/caf26c7d2842b3e81e370f414e859609d2fa607b