You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify buffer handling when an in-place stream/start changes the player codec or sample rate #276
messaging.md ("Server → Client: stream/start") says a stream/start for a role with an active stream "updates the stream configuration without clearing buffers", and that if a parameter change requires rebuffering the receiver "handles this internally: it does not clear buffers unless its implementation requires it".
For a change of codec, sample_rate, channels or bit_depth on the player role this leaves the timeline ambiguous. The already-buffered chunks are in the old format and run to their own tail; chunks after the new stream/start are in the new format. A client that follows the text literally holds both and must decode two formats against one timeline. A server that assumes the client flushes on the new stream/start (aiosendspin does, and re-sends from now + lead in the new format) produces a gap for a client that does not flush, and a client that flushes produces a gap for a server that continues the old timeline.
Suggested clarification: state which side owns the transition. Either (a) the server MUST continue the existing timeline and MAY only change format at a chunk boundary such that the first new-format chunk's timestamp follows the last old-format chunk, and the client keeps both queued; or (b) a format change on an active stream is treated like stream/clear for the player role: the client drops buffered audio and the server re-applies the startup lead. Option (b) matches "Track transitions ... stream/start to update the existing stream configuration" only if gapless is not expected across a format change.
Reference implementation behaviour today: aiosendspin server/push_stream.pyon_role_format_changed and server/roles/player/v1.py_begin_format_transition assume (b).
I think most of the language in the spec describes (a) the server MUST continue the existing timeline. I think the flushing in aiosendspin is relatively new, I could have sworn I tested it out awhile back with sendspin-cpp with a codec change mid-track and it was just concatenated.
We have 2 cases:
Client requests a new codec mid-stream; i.e., FLAC to Opus. Presumably that uses the same sample rate and channel configuration, and a client should be able to easily do this gapless.
The server tries to match the source material sample rate. This means on a track transition the sample rate can jump from, let's say, 44.1 kHz to 96 kHz. If a client can't do this gapless, then I think they should just not advertise supported formats with different sample rates (or channels if they can't adapt to that).
Activity
kahrendt commentedon Sep 16, 2026
I think most of the language in the spec describes (a) the server MUST continue the existing timeline. I think the flushing in aiosendspin is relatively new, I could have sworn I tested it out awhile back with sendspin-cpp with a codec change mid-track and it was just concatenated.
We have 2 cases:
Clarify player buffer handling across an in-place `stream/start` form…
Clarify buffer handling on `stream/start` messages during an active s…