Skip to content

[ryoku] shell: read DDC brightness after Controls finishes opening - #759

Open
techapostle wants to merge 2 commits into
Ryoku-dev:unstable-devfrom
techapostle:fix/sidebar-ddc-open-hitch
Open

techapostle wants to merge 2 commits into
Ryoku-dev:unstable-devfrom
techapostle:fix/sidebar-ddc-open-hitch

Conversation

@techapostle

@techapostle techapostle commented Nov 7, 2026 •

Copy link
Copy Markdown

What changed

Opening Controls (Super+Escape) on a desktop whose external monitor is driven over DDC/CI made every output stutter. ControlsLevels.qml ran ddcutil getvcp 10 the moment the panel opened. That call takes about 0.3 s, nearly all of it kernel time on NVIDIA I2C, and it overlapped the panel's overlay layers mapping.

Measured with a separate 120 Hz frame-probe client on a second display:

Case Frame stalls per open
Stock two: ~45 ms at +90 ms, 80-200 ms at +220-320 ms
getvcp run on its own none
Brightness drawer opened while the panel is already mapped (two reads) none
Bare fullscreen overlay mapped none
This change (250 ms delay) none over 6 warm opens

So the stall needs DDC traffic overlapping the map. The qs process peaks at about 70% of one core for about 0.4 s on a cold open and stays low on warm opens, so this is not a CPU or GPU load spike.

The open path now starts the read through a 250 ms timer, and closing stops a pending read. The stall only overlaps the first ~100 ms while the layers map: delays of 100 ms, 250 ms, enterDuration, enterDuration + 200 and enterDuration + 400 all showed no stalls over three warm opens each, so a fixed 250 ms keeps margin without tying the read to the motion speed. The read still runs on every open and nothing runs while the panel is closed, which keeps the docs/sidebars.md rule that display probing runs only while its surface is active. The trade-off: the live level lands about 0.5 s after opening instead of about 0.35 s. On a warm reopen the slider shows the last known value until then; on a cold open it reads as unavailable until then.

Separate from this change: the first cold open after a shell reload still showed one ~47 ms stall from building the surface. It did not recur in later runs.

Area

ryoku

How it was tested

Arch, Hyprland 0.57.0, NVIDIA, external monitor on DDC bus 1, Ryoku 1.0.7 (f7197d7), with this change applied to the live shell:

  • Opened and closed Controls repeatedly with ryoku-shell quicksettings while the frame probe recorded. Stalls on open went from two per open to none on warm opens.
  • The external brightness slider still picks up the monitor's live level after opening.
  • bin/ryoku-dev-lint-qml and bin/ryoku-dev-verify-qml-bindings pass. qmllint shows only the unqualified SidebarState access the file already has.

Checklist

  • One logical change, with a clear [area] scope: summary commit subject.
  • Matching CHANGELOG.md updated in the area I touched.
  • The git hooks pass locally; I did not use --no-verify.
  • Lua parses (luac -p), shell scripts pass bash -n, and QML passes
    qmllint where applicable.
  • No duplicated config, no dead code, no commented-out code, no em-dash.
  • Docs updated if behavior or layout changed.

Controls started `ddcutil getvcp` the moment it opened. On a desktop with
an external monitor on DDC/CI that read (about 0.3 s, almost all kernel
time on NVIDIA I2C) overlapped the panel's overlay layers mapping, and
every output dropped frames: a second display running a 120 Hz frame
probe showed two stalls per open, about 45 ms and 80 to 200 ms. Neither
the read alone, the read with the panel already mapped (opening the
Brightness drawer), nor mapping a bare overlay reproduced it.

The open path now starts the read once the enter motion has settled,
and stops the pending read on close. The read still runs on every open
and nothing runs while the panel is closed.

Note: Fixed: opening Controls no longer makes every screen stutter when an external monitor's brightness is controlled over DDC/CI
The stall only overlaps the first ~100 ms while the panel's layers map,
not the reveal motion. Bracketed on the same setup (100 ms, 250 ms,
enterDuration, enterDuration+200, enterDuration+400, three warm opens
each) every delay showed no stalls, so a fixed 250 ms keeps margin,
fills the slider in sooner and no longer depends on the motion speed.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant