Clear Across Kansas

Broadcastify Your Allstar Node

Streaming Your Allstar Node to Broadcastify

Prerequisites:

  • A working Allstar node running the latest HamVoIP release on a Raspberry Pi 2 or 3.
  • You have applied and have been granted a feed at Broadcastify.com.

Note: This method is only for streaming your node’s audio (transmit and receive) to Broadcastify. This is NOT for using the Pi to broadcast another audio source.

Before beginning be sure to backup your Allstar installation (or clone the entire SD card) so you can easily restore your node if you screw it up.

Software Requirements

You will need the following packages installed to proceed:

  • libshout
  • libxml2
  • taglib
  • lame ( should already be installed, but do it again anyway)
  • pkg-config

At the linux shell prompt type (one at a time):
pacman -Sy libshout
pacman -Sy libxml2
pacman -Sy taglib
pacman -Sy lame
pacman -Sy pkg-config

Once these packages are installed you will need to download the ‘ezstream’ package.

wget http://downloads.xiph.org/releases/ezstream/ezstream-0.6.0.tar.gz
then:
tar xvzf ezstream-0.6.0.tar.gz
Then change to the directory created and follow the install instructions.

cd /root/ezstream-0.6.0
./configure
make
make install

Software Setup

Create (preferably using WinSCP) the file /etc/ezstream.xml and copy and paste the following text:

<ezstream>
<url>http://audio#.broadcastify.com:80/#######</url>
<sourcepassword>######</sourcepassword>
<format>MP3</format>
<filename>stdin</filename>
<svrinfoname>#########</svrinfoname>
<svrinfourl>http://www.radioreference.com/</svrinfourl>
<svrinfogenre>Amateur Radio</svrinfogenre>
<svrinfodescription>#############</svrinfodescription>
<svrinfobitrate>16</svrinfobitrate>
<svrinfochannels>1</svrinfochannels>
<svrinfosamplerate>22050</svrinfosamplerate>
<svrinfopublic>1</svrinfopublic>
</ezstream>

Then edit the ####### entries above with your audio server URL, mountpoint, password, feed name and description as defined by the Technicals tab in your Broadcastify account. Make sure there is a line feed after the </ezstream> at the end.

Next, edit your /etc/asterisk/rpt.conf file and add the following line within the node stanza of the node you wish to broadcast. Note: This must be all on a single line:

outstreamcmd=/bin/sh,-c,/usr/bin/lame --preset cbr 16 -r -m m -s 8 - - 2> /tmp/stream.status | /usr/local/bin/ezstream -qvc /etc/ezstream.xml

Restart Asterisk and the feed should go live. At the shell prompt you can run ps ax to check the running processes.

Sometimes the Ezstream process dies and causes the CPU usage to skyrocket. To restart Ezstream do kill -9 `pidof ezstream`

Here is the script which looks at ezstream cpu time and kills the process as a background job –
# !/bin/bash
# Check CPU usage of ezstream - normally should be 0
# If it fails kill the process
#
# WA3DSP - 10/2015
ezstreampid=`pidof ezstream`
if [ -z "$ezstreampid" ]
then
echo "EZstream not running"
exit
fi
#ezstreamcpu=`ps -p $ezstreampid -o %cpu | sed -n '2p'`
ezstreamcpu=`ps -p $ezstreampid -o time= | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }'`
ezstreamstat=`echo "60>$ezstreamcpu" | bc`
if [ "$ezstreamstat" -eq "1" ]
then
echo "Ezstream OK"
else
echo "Ezstream fail"
kill -9 $ezstreampid
echo "`date` - Ezstream restarted" >> /tmp/ezstream.status
fi
# End of script

Original writeup by WA3DSP, updated by Justin Reed, NV8Q on 2/24/2017.

Recent Posts