Repository navigation
Fix multi-server admission gaps and gate audio on playback - #315
Draft
maximmaxim345 wants to merge 8 commits into
Draft
maximmaxim345 wants to merge 8 commits into
maximmaxim345 wants to merge 8 commits into
Conversation
1 task done
6 of 12 tasks
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 a gap where a pairing connection held next to a playback connection could add
'playback'without arbitration, so two servers could play on one client.This keeps the current admission model and patches each gap in it with its own rule.
While a pairing connection is held next to a playback connection:
'playback'is arbitrated against the playback connection, the same way as when it drops'pairing'.'pairing'is also arbitrated against the held pairing connection.'playback'or adds'pairing'is arbitrated against the held pairing connection.'playback'now also gates the audio: theplayerandvisualizerstreams and the source role'sstart. Artwork, metadata and controller state don't need it, but a server still declares it while the client's group plays, so it can also take over a client that only shows metadata. The client also ignores the audio streams andstarton a connection without'playback', since with unpaired access a pairing connection can still hold these roles. Player commands are ignored the same way, but only while another connection has'playback'.Alternative that reworks admission around activities instead:
playback#314Closes #299
Breaking change
Clients that admit only one connection keep their admission behavior. Clients that hold a playback and a pairing connection now reject a new pairing connection while the playback connection is pairing itself, instead of holding both, and arbitrate the later activations listed above. That changes one outcome the old text defined. The alternative changes two more: a new playback connection is held next to a lone pairing connection, and a new pairing connection displaces the held pairing connection unless its attempt is in progress.
Servers must not start a
playerorvisualizerstream or send the sourcestartcommand without'playback', and must end theplayerandvisualizerstreams before dropping it. Clients ignore them without'playback', and a source client stops its input stream when'playback'is dropped. Player commands don't need'playback', so a server can still change the volume of a stopped speaker.Servers should declare
'playback'while the client's group plays or while they use its source, and drop it only once that ends, not at a track change or a move to another playing group.Limitations compared to the alternative
Later activations are only arbitrated in the cases the text names, so each new case needs its own rule.
A new playback connection still displaces a pairing connection that is held alone, or is rejected during its pairing attempt, instead of being held next to it.
Like the alternative, an idle connection is only admitted alone.
I accept the Contributor License Agreement for this contribution.