-
-
Notifications
You must be signed in to change notification settings - Fork 579
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. |
This issue has been inactive for 28 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment. |
The issue seems to appear less frequently than it used to, but it's still there. I did some further investigating, but I couldn't find anything new unfortunately. It can be provoked by pressing the play/pause button repeatedly. The error message is sometimes |
I gave up and bought an AirPlay speaker instead, but someone should try the latest FreeBSD 14.1, which does list improved audio drivers. Who knows, something may have been shaken up to avoid the bug. |
Fair enough. As a matter of interest, did you think of using a Linux, by any chance? |
Yes, but this was a multipurpose machine that I wanted to use mostly as a NAS, so FreeBSD made sense (and still does). |
Thanks! |
I just installed FreeBSD 14.1 and it still happens. I listened to an entire album and shairport-sync crashed after each of the first three songs, then it worked for the rest. |
Thanks for the report. I do have a few ideas, if you'd be willing to try them out? I can push them into a new |
Sure! |
Thanks. I’ll post here when I’ve pushed the experimental update. |
Okay, so an update has just been pushed to the |
Thanks, I think that fixed it. I'm getting some errors saying I think this issue can be closed. |
Thanks for your information. In your tests, were you using AirPlay 2 or classic AirPlay? Those messages are informational — they don’t signify an error. |
I was using AirPlay 2 |
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: