Decouple DDC Capture Identity and improve DDC resilience#161
Merged
Conversation
max-baz
reviewed
May 2, 2026
max-baz
left a comment
Owner
There was a problem hiding this comment.
This is awesome, thank you so much for your work! I have only a single request to swap the meaning of the newly introduced field (see the comment), I think it will help the existing users. Other than that, happy to merge and cut a release!
Owner
|
Thank you, this is very nice now, I'm sure quite a number of users will be very happy with your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change improves external monitor support in two related areas: it separates the identifier used for brightness control from the identifier used for Wayland output capture, and it makes DDC brightness control more tolerant of flaky direct DDC access.
capture_nameas an optional config field forbacklightandddcutiloutputs.nameas the brightness-device identity while usingcapture_nameonly for Wayland output matching.ddcutilCLI when raw DDC access is unreliable.The changes are split into three commits so the config/capture-name part, the direct DDC retry/timing changes, and the CLI fallback can be reviewed separately. I can split this into separate PRs if preferred.
Problem
External DDC monitors can require two different identifiers:
Before this change,
wlumaused a singlenamefield for both concerns. That created a mismatch for some external monitors: DDC brightness control could work while frame capture never matched the intended output, which prevented the adaptive predictor from learning or applying brightness changes correctly.The direct DDC path can also be unreliable on some monitors, producing errors such as
invalid DDC/CI lengthorExpected DDC/CI length biteven when the standaloneddcutilCLI can still read or set brightness. Those failures can make wluma skip the display at startup or repeatedly fail brightness reads during normal operation.Solution
Configuration
capture_nameis now available for both output types:name.nameremains the identifier for brightness control and predictor persistence.Runtime behavior
main.rsnow passesnameto brightness backends andcapture_nameto frame capture.ddcutilCLI when direct DDC becomes unreliable,Related Issues
Unable to get brightness value: DDC/CI error: invalid DDC/CI length#114 by retrying direct DDC access and falling back to theddcutilCLI when direct DDC reads or writes fail.ddcutilCLI can detect and read the monitor after direct DDC fails.Validation
Automated:
nix develop -c cargo fmt --checknix develop -c cargo test37 passednix develop -c cargo clippy --all-targets -- -D warningsManual:
capture_name.ddcutilCLI on unstable monitors.Risks And Follow-Ups
ddcutilbeing installed and available inPATH.ddcutilCLI can detect/read a monitor during startup, wluma will still skip that output.