Skip to content

fix(audio_key): retry on timeout and fail track cleanly on key error - #1748

Open
stiefenm wants to merge 1 commit into
librespot-org:devfrom
stiefenm:fix/audio-key-retry-v2
Open

fix(audio_key): retry on timeout and fail track cleanly on key error#1748
stiefenm wants to merge 1 commit into
librespot-org:devfrom
stiefenm:fix/audio-key-retry-v2

Conversation

@stiefenm

Copy link
Copy Markdown

Summary

Rebased version of #1743 (source branch was accidentally deleted).

  • Audio key retry: Requests now retry up to 2 times on timeout before giving up, improving resilience after access-point reconnects
  • Clean track failure: Audio key transport failures (timeout, channel error) now fail the track cleanly instead of continuing without decryption, which always failed downstream and dropped the session

Context

After an access-point reconnect, the first audio key request often times out (1.5s default). Without retry, this fails the track. With the AP connection already restored, a retry succeeds immediately.

The second change stops the player from attempting to play encrypted audio without a decryption key — the old "try without decryption" fallback was never useful for encrypted files and produced broken audio or a dropped session.

Changes

  • core/src/audio_key.rs: Wrap request() in retry loop (up to 2 retries on timeout), clean up pending entry on timeout
  • playback/src/player.rs: Distinguish ErrorKind::Unavailable (unencrypted file, continue) from other errors (fail track)
  • CHANGELOG.md: Document both fixes

Audio key requests now retry up to 2 times on timeout before giving up,
improving resilience after access-point reconnects.

Audio key transport failures (timeout, channel error) now fail the track
cleanly instead of continuing without decryption, which always failed
downstream and dropped the session.

Rebased from librespot-org#1743 onto current dev HEAD.
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