Repository navigation
Let a source decline a start - #334
Merged
Merged
Conversation
1 task done
kahrendt
pushed a commit
that referenced
this pull request
Oct 28, 2026
<!-- Describe the change and why it is needed. --> `signal` was optional and only described line sensing, so a server could not offer automatic playback for sources without it and had to explain to users why the option was missing. Every source now reports `signal`. `present` means the source has input audio to offer, set from a user action like a button or a sharing toggle, from detecting audio on its input, or both. Only a source fed through an audio-only connection, like an analog line-in, should detect it from the audio, so a microphone never has to listen all the time. This removes the `line_sense` flag and with it the client's `source@v1_support` object. The server now reacts to changes of `signal`, so a turntable that keeps playing after the user stopped its stream does not restart it. The first `signal` after activation, or after the client becomes available again, counts as a change. ## Implementation guide A follow-up to the implementation guide will cover: - Suggested threshold, hold time and algorithm for detecting audio on a line-in - How each kind of source decides `signal` (Bluetooth receivers, desktop apps, HDMI and S/PDIF inputs, microphones) - How a momentary button maps to `signal`, and what the device shows while it waits for the server These stay out of the spec, since good values depend on the hardware, no compliance test can check them, and implementations should be able to improve on them without a spec change. ## Limitations - A server can't tell a source that can't detect audio apart from one with nothing playing, since both report `absent`. - `signal` can't stop the server from starting a source. Declining a `start` is handled separately in #334. ## Breaking changes - Clients: must always send `signal` in the source state, and must no longer send `source@v1_support` in `client/hello`. - Servers: must not require `source@v1_support` from clients. A server that still requires it won't activate the source role for updated clients. - Servers: should treat `signal` changes as start and stop hints, not the current value. - [x] I accept the [Contributor License Agreement](../blob/main/CONTRIBUTOR-LICENSE-AGREEMENT.md) for this contribution.
5 of 19 tasks
34 tasks done
1 of 9 tasks
maximmaxim345
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Nov 16, 2026
# What does this implement/fix? <!-- Quick description and explanation of changes. --> Source clients that follow the updated spec no longer send `source@v1_support`, but the server still required it. A strict server rejected them and a lenient one never activated their source role, so their `signal` never reached the application. The server now activates the role without it and reports every `signal` change through `SourceSignalChangedEvent`, including the first one after the client becomes available again. An older client's `source@v1_support` still parses, so its `line_sense` keeps working, but it's flagged as noncompliant, like a source state without `signal`. A strict server therefore rejects source clients built on older aiosendspin releases. A `client-stream/end` with no input stream open now counts as a declined start, so it no longer authorizes a later `client-stream/start`. **Related issue or spec PR (if applicable):** - Sendspin/spec#335 - Sendspin/spec#334 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the matching label, and the release notes use it to sort this change. --> - [x] Bugfix (non-breaking change which fixes an issue): `bugfix` - [ ] New feature (non-breaking change which adds functionality): `new-feature` - [ ] Enhancement to an existing feature: `enhancement` - [ ] Breaking change (changes the public API or the protocol in a way that is not backwards compatible): `breaking-change` - [ ] Refactor (no behavior change): `refactor` - [ ] Documentation only: `documentation` - [ ] Maintenance / chore: `maintenance` - [ ] CI / workflow change: `ci` - [ ] Dependencies bump: `dependencies`
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.
A source had no clear way to refuse a server's
start, for example when the user turned sharing off or muted a microphone. It could only skip opening the stream, which left the server waiting without an answer.A source may now decline by sending
client-stream/endwithout opening a stream, so no new message is needed. The server already waits forclient-stream/endbefore treating a stream as closed, so one that arrives with no stream open can only be a decline. The existing rule for astartthat crosses aclient-stream/endcovers a newerstartsent before the decline arrived.Limitations
start. The only way to block all starts isavailable: false, which takes the whole client offline. I think that's an ok compromise, since reportingsignal: absentalready keeps the server from starting it automatically, so only starts the user asks for need a decline.Breaking changes
Servers: must treat a
client-stream/endthat arrives with no open input stream as a decline. A server that treated it as an error could close the connection on an updated client.Clients: none, since declining is optional.
I accept the Contributor License Agreement for this contribution.