Closed mcurcio closed 3 years ago
Thanks for the post, and apologies for the delay in responding. So it looks like you network temporarily disconnects and then Shairport Sync can't clear the connection and cancel the play session so as to be able to start again.
Obviously, it would be great to find where Shairport Sync is hanging, presumably on some network connection somewhere, but in the meantime, it does have a last-ditch facility -- the run_this_if_an_unfixable_error_is_detected
hook. A program (such as a shell script) attached to this hook will run when that *warning: an unrecoverable error…
event occurs. You could use it to run a script to kill Shairport Sync and restart it. However, it's quite tricky. Most probably the program will require root
privilege, so you'd need to equip it with password-less sudo
privileges to be able to do the job.
@mikebrady can you please tell a bit more info of how to trap or hook this run_this_if_an_unfixable_error_is_detected
in a shell script? I found my shairport-sync was wedged and eating 100% cpu this morning too, not sure why. I had to kill it manually.
If Shairport Sync detects one of two conditions, it will execute the program you specify with the run_this_if_an_unfixable_error_is_detected
portion in the configuration file. The two conditions are (1) the output ALSA device stops accepting samples for a prolonged period and (2) a play session with no audio can not be terminated.
It doesn't detect any other conditions.
Thanks @mikebrady! I have two sort of follow up questions based on your notes:
run_this_if_an_unfixable_error_is_detected
would normally run? I am using launchd to control the process anyway, so the simplest solution for me would be something like shutdown_if_an_unfixable_error_is_detected
.*warning: an unrecoverable error…
printed after almost 17 hours of "stuck-ness". Is there a setting that might make that detected sooner?root
, then you might have to dot some sudo
magic on the script; otherwise it won't be allowed to kill Shairport Sync.This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.
I keep bumping into an issue where I can't connect to the server with the "Unable to connect to ..." message on my iPhone. I have tried every setting I can think of that would allow new connections to boot old connections, but that doesn't seem to help in this case. When it works, it definitely works. I only get in this wonky state when the streaming device disconnects from WiFi while connected to shairport.
Is there a setting that I am missing that will absolutely override any existing connections?
Mac 11.2 (via brew)
Version:
Logs:
Config: