mpd restart of shoutcast stream after network error

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
mcfleeg
Posts: 1
Joined: Fri Oct 11, 2013 12:50 pm

mpd restart of shoutcast stream after network error

Post 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
User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: mpd restart of shoutcast stream after network error

Post 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.
Post Reply