abrasive/shairport — pull request #327 by gonewest818 (2014-05-13 13:55:29+00:00)
Title: proposed patch for bug #303

Proposing a fix for bug #303, where libao audio goes silent on raspberry pi after a day (or maybe longer) of idle time. This patch is admittedly incomplete, but I wanted your feedback on the approach before going any farther on it.

The idea is to close audio when shairport goes idle, and open audio when there is new music to play. To accomplish this I

+ added a command line flag
+ added a int (*reinit)(void) to the audio_output struct
+ in audio_ao **only** (for now) I implemented the reinit() function
+ in rtsp.c, added the logic to shutdown/restart audio after idle periods

I've been testing this as home for two weeks and it has resolved the bug for me. If you are ok with this direction then what remains is implementing similar init/deinit/reinit logic for the other audio drivers.