Skip to content

Conversation

brain0
Copy link
Contributor

@brain0 brain0 commented Dec 18, 2017

When using librespot with pulseaudio over TCP, connection failures always lead to panics. This patchset introduces proper error handling in the pulseaudio backend and ensures that no undefined behaviour occurs in the FFI calls to pulseaudio. It also introduces proper error handling in the player thread: When the player fails to open or write audio, instead of panicking, it tries to reconnect to the sink every 5 seconds until it succeeds or playback is stopped.

With this patchset, librespot has been very reliable when running with pulseaudio and setting PULSE_SERVER to a remote host, even when the remote host goes down and comes up again.

Failing to open or write to the audio sink is not necessarily a fatal and permanent error.
When the audio sink fails, the player now tries to restart the sink periodically.
@ComlOnline ComlOnline self-assigned this Dec 19, 2017
@ComlOnline
Copy link
Contributor

Thanks for the PR, I'll have a look at it tonight.

@ComlOnline ComlOnline merged commit 5302bd1 into librespot-org:master Dec 19, 2017
@ComlOnline
Copy link
Contributor

Thank you for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants