On Tuesday 25 September 2012, WBHM Web Operations wrote:
> We have a need to have the ability to play an MP3 stream as a
> backup when we lose satellite signal.  We're using the
> latest RD v2.  

We use mplayer with a wrapper script.  It integrates (sort of) 
to rivendell with macro carts.

We use a similar approach, alternating between two "streams" 
directly or with cron jobs (not rivendell), as our primary and 
backup STL.

The wrapper script is a loop ...
========= play-stream script =======
#!/bin/bash
while (true); do
  mplayer $1
  sleep 1
done
exit 0
================
The loop provides a recovery mechanism to restart when the 
stream drops.  I have found that streams that originate on 
standard consumer internet connections tend to drop frequently.  
We use this for remotes (USB 3G stick), for outpost studios 
(usually on a DSL or cable modem), and for external streams.   
Simply using mplayer (or just about anything else) does not 
automatically recover from momentary drops.

The macro carts:
====== start =======
RN play-stream http://my.stream:8000/therealstream.mp3 !
LC red plays on computer other !
SP 86399999!
============

===== stop =====
RN killall -9 play-stream;killall -9 mplayer !
LC !
============

Another version plays for a known time then stops
====== timed 1 hour =======
RN play-stream http://my.stream:8000/therealstream.mp3 !
LC red plays on computer other !
SP 3600000 !
RN killall -9 play-stream;killall -9 mplayer !
LC !
==================

There are some obvious problems that I will fix someday, or hope 
that somebody else comes up with a fix or better way.

The "SP" line keeps it up in rdairplay, otherwise it would 
scroll to the next one (usually stop) which would play right 
away unless somebody changes the transition type to stop.

Some issues ..

Usually (but not always) it stays up in rdairplay after it is 
stopped.  This is cosmetic but throws people.'

It plays on the "other" sound card, not the rivendell one.  It 
plays on the sound card that mplayer (or anything else) would 
use if run outside rivendell.  Hence the message "plays on 
computer other".  I would rather it played the same place as 
other rivendell stuff.  I have configured other (better) sound 
cards to play both, but not this one.

"killall" would kill other instances too, if there are any.  I 
did this in a hurry.

It's not perfect, but it does seem to work.  If somebody else 
has a better way, let us know!

_______________________________________________
Rivendell-dev mailing list
[email protected]
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev

Reply via email to