New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem]: Crash when pausing: sndio: unable to flush
#1765
Comments
Thanks for the post. It looks like an error is coming back from the FreeBSD |
Hmm, if the error occurs, it must be considered serious: "Once an error occurs, all functions taking a So, modifying the flush code (as follows) so that is does nothing might be an interesting experiment. The code, in static void flush() {
// pthread_mutex_lock(&sndio_mutex);
pthread_cleanup_debug_mutex_lock(&sndio_mutex, 1000, 1);
if (!sio_stop(hdl) || !sio_start(hdl))
die("sndio: unable to flush");
written = played = 0;
// pthread_mutex_unlock(&sndio_mutex);
pthread_cleanup_pop(1); // unlock the mutex
} Replacing it with: static void flush() {
} Would make it do nothing. |
I just tried that, but it didn't work unfortunately. Now I get
I will try to investigate what's causing the error in |
I saw |
I can confirm that this happens to me on FreeBSD 14.0-RELEASE too, and also happens when changing tracks or fast-forwarding/backwarding (essentially any time the buffer is flushed, it seems). The problem disappears if I switch to AirPlay 1. |
Thanks @amandasystems -- this is interesting. The same audio backend is used for AirPlay 2 and AirPlay 1. However, I think AirPlay 2 starts and stops audio streams much more frequently than AirPlay 1, possibly giving rise to the circumstances that cause the |
Interesting! I’ll try to provoke it on AirPlay 1 too. |
Update: I tried my damnedest but I couldn't trigger it. |
Thanks for your efforts and for the update. I'll keep trying to figure out if something is happening inadvertently in Shairport Sync. |
My intuition says race condition of some kind, or possibly bad cleanup, but I have no familiarity with any of this so it's 100% gut feeling. |
What happened?
Hi,
I'm running shairport-sync 4.3.2 on Freebsd 13.
Often when pausing the audio, or when the next song starts, shairport-sync will crash and the error message
sndio: unable to flush
is written to the log. It doesn't happen every time, but it is reproducible by pressing play/pause repeatedly.Log verbosity is set to 2. I hope I captured all the relevant parts of the log.
Relevant log output
System Information.
Odroid H2
Configuration Information.
PulseAudio or PipeWire installed?
How did you install Shairport Sync?
A package manager (apt, apt install, yum, pkg, etc.)
Check previous issues
The text was updated successfully, but these errors were encountered: