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
Allow a single client to expose multiple instances of a role #151
For context on this, I'm currently looking at using Sendspin to provide multi-in, multi-out mixing of audio on my home network. The idea is that something like my laptop can expose several Sendspin Sources such as System Audio, Music, Voice Chat and a device on the network exposes several Sendspin Players such as Speakers, Headphones, Kitchen HomePod. I'd then have a server in the middle which routes Sources into Mixes, and Mixes to Players.
I think the official answer currently would be that for the Sources I should run a client for each one, and for the Players the server should be responsible for combining everything I want that player to play, this is a bit awkward for a couple of reasons though. On the Source side I have to have a fully paired client for each input because the protocol only allows paired clients for that role, that means doing the pairing dance for several clients per device, which is just a bit unpleasant.
On the Player side I'd really like to avoid doing mixing for each player on the server. If I can expose multiple players from a client then each can simply be assigned to the correct mix group by the server, and volume level for each player can be used to define the individual level for each mix/player pair. It also means that if delay can be handled for each mix to get the best balance between audio sync and latency - as an example here I'm reasonably happy to have some latency on the music being streamed to both my desk speakers and HomePods around the house. I want minimal latency on the stream from my microphone which may be getting fed into both a virtual sound card on my laptop to go into a video call while also being fed into my headphones alongside the music stream so I can hear what I'm saying.
I'm happy to put some work into sketching out how this might work at a protocol level but first wanted to get a sense of whether its a direction you'd be willing to go in, or whether I've missed something fundamental which means none of this is actually an issue and there's a better way which already exists.
Multiple instances of a role clashes with too many other parts of the spec, so it's out of scope.
I think you've partly missed something on the player side though. One client identity per player already gets you what you're describing: each is its own client, so it gets its own group, its own volume, and its own required_lead_time_ms and min_buffer_ms. The server isn't mixing per player, it's doing one mix per group and each player sits in its group. Your "some latency on the music, minimal on the mic path" split works today. Players also don't need pairing at all, source@v1 is the only pairing-required role as of now.
Your headphones case works too, just mix it locally. Nothing stops your laptop summing two of its own player identities into one output, and it lines up cleanly because both streams carry absolute server timestamps and both time filters run off the same host clock. Each identity keeps its own volume, so that's your per-mix level control right there.
Your user friction point about pairing is valid though. I opened #157 to track it separately.
More context on why instancing is out of scope (at least for now):
Every client is in exactly one group, and the player role is that group's audio stream. Two player outputs on one client would both just play the same stream. Getting them onto different mixes means groups stop being sets of clients and become sets of outputs, which pulls in group/update, controller volume and mute derivation, the switch cycle, and available: false handling.
Binary message types are allocated per role, 4 each for player and source. Player only uses type 4 today and source only type 12, so you could spend the spare slots on instances, but that's a hard cap of 4 and it leaves player@v2 with no room for new binary messages ever, since role versions share IDs. Widening isn't an option either, expanded allocations are 8-aligned so player would need 0-7 (hits the JSON body and fragmentation) and source 8-15 (hits artwork).
Activity
maximmaxim345 commentedon Aug 20, 2026
Multiple instances of a role clashes with too many other parts of the spec, so it's out of scope.
I think you've partly missed something on the player side though. One client identity per player already gets you what you're describing: each is its own client, so it gets its own group, its own volume, and its own
required_lead_time_msandmin_buffer_ms. The server isn't mixing per player, it's doing one mix per group and each player sits in its group. Your "some latency on the music, minimal on the mic path" split works today. Players also don't need pairing at all,source@v1is the only pairing-required role as of now.Your headphones case works too, just mix it locally. Nothing stops your laptop summing two of its own player identities into one output, and it lines up cleanly because both streams carry absolute server timestamps and both time filters run off the same host clock. Each identity keeps its own volume, so that's your per-mix level control right there.
Your user friction point about pairing is valid though. I opened #157 to track it separately.
More context on why instancing is out of scope (at least for now):
group/update, controller volume and mute derivation, the switch cycle, andavailable: falsehandling.player@v2with no room for new binary messages ever, since role versions share IDs. Widening isn't an option either, expanded allocations are 8-aligned so player would need 0-7 (hits the JSON body and fragmentation) and source 8-15 (hits artwork).