[RDD] transmitter / silence / fallback

Wayne Merricks waynemerricks at thevoiceasia.com
Wed Jan 28 12:25:15 EST 2015


The Pastebin is set up to take input from a usb capture card on a full 
blown ubuntu 12.04 server edition.  On the Pi you could do the same 
thing however all I do instead is take an icecast feed into liquidsoap 
using the input.http command.

I also don't need JACK etc because liquidsoap can directly access ALSA.  
So you end up with a quite simple liquidsoap config:

#specify the icecast stream as an input
stream = input.http("http://icecastip/icecastmount")

#specify the fail over file (could change this to be a template or 
directory of files)
failover = mksafe(single("/var/audio/emergency/song.mp3"))

#Enable the silence detect to kick in after 5 seconds
stream = strip_blank(stream, length=5.0)

#Specify what to switch to when silence is detected
stream = fallback(track_sensitive=false, [stream, failover])

# (Optional) Compress the icecast stream
stream = compress(ratio=3.0, attack=38.0, release=85.0, threshold=-20.0, 
knee=0.5, gain=8.0, stream)

# (Optional) limit the ice cast stream
stream = limit(ratio=3.0, attack=38.0, release=85.0, 
threshold=-3.0,knee=0.5, stream)

# Output to ALSA (the pi's audio)

All you need to do is save that as a file (conventionally blah.liq).  
Then run liquidsoap -c blah.liq on startup and away it goes pretty much 

On ubuntu with things like upstart you can specify what happens if 
things crash which is handy but on the pi you'd have to do other 
watchdog type stuff to achieve the same result.

*NB: *I haven't tested this config it was written mostly via copy paste 
and checking the API reference for liquidsoap (I don't have access to 
the pi at the moment)

API Reference is here: http://savonet.sourceforge.net/doc-svn/reference.html

Theres also a lot of examples on that site for doing all sorts of crazy 
stuff with liquidsoap.

Wayne Merricks The Voice AsiaOn 28/01/15 17:04, drew Roberts wrote:
> Hey Wayne,
> if I am reading you and those scripts right on first glance, the 
> scripts are checking for silence on a local rivendell playout and you 
> have modified them to pull down a remote stream and that is running on 
> a Pi.
> If I have that right, what is the player in use on the Pi?
> Or are you using icecast to relay the remote stream locally and doing 
> some failover to a different mount locally?
> all the best,
> drew
> On Wed, Jan 28, 2015 at 11:36 AM, Wayne Merricks 
> <waynemerricks at thevoiceasia.com 
> <mailto:waynemerricks at thevoiceasia.com>> wrote:
>     I do that at work using liquidsoap on a pi.
>     I adapted my Ubuntu instructions found here:
>     http://pastebin.com/u/mezzfa0
>     Wayne Merricks
>     The Voice Asia
>     On 28/01/15 16:05, drew Roberts wrote:
>>     I think I have seen discussions around these topics in the past.
>>     I am hoping someone is up to date on these skills so that I don't
>>     have to spend further hours or days trying to get this to work
>>     smoothly.
>>     What I want to do:
>>     config a small box (I hope to use a Raspberry Pi but will scale
>>     up until I find one with the needed power to serve in this
>>     capacity) such that when it is plugged into a network and
>>     amp/speakers somewhere it will connect to an icecast stream
>>     automatically and play it out of the speakers.
>>     It will detect silence in the stream (including the stream going
>>     down) and switch to playing (a playlist of) locally stored files.
>>     It will detect when the stream audio comes back and cut out the
>>     local audio and go back to stream audio.
>>     All headless and automatic.
>>     I am trying to get this system going now on a laptop with a bit
>>     more power than the Pi.
>>     I am trying to use:
>>     jack
>>     silentjack (to detect the silence)
>>     jack_connect (to change the jack routing on setup and on command
>>     from silentjack)
>>     audio players:
>>     mplayer (or its frontends)
>>     vlc
>>     others?
>>     Does this sound like a reasonable set of components for this job?
>>     Has anyone done something similar? Are there any good docs in
>>     this space?
>>     Problems I think I need to solve:
>>     A way to "statically name" the main stream player so that I can
>>     refer to it in scripts.
>>     I may not have to statically name the backup player but it would
>>     probably be nice.
>>     So far, I am not seeing how to do that with mplayer or vlc, the
>>     names seem to be tied to the pid.
>>     Is there a better way to go about this?
>>     If it hasn't already been done, I will write this all up when I
>>     am done.
>>     all the best,
>>     drew
>>     -- 
>>     http://nakedghosts.blogspot.com/
>>     _______________________________________________
>>     Rivendell-dev mailing list
>>     Rivendell-dev at lists.rivendellaudio.org  <mailto:Rivendell-dev at lists.rivendellaudio.org>
>>     http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>     _______________________________________________
>     Rivendell-dev mailing list
>     Rivendell-dev at lists.rivendellaudio.org
>     <mailto:Rivendell-dev at lists.rivendellaudio.org>
>     http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
> -- 
> http://nakedghosts.blogspot.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://caspian.paravelsystems.com/pipermail/rivendell-dev/attachments/20150128/0907bb2c/attachment-0001.html>

More information about the Rivendell-dev mailing list