Page 1 of 1

mpd restart of shoutcast stream after network error

Posted: Fri Oct 11, 2013 12:57 pm
by mcfleeg
Okay, I'm using mpd and it has one playlist item - a URL to a shoutcast stream. Everything works great, but if a network error occurs or the shoutcast stream becomes unavailable, it just stops playing even when the network error clears and the stream is back up and running. You have to issue an mpc next command or mpc stop; mpc play to get the stream going again.

I've got a temp work around by using a cron job every 30 minuts to kick it with "mpc next" - and it works, but cause a 1/2 sec audio glitch when the network and stream are working fine...

In summary: how to continuously play a shoutcast stream, even after "prolonged" (i.e. >60secs or so) network or stream errors/outages???

Anyone have any ideas on this?

Thanks,
-Lee

Re: mpd restart of shoutcast stream after network error

Posted: Sat Oct 12, 2013 2:37 am
by gerben
Just add the same url, multiple times. If an error occurs, most of the time, mpd will go to the next item in the playlist. Just be sure you have enabled 'repeat' so it wraps around, at the end of the playlist.

In my own situation, if some error occurs, it will go to the next items I'd guess 75% of the time. So it's not foolproof, but it should be an improvement to your current situation.

Also. Why not have cron do a `mpc play` every minute.`mpc play` does nothing if it is already playing, so it won't break anything.

I think a combination of both methods will result in some pretty stable system.