Repository navigation
refactor: rename static_delay_ms to output_delay_ms - #164
Merged
Merged
Conversation
Renames the player role's static delay to "output delay" throughout
roles/player/v1.md. The old name read as "unchangeable" to users,
who configure exactly this delay; "output delay" matches the familiar
TV/AVR term while describing the same thing - the latency of the
output chain past the audio port.
BREAKING CHANGE: wire identifiers change for player clients.
static_delay_ms -> output_delay_ms (client/state field and
server/command payload)
set_static_delay -> set_output_delay (command enum value and
supported_commands entry)
The definition gains one clarifying phrase so the new name is not
read as covering processing delays before the port (DAC latency,
buffers), which the client compensates itself. "Amplifier delays" is
dropped from the timestamp-translation example list of processing
delays: amplifiers are the canonical output_delay_ms case, and
listing them on both sides of the boundary contradicted the
definition.
Fixes #154
maximmaxim345
approved these changes
Aug 20, 2026
maximmaxim345
left a comment
Member
There was a problem hiding this comment.
Thanks @chrisuthe !
The "One small fix beyond" also looks good.
This was referenced Sep 8, 2026
chrisuthe
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Sep 15, 2026
## Summary Implements [spec PR #164](Sendspin/spec#164) ("rename static_delay_ms to output_delay_ms"), which aiosendspin hadn't caught up to yet: - `PlayerStatePayload.static_delay_ms` → `output_delay_ms` - `PlayerCommandPayload.static_delay_ms` → `output_delay_ms` - `PlayerCommand.SET_STATIC_DELAY` (`"set_static_delay"`) → `SET_OUTPUT_DELAY` (`"set_output_delay"`) - `StaticDelayChangedEvent` → `OutputDelayChangedEvent` (a public event type this repo exposes, not wire-facing, but part of the same rename — missed in the first commit, fixed in the second) Applied consistently across the server-side player role, client-side model usage, and docstrings. **Backward compatibility** (mirroring [#343](#343 "keep serving clients on the pre-rename artwork wire"): a client still using `static_delay_ms`/`set_static_delay` is tolerated, not disconnected. - `PlayerCommand.SET_STATIC_DELAY` stays a valid enum value. - `PlayerStatePayload.__pre_deserialize__` rewrites incoming `static_delay_ms` onto `output_delay_ms`, recording `legacy_delay_key` so `PlayerV1Role.client_state_deviations()` flags it — tolerated when the server allows noncompliant clients, rejected in strict mode via the existing `flag_noncompliance` machinery (no new enforcement path needed). - `set_output_delay()` now addresses the client using whichever spelling it declared in `state_supported_commands` — a client that only ever declared `set_static_delay` wouldn't recognize a `set_output_delay` command in `server/command`. - `PlayerCommandPayload.__post_serialize__` serializes `output_delay_ms` under the wire key matching `command`, so constructing the payload with `command=SET_STATIC_DELAY` produces the pre-rename wire shape from the same Python-side field. ## Why now Same root cause as #343: [Sendspin/sendspin-jvm#33](Sendspin/sendspin-jvm#33) adopted the new field names ahead of aiosendspin. Once #343 merged and got a sendspin-jvm client's `client/hello` past the artwork-parsing failure, `client/state` then failed for the same reason one layer deeper — a sendspin-jvm client sends `output_delay_ms` and declares `set_output_delay` in `supported_commands`, and aiosendspin rejected it: `"'set_output_delay' is not a valid PlayerCommand"`. See [Sendspin/conformance#107](Sendspin/conformance#107) for where this surfaced (re-running the matrix after #343 merged). ## Test plan - [x] Full test suite: `pytest -n0` (xdist disabled — its worker-spawn native `av`/PyAV extension loading is flaky in this sandbox, independent of this change) — 1606 passed, 8 skipped, 0 failed - [x] `ruff check` and `ruff format --check` both clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Chris Uthe <chris.uthe@openhomefoundation.org>
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.
Fixes #154.
Renames the player role's static delay to output delay throughout
roles/player/v1.md— field, command enum,supported_commandsvalue, definition heading, and every prose reference (lead-time note, send-ahead formula, timestamp translation, both Playback Synchronization bullets). Verified no other source file refers to the field, as the issue states.static_delay_ms→output_delay_ms(oneclient/statefield, oneserver/commandpayload field) andset_static_delay→set_output_delay(command enum value +supported_commandsentry). No alias. This affects every player client.The clarifying phrase
Per the issue ("One clarifying phrase there prevents the new name from being read as covering those"), the definition now reads:
One small fix beyond the issue's letter
The timestamp-translation text listed amplifier delays among the processing delays clients compensate themselves — contradicting the definition, which places amplifiers beyond the port under
output_delay_ms. With the boundary now stated explicitly in the definition, the example list drops "amplifier delays":Happy to revert if amplifiers were intended on both sides.
Coordination
Per the issue: #142 (moves
supported_commands) and #93 (out-of-range handling for this field) should use the new name if they land after this.Verification
static_delay/ "static delay" occurrences remain in any source file.python3 tools/build-readme.py --checkpasses.