Repository navigation
Replace a Sendspin next track that was already sent without a restart - #8083
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
@Bot-MArley review |
Bot-MArley
left a comment
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @maximmaxim345! This lets a Sendspin session swap the next track it already sent ahead by cutting the stream at that track's start with a timestamped stream/clear, instead of restarting playback, and bumps aiosendspin to 11.0.0 for it. The cut itself looks solid: the queued audio before the cut is kept, the fallbacks (crossfade already mixed, clients that can't cut, a stop during the cut) all go back to the old restart, and the tests cover each of them. One thing from the aiosendspin bump still needs a follow-up before this is ready.
Requested changes
- [PROBLEM] aiosendspin 11.0.0 drops
source@v1_support(and itsline_sensefeature) from the spec: compliant source clients now always reportsignal, and a hello that still sends it is flagged as non-compliant._supports_line_sensestill readsinfo.source_support, so every client on the new spec, and the demo Line-In Speaker now that it no longer sendssource_support, gets the "autostart unavailable" note instead of the line-in autostart setting. Please base it on the negotiated source role (or the reported signal) and update the Autostart section of the sendspin README with it.
This changes core code and requirements_all.txt, so it needs another maintainer's approval.
3b3bc12 to
54b674d
Compare
54b674d to
bc7671d
Compare
|
@Bot-MArley approve |
|
Note This comment was posted by Bot-MArley on behalf of the Music Assistant maintainers. @maximmaxim345 |
|
Note This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers. Thanks @maximmaxim345! This lets a Sendspin session swap a next track it already sent ahead with a timestamped
|
|
Note This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers. @maximmaxim345 Changes in this area must be tested on real hardware before they can be merged. Have you tested this on a real Sendspin device? If so, please say what you tested. If you have a Sendspin device, the Music Assistant DEV SERVER app is an easy way to try this PR with it: stop your Music Assistant app, install the DEV app, set its server_repo option to pr-8083 and start it (see its README). |
|
This is intentional. Tested with "Allow legacy clients" off on an ESPHome speaker with sendspin-cpp 0.10.0: "Play next" 8 s before the end of a track kept the rest of that track, then played the new one. Docs for the setting: |
|
Note This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers. Thanks @maximmaxim345, that context helps. If the cut only runs with "Allow legacy clients" off, where the spec expects players to keep the audio before I can't take a confirmed critical off the list from a reply, though, so that point stays open for you to decide in the review. Since a client that ignores the field goes silent in that mode, the setting's docs should say so. |
4c9be36 to
2ca002c
Compare
2ca002c to
ea08c3f
Compare
|
@Bot-MArley approve |
🔒 Dependency Security Report📦 Modified Dependencies
|
| Name | Skip Reason |
|---|---|
| aiolibdatachannel | Dependency not found on PyPI and could not be audited: aiolibdatachannel (2026.5.23.dev4+g950e7f0) |
| music-assistant-frontend | Dependency not found on PyPI and could not be audited: music-assistant-frontend (2.17.380) |
| torch | Dependency not found on PyPI and could not be audited: torch (2.13.0+cpu) |
| torchaudio | Dependency not found on PyPI and could not be audited: torchaudio (2.11.0+cpu) |
| yappi | Dependency not found on PyPI and could not be audited: yappi (1.7.7) |
✅ No known vulnerabilities found
|
Note This comment was posted by Bot-MArley on behalf of the Music Assistant maintainers. @maximmaxim345 Noted for ea08c3f: I'll approve it in a few minutes if my review of this commit is clean, and review it first if I haven't. Dependency changes and new providers still need a maintainer's approval. To have it merged, say |
Bot-MArley
left a comment
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @maximmaxim345! This rebase onto dev changes no code: all four commits match the ones reviewed at bc7671d. I went through the full diff again. The cut keeps the audio before the replaced item, and every fallback still goes back to the old restart: an item already faded into, a fade into a later item, clients that can't cut, and a stop during the cut. The line-in autostart now follows the negotiated source role. fade_pending only adds a read-only check to core, and the schema versions don't change. The one open point is the earlier one below, which needs a maintainer's decision.
Requested changes
- [CRITICAL] Still open from the earlier review:
playback.py:1258sends the timestampedstream/clearwithout knowing that every client honoursfrom_timestamp. This only happens with "Allow legacy clients" off, and a maintainer decides whether to accept it.
I can't approve this one yet: the open point above has to be settled first, and the aiosendspin bump in manifest.json and requirements_all.txt is a dependency change, which needs another maintainer's approval even on request.
…art (#1291) <!-- Thanks for contributing. The checklist below is short but the build enforces most of it, so ticking it off saves a round trip. Full guide: https://github.com/music-assistant/music-assistant.io/blob/beta/CONTRIBUTING.md --> ## What does this change? <!-- A sentence or two. Link the server pull request if there is one. --> Every Sendspin device with an audio input now reports whether a signal is present, so the Automatically play line-in on setting and the setup step that asks for it are offered for all of them. The note for devices without signal detection is gone. Server change: - music-assistant/server#8083 Requires #1283, which moves this text to the Sendspin page. ## Checklist - [x] Correct branch: `main` if this fixes something already on the live site, `beta` if it adds anything new - [ ] Any new page has a sidebar entry in `astro.config.mjs`, except music sources and player providers ### Only if you are adding a music source or a player provider <!-- Plugins, metadata providers and audio analysis providers do not need these. --> - [ ] File named after the source or provider, since the menu is sorted by filename - [ ] Icon added to `public/assets/icons/`, and it is visible against a white background - [ ] Entry added to `src/data/music-sources.ts` or `src/data/players.ts`, with categories --- Once this is open, scroll down to the checks and wait for **Deploy Preview**. If it is green, click the link to see your change on the site. If it is red, click `Details`, read the error at the bottom of the log and push a fix to the same branch. There is no need to open a new pull request.
ea08c3f to
e64c18c
Compare
Bot-MArley
left a comment
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @maximmaxim345! After the rebase onto dev, this PR lets a Sendspin session swap a next track it already sent ahead with a timestamped stream/clear, instead of restarting the current track. It falls back to the old restart when a crossfade into the old next track was already mixed or a client can't do the cut.
I went through the whole diff again and didn't find anything that needs to change before merge. The new tests run the real playback loop, and the earlier point about the dependency bump no longer applies, since the aiosendspin bump is now on dev.
One optional thing: a short comment at the clear_from call that it's only reached with "Allow legacy clients" off would help the next reader.
It changes core code in streams/audio.py and the Sendspin provider, so I don't approve it on my own. If you're a server admin, comment @Bot-MArley approve for this head and I will.
|
lab gate |
marcelveldt
left a comment
There was a problem hiding this comment.
LGTM, thanks @maximmaxim345!
What does this implement/fix?
When the queue changes the next track after Sendspin already sent part of it, playback no longer restarts. The server cuts its stream where the old next track starts, tells the clients to drop their audio from that point with a timestamped
stream/clear, and sends the new track from there. The spec names this case for the timestamped clear.When a crossfade into the old next track was already mixed, or a client in the group doesn't support the timestamped clear, playback restarts at the current position as before.
Core gets one small helper,
fade_pendingin the streams audio controller, so Sendspin can tell whether a crossfade into a later item was already mixed.A change shortly before the next track starts still leaves a short pause while the new track's first audio arrives (0.57 s in a test with a Tidal track).
Tested with
sendspin-cli1.0.1 (sendspin-cpp v0.10.0) by changing the next track during playback.Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.