davidhi7 / ddcci-plasmoid

KDE Plasma widget to adjust the brightness of multiple external monitors
MIT License
409 stars 12 forks source link

Ignore specific monitors #59

Open Coffei opened 10 months ago

Coffei commented 10 months ago

Hi,

is it possible to ignore certain monitors in the widget? I have an issue with internal display which flickers everytime DDC is used, so this widget causes this flicker every minute.

Is it possible to ignore a display so it is not queried at all? There are no settings for this available in the widget nor any option in the backend as far as I can see.

IMO it would be sufficient to add some flags to the backend, so I could add them in the widget settings.

davidhi7 commented 9 months ago

Currently no such option is implemented into the backend. If the flickering already happens when running ddcutil detect, there is nothing I can do about it, this could only be addressed on a lower level than this widget or ddcutil.

Coffei commented 9 months ago

Yeah, it does flicker on ddcutil detect. I looked through the ddcutil options and saw no simple way to ignore a device. Strangely, I was using this in Gnome and it didn't have the same problem: https://github.com/daitj/gnome-display-brightness-ddcutil.

davidhi7 commented 9 months ago

The gnome widget uses ddcutil detect --brief instead of ddcutil detect, though I don't think this makes a difference. If it doesn't, I don't think there is anything I can do about this.

Coffei commented 8 months ago

@davidhi7 I recently investigated the ddcutil options and there's -b you can use for getvcp and setvcp to only target specific monitors by their I2C bus number.

E.g. I can use the following command to get and set brightness on a specific monitor.

ddcutil getvcp 10 -b 6
ddcutil setvcp 10 20 -b 6

So the widget could have an option to only target specific monitors via their I2C bus numbers. What do you think?

davidhi7 commented 8 months ago

the -b or --bus flag is already used everywhere a monitor specific value is set or queried. I am unsure if using --bus could help with ddcutil detect. Could you post your output of ddcutil detect?

Coffei commented 8 months ago

detect doesn't support that option, as it claims

detect does not support explicit display option

Hmm, so if you already use -b then it's probably detect that is causing the flickering. Is it required to run every minute?

Also, read this thread https://github.com/rockowitz/ddcutil/issues/292 and noticed they also use ddccontrol, which doesn't cause flickering on my machine. Maybe there could be an alternative backend using ddccontrol.

davidhi7 commented 8 months ago

Implementing an alternative ddc/ci backend is a lot of work for a niche use case, so I cannot work on this anytime soon. Two other options might be

  1. Disable display polling (so not run ddcutil detect once every minute, but only once when launching Plasma and then only if manually invoked (already planned but not implemented)
  2. Don't allow ddcutil to access the i2c device of your builtin monitor by modifying the relevant udev rule. This is the easiest option if the i2c id of your internal monitor doesn't change often.
Coffei commented 8 months ago

Frankly option 1 seems like the easiest thing with most impact. It would basically solve my problem and I don't see any negative effects. If you only do ddcutil detect to find new monitors then I don't see the point of doing that too often. I see it's a bit related to #18. Thanks again for all the work and I suppose we can close this one again, I'll leave that up to you.