Skip to content

Remember a DDC display whose brightness cannot be read - #14525

Merged
omarchybot merged 2 commits into
quattrofrom
fix/issue-6855
Oct 31, 2026
Merged

omarchybot merged 2 commits into
quattrofrom
fix/issue-6855

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

A display that ddcutil detect lists but which does not answer getvcp 10 was probed in full on every call to omarchy-brightness-display-ddc. When read_vcp failed, read_brightness deleted the connector's cache file, so nothing remembered the failure: the next call re-ran ddcutil --skip-ddc-checks detect --brief and the read again. Some monitors, or the converters in front of them, drop and re-train the link when probed, and the monitor panel refreshes every few seconds while it is open, so those displays blanked over and over. Four reporters see this on AMD and Intel, from 4.0.0rc4 to 4.0.3.

A failed read now writes the same unavailable <timestamp> entry a display that detect does not find already gets, so it is probed at most once per 60 seconds. A display whose read fails only transiently loses DDC brightness until that window passes, and a cached bus left stale by a replug is rediscovered when it does. The test that pinned the old retry-every-call behaviour now checks that a failed read is cached without a second detect or read, and that an expired entry is retried.

#14397 touches detect_bus in the same script for displays ddcutil reports as invalid; it is a different case and does not fix this one.

Verified on a worker built from the Omarchy ISO: test/shell.d/brightness-display-test.sh fails with the fix reverted and passes with it, and ./test/cli and the other brightness tests pass. Reviewed by Claude Opus 5.5 and, as a second opinion, Codex Medium, which found nothing to change.

Fixes #6855

A display ddcutil detects but which does not answer getvcp 10 had its cache entry deleted on every failed read, so each call re-ran the full detect scan and the read again. Some monitors drop and re-train their link when probed, so with the monitor panel polling they blanked over and over. Cache the failure as unavailable for the same 60 seconds as a display detect does not find.

Fixes #6855

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Remembers displays whose DDC brightness cannot be read, while preserving immediate recovery for buses that answered before.

  • Failed reads on new or bus-only entries pause further probes for 60 seconds.
  • Failed reads on previously successful buses clear the saved bus so the next call detects it again.
  • Tests cover the pause, expiry, known-bus recovery, and bus-only entries.

Reviews (2) · Last reviewed commit: "Retry a known DDC bus after one failed r..." · Reviewed by Greptile

Caching every failed read as unavailable also caught a monitor that normally answers: one flaky getvcp from a panel poll hid its brightness control and turned its brightness keys into no-ops for 60 seconds. A failed read on a bus whose cache entry carries the range, which only a successful read writes, now drops the cache, as before, so the next call detects again; any other failed read is left alone for the window. The bare bus find_bus writes before reading does not count, so a caller overlapping a first probe cannot erase the negative cache it leaves. The display in #6855 never has a range cached, so it is still probed at most once a minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Reviewed by Claude Opus 5.5, with Codex Medium as a second opinion over three rounds; its first two rounds each found a real defect in how failures were cached, and both are fixed in 0e3dc60 on this branch.

What changed in 0e3dc60. As first opened, any failed getvcp 10 cached the display as unavailable for 60 seconds. That included a monitor that normally answers: one flaky read during a panel poll hid its brightness control and made the brightness keys do nothing for a minute, where quattro simply retries on the next call. Now a failed read on a bus whose cache entry carries the brightness range (which only a successful read writes) drops the cache as before, so the next call detects and reads again. Any other failed read, including the display in #6855, which never reads successfully, gets the 60-second entry. The check is on the range rather than on the bare bus number, because find_bus writes that before reading. Otherwise a caller overlapping a first probe could delete the negative cache the other one had just written. A test covers each case.

Verified on a worker built from the Omarchy ISO, at 0e3dc60 and merged with quattro at 51bfd1d:

  • A stub ddcutil that detects DP-1 but fails every getvcp: five calls on quattro ran detect and getvcp five times each, while this branch ran each once. Once the entry expires and the display answers, it is found again.
  • test/shell.d/brightness-display-test.sh fails with the fix reverted and passes with it. The new transient-failure test also fails against the branch's first commit.
  • ./test/cli, brightness-display-test.sh, brightness-display-apple-cache-test.sh and brightness-keys-test.sh all pass.

Limits.

Open PR #14397 changes detect_bus in the same script for displays ddcutil reports as invalid. The two are independent and their tests can coexist.

This is waiting on the maintainer.

@omarchybot omarchybot removed verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 16, 2026
@omarchybot
omarchybot merged commit 37b1f3a into quattro Oct 31, 2026
2 checks passed
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
berenddeboer pushed a commit to berenddeboer/omarchy that referenced this pull request Nov 6, 2026
* Remember a DDC display whose brightness cannot be read

A display ddcutil detects but which does not answer getvcp 10 had its cache entry deleted on every failed read, so each call re-ran the full detect scan and the read again. Some monitors drop and re-train their link when probed, so with the monitor panel polling they blanked over and over. Cache the failure as unavailable for the same 60 seconds as a display detect does not find.

Fixes omacom#6855

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Retry a known DDC bus after one failed read

Caching every failed read as unavailable also caught a monitor that normally answers: one flaky getvcp from a panel poll hid its brightness control and turned its brightness keys into no-ops for 60 seconds. A failed read on a bus whose cache entry carries the range, which only a successful read writes, now drops the cache, as before, so the next call detects again; any other failed read is left alone for the window. The bare bus find_bus writes before reading does not count, so a caller overlapping a first probe cannot erase the negative cache it leaves. The display in omacom#6855 never has a range cached, so it is still probed at most once a minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>

---------

Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Codex Medium <noreply@openai.com>
(cherry picked from commit 37b1f3a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Brightness: a monitor found by ddcutil detect but with no readable brightness is rescanned on every open, blanking it

2 participants