Skip to content

Drop the stale DDC brightness read after a write - #20065

Open
edneymatias wants to merge 1 commit into
omacom:quattrofrom
edneymatias:fix/ddc-stale-read-after-write
Open

edneymatias wants to merge 1 commit into
omacom:quattrofrom
edneymatias:fix/ddc-stale-read-after-write

Conversation

@edneymatias

Copy link
Copy Markdown

What changes

On a Samsung Odyssey G5 (HDMI, DDC/CI), the Display panel's brightness slider changes the monitor's brightness, then jumps back to the previous value: set 10 from 100 and the slider returns to 100, set 50 and it shows 10.

The cause is the monitor: the first VCP 0x10 read after a write returns the value from before the write, however long the read waits. Only the second read is correct. The panel's 5 s refresh does one read, so it gets the stale value.

set 40% (raw 20): read1=[VCP 10 C 11 50] read2=[VCP 10 C 20 50] read3=[VCP 10 C 20 50]
set 15% (raw 7):  read1=[VCP 10 C 20 50] read2=[VCP 10 C 8 50]  read3=[VCP 10 C 8 50]
set 30% (raw 15): read1=[VCP 10 C 8 50]  read2=[VCP 10 C 15 50] read3=[VCP 10 C 15 50]

(read1 is 2 s after the write.) This is also why a verified setvcp fails on this monitor with DDCRC_VERIFY: ddcutil's verification read gets the old value.

omarchy-brightness-display-ddc now reads VCP 0x10 once right after a successful write and discards the answer. That costs one extra DDC read per write and changes nothing for monitors that answer correctly.

Verification

  • bash test/shell.d/brightness-display-test.sh: all pass. The new case models a monitor that answers late and fails on the base branch (the final read returns the old brightness). Two existing read-count assertions now count the throwaway read.
  • On the G5 (NVIDIA HDMI, ddcutil 3.0.2), with the patched script, for 40%, 16% and 30% the next read returns the value just set.

Screenshots

No visible change beyond the slider staying where it was set: the fix is in the DDC helper the Display panel calls.

🤖 Generated with Claude Code

Some monitors (Samsung Odyssey G5) answer the first VCP 0x10 read after a
write with the value from before it. The display panel's next refresh then
moved the slider back to the previous brightness. Read once after the write
and discard the answer.

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

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

omarchy-brightness-display-ddc now discards one brightness read after a successful write so affected monitors do not send the old value back to the slider.

  • DDC brightness changes now skip a monitor’s stale reply.

Reviews (1) · Last reviewed commit: "Drop the stale DDC brightness read after..." · Reviewed by Greptile

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Nov 25, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The CLI suite (141 checks) and brightness-display-test.sh (18 checks) passed on a disposable Omarchy ISO worker at d672a8f040c8a4d372858a916f2682a4a6fa728c. The helper, its public brightness-command caller and the panel's polling path were reviewed. GPT-6 High in Codex, with second opinions from Opus 5.5 High and muse-wonder via pi, thinking high, found no code defect; independence of that agreement is not guaranteed.

The automated case models the stale reply; the worker has no Odyssey G5, so it cannot establish the physical result. This still needs confirmation from a maintainer or an affected issue reporter against this full commit: set several brightness levels, wait through the panel's next five-second refresh, and confirm that both the slider and an independent brightness read stay at the new level. Please include the monitor model, connection, ddcutil version and tested SHA, and note whether repeated adjustments become noticeably slower.

On an affected test machine, this checks out and activates the exact revision:

git clone --filter=blob:none https://github.com/omacom/omarchy.git ~/omarchy-pr-20065
git -C ~/omarchy-pr-20065 fetch origin pull/20065/head
git -C ~/omarchy-pr-20065 checkout --detach d672a8f040c8a4d372858a916f2682a4a6fa728c
omarchy dev link ~/omarchy-pr-20065

Reboot when prompted, then try 40%, 16% and 30% from the Display panel and read each back with omarchy brightness display --monitor HDMI-A-1 (replace the connector name with yours). To return to the packaged installation, run omarchy dev unlink and reboot.

There is also an interaction with #9876: its verified DDC write would exit on the reported G5 verification failure before this PR's discarded read runs. These address different monitor failures; a combined change would need to account for both. This PR remains open awaiting hardware confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants