Music assistant streaming stuttering sometimes #129

Open
opened 2026-11-21 11:02:20 +01:00 by SBDeveloper · 2 comments
Owner

Medley version

0.7.2

Platform

Linux (.deb)

Distribution or OS version

Ubuntu 26.04 LTS

Source or plugin involved

Music Assistant

What happened

Music sometimes stutters when streaming to a Sendspin device

Steps to reproduce

  1. Connect to MusicAssistant, following official steps.
  2. Start streaming
  3. Sometimes in the song it randomly stutters / buffers / hangs for a bit and then continues.

Logs

No response

### Medley version 0.7.2 ### Platform Linux (.deb) ### Distribution or OS version Ubuntu 26.04 LTS ### Source or plugin involved Music Assistant ### What happened Music sometimes stutters when streaming to a Sendspin device ### Steps to reproduce 1. Connect to MusicAssistant, following official steps. 2. Start streaming 3. Sometimes in the song it randomly stutters / buffers / hangs for a bit and then continues. ### Logs _No response_
Author
Owner

Triage: ready for agent, as an investigation (no fix before the cause is found)

Repro facts from the reporter:

  • Low-delay mode on (VBAN transport, ADR 0015), Deezer Tracks, Sendspin speaker on Wi-Fi.
  • The stutter is a hang or skip, not a clean silence gap.
  • It happens randomly, mostly within the first ~1:30 of a song, then plays smoothly to the end.
  • MA playing its own content on the same speaker is clean.
  • Unverified: whether the local Output stutters too.

Hypotheses, to confirm or rule out:

  1. Sender pacing. crates/core/src/vban.rs send() sends one 256-frame packet every ~5.8 ms with no lead. When it falls behind it sets next = now, so the lag of any stall over ~5.8 ms is lost for good instead of caught up. MA's VBAN receiver has a small jitter buffer, so a stall shows up as an underrun. stream_listener.rs (HTTP) has the same pattern at 23 ms.
  2. Load at Track start. The first ~90 s is when the streaming plugin fetches and decrypts in wasm, the decoder works, the offline cache fills and the UI fetches artwork and lyrics. That fits the timing, and it would starve the vban-send thread.
  3. Decoder shortfall. Player::render does not block: if the decoder lags it returns silence, which is then sent as-is.
  4. Network. UDP loss on the Medley→MA hop (ADR 0015 accepts loss as a glitch). The MA→speaker Wi-Fi hop is less likely, given MA's own content is clean.

Steps:

  • Add per-Track diagnostics (debug log): sender lateness (count and the worst lag dropped), render shortfall frames (silence rendered while playing), and the Track's fetch/decrypt progress over time.
  • Reproduce with low-delay mode on a Deezer Track. Compare with HTTP mode, with a local-file Track, and with the local Output.
  • Report which hypothesis holds, with numbers, before proposing a fix (e.g. bounded catch-up, a small lead, or a higher-priority sender thread).
## Triage: ready for agent, as an investigation (no fix before the cause is found) Repro facts from the reporter: - Low-delay mode **on** (VBAN transport, ADR 0015), Deezer Tracks, Sendspin speaker on Wi-Fi. - The stutter is a hang or skip, not a clean silence gap. - It happens randomly, mostly within the first ~1:30 of a song, then plays smoothly to the end. - MA playing its own content on the same speaker is clean. - Unverified: whether the local Output stutters too. Hypotheses, to confirm or rule out: 1. **Sender pacing.** `crates/core/src/vban.rs` `send()` sends one 256-frame packet every ~5.8 ms with no lead. When it falls behind it sets `next = now`, so the lag of any stall over ~5.8 ms is lost for good instead of caught up. MA's VBAN receiver has a small jitter buffer, so a stall shows up as an underrun. `stream_listener.rs` (HTTP) has the same pattern at 23 ms. 2. **Load at Track start.** The first ~90 s is when the streaming plugin fetches and decrypts in wasm, the decoder works, the offline cache fills and the UI fetches artwork and lyrics. That fits the timing, and it would starve the `vban-send` thread. 3. **Decoder shortfall.** `Player::render` does not block: if the decoder lags it returns silence, which is then sent as-is. 4. **Network.** UDP loss on the Medley→MA hop (ADR 0015 accepts loss as a glitch). The MA→speaker Wi-Fi hop is less likely, given MA's own content is clean. Steps: - Add per-Track diagnostics (debug log): sender lateness (count and the worst lag dropped), render shortfall frames (silence rendered while playing), and the Track's fetch/decrypt progress over time. - Reproduce with low-delay mode on a Deezer Track. Compare with HTTP mode, with a local-file Track, and with the local Output. - Report which hypothesis holds, with numbers, before proposing a fix (e.g. bounded catch-up, a small lead, or a higher-priority sender thread).
Author
Owner

Might be related to Deezer, after a few songs I do not see the stuttering. Investigate further with me.

Might be related to Deezer, after a few songs I do not see the stuttering. Investigate further with me.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SBDeveloper/medley#129
No description provided.