Skip to content

Update output stereo state on write - #31

Open
relative23 wants to merge 1 commit into
michaelforney:mainfrom
relative23:cache-sync-output-stereo
Open

Update output stereo state on write#31
relative23 wants to merge 1 commit into
michaelforney:mainfrom
relative23:cache-sync-output-stereo

Conversation

@relative23

@relative23 relative23 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

setlevel() reads out->stereo to decide whether a /mix write addresses one channel or the pair. With .set=setbool the flag only changes once the device echoes the register back, so a /mix sent right after /output/N/stereo takes the unlinked branch and never writes mix[1].

setinputstereo() already updates inputs[] on write; this does the same for outputs. Nothing changes on the wire.

Observed on a UCX II by logging out->stereo in setlevel() after /output/5/stereo 1 followed by /mix/5/playback/1: 0 before the patch, 1 after.

relative23 pushed a commit to relative23/oscmix-desk that referenced this pull request Aug 17, 2026
michaelforney/oscmix#31

Rebased onto upstream main, which turns out to be the same commit as our
pin -- upstream has not moved since 2025-06-01, so the patch applies
directly. The binary built from the PR branch is byte-identical to the
one the measurement was taken against.

Merges clean, 1 commit, +28/-1.
relative23 pushed a commit to relative23/oscmix-desk that referenced this pull request Aug 17, 2026
Six places opened their own socket and knew 127.0.0.1. The tidying is
the smaller half; a test asserts no seventh appears outside
backend.py, because each one makes the own-state-path option the
roadmap wants to keep open more expensive.

The half that matters is Traits. The dependency on oscmix's *behaviour*
was invisible: it lived in the control flow as timing constants with
nothing naming what they were for. Three declared properties now, each
checked rather than believed:

- reports_link_state_on_write = False. The sole reason
  LINK_ECHO_TIMEOUT, LINK_SETTLE and LINK_SYNC_BLIND_DELAY exist.
  Measured by instrumenting upstream (patches/README.md): setlevel()
  reads stereo=0 for a pair that was just linked.
- dumps_playback_matrix = False. Asserted against the recorded dump,
  and the reason the playback matrix is re-established not verified.
- reports_unchanged_registers = False. Why a timeout on the echo is
  normal rather than an error.

So when michaelforney/oscmix#31 lands and the pin moves, flipping one
flag is the change instead of a search through the control flow -- in
the order ADR 0008 fixes: bump, measure, then delete.

A pure extraction otherwise: every timing decision stays with the
caller, because a backend that decided timing would be the old control
flow with an extra indirection. Verified beyond green tests -- 50 soak
cycles, and both paths exercised on the device: the normal one (5
registers confirmed) and the blind one with UDP 8222 held.
setlevel() reads out->stereo to decide whether a /mix write addresses
one channel or the pair. With .set=setbool that flag only changes once
the device echoes the register back, so a /mix sent right after
/output/N/stereo takes the unlinked branch and never writes mix[1].

setinputstereo() already updates inputs[] on write; do the same for
outputs. Nothing changes on the wire.
@relative23
relative23 force-pushed the cache-sync-output-stereo branch from d105a87 to 56641bc Compare August 26, 2026 18:44
@relative23 relative23 changed the title oscmix: update our view of output stereo on write Update output stereo state on write Aug 26, 2026
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