Skip to content

Fix Sendspin playback stability issues#3382

Merged
MarvinSchenkel merged 7 commits intomusic-assistant:devfrom
maximmaxim345:fix/sendspin-playback-fixes
Mar 16, 2026
Merged

Fix Sendspin playback stability issues#3382
MarvinSchenkel merged 7 commits intomusic-assistant:devfrom
maximmaxim345:fix/sendspin-playback-fixes

Conversation

@maximmaxim345
Copy link
Member

@maximmaxim345 maximmaxim345 commented Mar 13, 2026

Several race conditions could cause Sendspin players to get stuck, immediately pause, or get out of sync, especially under rapid group membership changes and when DSP was enabled.

aiosendspin 4.3.4

Bumps aiosendspin to 4.3.4 which include these fixes:

  • Reconnection loop after connection takeover
  • Stale chunk log spam in the debug console after web player disconnects
  • Out of sync playback when DSP clients join or reconnect

Sendspin Provider fixes

  • Prevent duplicate join attempts when multiple group events fire at once
  • Cancel stale joins that no longer match the current group
  • Clean up resources when a join fails partway through
  • Stop the correct stream instance instead of tearing down the whole group
  • Flush audio pipelines on track end so DSP players don't get stuck in "playing" state

When the producer finishes in a sync group with DSP players,
ffmpeg transform processes still hold the last few samples in
their internal buffers. Without an explicit EOF signal,
`readexactly` in the commit task blocks forever waiting for
output that will never come, preventing cleanup and leaving the
player stuck in "playing" state.
Copilot AI review requested due to automatic review settings March 13, 2026 11:55
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

🔒 Dependency Security Report

📦 Modified Dependencies

music_assistant/providers/sendspin/manifest.json

Added:

Removed:

Unchanged dependencies
  • av ==16.1.0

The following dependencies were added or modified:

diff --git a/requirements_all.txt b/requirements_all.txt
index 7c2c8e86..edcf9614 100644
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -11,7 +11,7 @@ aiojellyfin==0.14.1
 aiomusiccast==0.15.0
 aiortc>=1.6.0
 aiorun==2025.1.1
-aiosendspin==4.3.3
+aiosendspin==4.3.4
 aioslimproto==3.1.7
 aiosonos==0.1.9
 aiosqlite==0.22.1

New/modified packages to review:

  • aiosendspin==4.3.4

🔍 Vulnerability Scan Results

No known vulnerabilities found
✅ No known vulnerabilities found


Automated Security Checks

  • Vulnerability Scan: Passed - No known vulnerabilities
  • Trusted Sources: All packages have verified source repositories
  • Typosquatting Check: No suspicious package names detected
  • License Compatibility: All licenses are OSI-approved and compatible
  • Supply Chain Risk: Passed - packages appear mature and maintained

Manual Review

Maintainer approval required:

  • I have reviewed the changes above and approve these dependency updates

To approve: Comment /approve-dependencies or manually add the dependencies-reviewed label.

@maximmaxim345 maximmaxim345 added the dependencies-reviewed Indication that any added or modified/updated dependencies on a PR have been reviewed label Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets Sendspin playback reliability by updating the Sendspin client library and hardening the provider’s group membership reconciliation + DSP playback pipeline to reduce race conditions during rapid group changes and end-of-track transitions.

Changes:

  • Bump aiosendspin to 4.3.4 (both global requirements and provider manifest).
  • Coalesce/abort duplicate membership reconciliation tasks in the Sendspin player event handlers.
  • Improve Sendspin playback session join/catchup lifecycle and ensure ffmpeg pipelines are flushed on EOF; stop only the active stream instance.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
requirements_all.txt Updates pinned aiosendspin version to 4.3.4.
music_assistant/providers/sendspin/manifest.json Updates provider requirements pin to aiosendspin==4.3.4.
music_assistant/providers/sendspin/player.py Coalesces group membership reconciliation via a debounced task.
music_assistant/providers/sendspin/playback.py Adds EOF flushing for ffmpeg processors, adjusts join/catchup lifecycle, and stops the correct stream instance.

@OzGav OzGav added this to the 2.8.0 milestone Mar 15, 2026
Copy link
Contributor

@MarvinSchenkel MarvinSchenkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @maximmaxim345

@MarvinSchenkel MarvinSchenkel merged commit cebcec4 into music-assistant:dev Mar 16, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix dependencies-reviewed Indication that any added or modified/updated dependencies on a PR have been reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants