FS#70525 - [powerdevil] DDC brightness control random behavior on laptops

Attached to Project: Arch Linux
Opened by Tomas Leypold (ShiroDN) - Wednesday, 21 April 2021, 12:17 GMT
Last edited by Antonio Rojas (arojas) - Saturday, 26 June 2021, 10:06 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Starting with powerdevil 5.21.0, there was added a new build option "-DHAVE_DDCUTIL=ON" to PKGBUILD whitch is turning on integration support for DDC capable monitors.

But the DDC support is not complete and mature, there is a problem on laptops and maybe even multi monitor setups.

On laptops problem is that tha internal laptop monitors have some other non DDC brightness control and when "DHAVE_DDCUTIL=ON" is set than everytime plasma session is started plasma just randomly selects between internal (non DDC) or external (DDC) monitor and from that moment the system brightness control (plasma battery and brightness widget) is controling either internel OR external monitor brightness only. Whitch is not good, because, if plasma randomly selects external monitor, than there is no way to control internal monitor brightness, I disconnect hdmi cable, then it switches to internal monitor. For external monitor you can always use ddcutil.

So I think it would be better to remove "DHAVE_DDCUTIL=ON" option from PKGBUILD. Even the autors of powerdevil recommends to leve it disabled (https://invent.kde.org/plasma/powerdevil/-/blob/master/CMakeLists.txt#L73). It may work fine with 1 monitor, but it's not good with multi monitor setups and laptops.

Additional info:
* package version: > 5.21.0
* link to upstream bug report, if any: https://invent.kde.org/plasma/powerdevil/-/blob/master/CMakeLists.txt#L73

Steps to reproduce:
1. start plasma session on laptop with external monitor with DDC support
2. plasma will randomly select one of the monitors
This task depends upon

Closed by  Antonio Rojas (arojas)
Saturday, 26 June 2021, 10:06 GMT
Reason for closing:  Fixed
Additional comments about closing:  powerdevil 5.22.2.1-2
Comment by Antonio Rojas (arojas) - Wednesday, 21 April 2021, 12:31 GMT
Please report this upstream, or it will never get fixed.
Comment by Tomas Leypold (ShiroDN) - Wednesday, 21 April 2021, 14:31 GMT
Actually, it's not like it's a bug. It is incomplete implementation. DDC in powerdevil supports basicly only one display - only one slider is present in baterry and brightness control independently on number of displays. So, it would need a rewrite.

Sadly it looks like this feature was not touched since 2017.

https://phabricator.kde.org/D7722
Comment by Antonio Rojas (arojas) - Monday, 26 April 2021, 12:25 GMT Comment by Tomas Leypold (ShiroDN) - Tuesday, 27 April 2021, 09:57 GMT
ddcci-driver-linux-dkms would helped only if all monitors (internal and external) had same brightness levels. Unfortunately, that is not a case and one must have diferent brightness levels on every monitor.


Right now, the best solution that I am using for quite some time now:

Internal monitor (laptop monitors) that are non DDC compatible are controlled with powerdevil (plasma) (DHAVE_DDCUTIL is not set). Optionaly you can bind it to shortcut.
External DDC supported monitors are controlled with ddcutil. You can setup global shortcut in plasma system settings like "ddcutil setvcp 10 + 10" ("ddcutil setvcp 10 - 10") and bind it to shotcut in my case "Meta+Shift+Right (Left)"

With this setup you can control both internal and external brightness with a keyboard.

But this setup only works if DHAVE_DDCUTIL is disabled. If DHAVE_DDCUTIL is ON, than with laptops it's unusable and unpredictable. If DHAVE_DDCUTIL is disabled, than you can be certain that powerdevil (plasma) will control only brightness of the internal monitor.

I know, that with only external monitor it is fine. But for us with laptops and multi monitor setups, it's really bother to have to physicaly disconect DP port everytime I turn on the laptop because powerdevil just selected external monitor to control.
Comment by Huang-Huang Bao (eh5) - Thursday, 24 June 2021, 04:44 GMT
I have recently encountered https://bugs.kde.org/show_bug.cgi?id=436340, the powerdevil crashs when resume from screen sleep, and it reset backlight to 0. I have to manually set backlight to 100 every time screen resumes.
Same as the upstream issue, the powerdevil hit a assertion in ddca_open_display2() causing the process aborted. My setup is a desktop wired with an external monitor, so my issue might not be the exact issue with this one.

To workaround this, I have to build powerdevil with DHAVE_DDCUTIL=OFF after every plasma release..

The author who implemented ddcutil support in powerdevil also pointed out the implementation might not be sufficient for current ddcutil, see https://github.com/rockowitz/ddcutil/issues/205#issuecomment-832397668.

Loading...