Skip to content

spotupnp: identify the started track when notifying cspot - #67

Open
007hacky007 wants to merge 1 commit into
philippe44:masterfrom
007hacky007:fix/spotupnp-stale-track-notification
Open

spotupnp: identify the started track when notifying cspot#67
007hacky007 wants to merge 1 commit into
philippe44:masterfrom
007hacky007:fix/spotupnp-stale-track-notification

Conversation

@007hacky007

Copy link
Copy Markdown
Contributor

Companion of philippe44/cspot#2, see there for the full analysis.

Short version: a "started by URL" notification from a streamer created before cspot's queue was rebuilt (it races the reload that follows a Load frame, e.g. a track change from a second Connect controller) advances the queue one entry early and it never resyncs: every song afterwards is restarted at its data-feed EOF, cutting off the 60-90 s still buffered in the renderer, until spotupnp is restarted.

Passes the started streamer's trackUnique to notifyAudioReachedPlayback() so cspot can reject stale and duplicate notifications; the flow-mode call site keeps the legacy empty-identifier behavior. Needs the cspot PR merged and the submodule bumped past it first - this does not build against the currently recorded cspot revision.

Verified against a Hama DIT2010: the desync reproduced reliably with rapid track changes from a second controller on 0.20.3; with both PRs the stale notifications are ignored and every track plays to its real end.

When the renderer reports that a new URL started playing, pass the
started streamer's trackUnique to notifyAudioReachedPlayback() so cspot
can reject stale notifications. Without this, a start notification from
a streamer created before the queue was rebuilt (it races the reload
that follows a spirc Load frame, e.g. a track change from a second
Connect controller) advances the queue one entry early and playback
never resyncs: every subsequent track is restarted at its data-feed EOF
and the audio still buffered in the renderer (tens of seconds) is cut
off, until the process is restarted.

Companion of the cspot-side fix; requires a cspot submodule bump that
includes it. The new cspot API keeps a default empty identifier, so the
flow-mode call site and other integrations are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant