Update Sendspin provider to version 4.0 with many improvements#3158
Update Sendspin provider to version 4.0 with many improvements#3158marcelveldt merged 13 commits intodevfrom
Conversation
🔒 Dependency Security Report📦 Modified Dependencies
|
Fix here Sendspin/sendspin-cli#117 |
Alsmost works now, but cleanup and some major bug fixes are left to iron out. (with DSP clients)
Remove defensive timeout wrappers (`_await_with_timeout`, `_timed_lock`) in favor of plain awaits, parallelize member transform reads with `asyncio.gather`, and add architecture and join-catchup lifecycle documentation.
The 50ms timeout cancelled the drain but data was already in the pipe buffer, producing misleading warnings while playback worked fine. Backpressure is handled by `sleep_to_limit_buffer`.
Split the join-catchup history blob into 100ms slices before calling `prepare_historical_audio`, preventing a single large encode from blocking the event loop for ~500ms.
There was a problem hiding this comment.
Pull request overview
This PR updates the Sendspin provider from version 3.0.0 to 4.0.1, implementing a major architectural rewrite of the playback system. The update replaces the simple TimedClientStream approach with a sophisticated SendspinPlaybackSession coordinator that supports per-member DSP pipelines, dynamic group membership changes, and late-join historical backfill.
Changes:
- Updates aiosendspin dependency from 3.0.0 to 4.0.1
- Removes
timed_client_stream.pyand replaces it with newplayback.pymodule implementing advanced playback pipeline architecture - Refactors player.py to use role-based architecture for metadata, artwork, and controller functions, with dynamic audio format configuration
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements_all.txt | Updates aiosendspin from 3.0.0 to 4.0.1 |
| manifest.json | Updates aiosendspin requirement to 4.0.1 |
| provider.py | Adds AlreadyRegisteredError handling and fixes unload disconnection logic to check for connection availability |
| player.py | Major refactor to role-based architecture, removes MusicAssistantMediaStream class, integrates SendspinPlaybackSession, adds dynamic audio format configuration |
| playback.py | New 1141-line module implementing sophisticated playback session coordinator with per-member DSP pipelines, join-catchup mechanism, and history management |
| timed_client_stream.py | Removed (331 lines) - replaced by playback.py architecture |
| init.py | Changes import from relative to absolute path |
| README.md | Updates file reference from timed_client_stream.py to playback.py |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@maximmaxim345 can you have a look at CoPilot's suggestions ? Some of them make good sense to fix before merging. |
|
Marked as draft while you work out these final fixes - hit the "ready for review" button once you are ready |
marcelveldt
left a comment
There was a problem hiding this comment.
Amazing job again @maximmaxim345 !
A major rewrite of the Sendspin Server with a lot of changes and improvements.
There is a large possibility that new bugs were added in this update, please test and report any issues you encounter.
There are a couple of know issues with this version, those will be addressed in future PRs:
sendspin-clisometimes doesn't show metadata, this is a bug in the cliThe biggest user-facing improvements are:
buffer_capacity)In addition to that, this also includes a lot of under the hood changes for future features and improvements:
Example
aiosendspinto display custom bridges as native Sendspin players while powered off (for the Chromecast and AirPlay Sendspin bridges)Example
For more information, read the PR in the
aiosendspinrepository:aiosendspinSendspin/aiosendspin#142