To hear it live check the Live Streaming Index and see if I have it online at this time.
In this project I'll describe the steps I used to stream scanner audio to the internet without tieing up
a "real" computer. I will use the Raspberry Pi (a $35.00 Linux computer) and a USB Sound Card.
I will be streaming audio to an Icecast server which I run at home in order to stream Military Air Communictions
audio. In this article I will show you how you can stream to any Icecast server you have access too such
as the MilAir Comms Live Streaming System, LiveATC.net, and others.
However before the Raspberry Pi, I needed to use a "real" pc for each scanner I wanted to stream.
Now I don't have to dedicate a "real" pc to streaming, I can just use a $35.00 computer & sound card.
Another benifit of this project is that I will be showing you how to do this via a Wifi connection.
This means you can set your scanner / Raspberry Pi combination anywhere within reception distance
of your wireless router.
If you don't have any experience using the Raspberry Pi computer you first need to see my
article Raspberry Pi - Getting It Ready for Neat Scanner Projects. That
article will guide you through installing an operating system, setting up the networking, and getting
the Raspberry Pi computer and Dongle to talk to each other.
Picture of the Raspberry Pi Streaming Audio from a PRO-2052 Scanner via Wifi Connection.
Click on Picture for larger image
Picture of a Single Raspberry Pi Streaming Audio from 2 Sound Cards / 2 Scanners via Wifi Connection.
Click on Picture for larger image
Setting up a USB Sound Card on the Raspberry Pi
There are many cheap USB sound cards on the market today. What I used was the Sound Blaster X-Fi Go! Pro
While it is not the lowest cost USB sound card, it was what I could find locally. At the time I bought
mine (3/7/2014) it cost $30.99 at our local Best Buy store.
Before buying at Best Buy, see note at bottom of this page
. I did a search on Amazon and have seen
USB Sound Cards for just a few dollars. While I don't know if any USB sound card will work on the
Raspberry Pi, I do know that most will work without a problem from the what I've read.
Next we need to download, compile and install DarkIce. DarkIce is the software that will take
audio from your USB sound card and broadcast it to any Icecast Server. Darkice does not support
MP3 format, however we're going to build our Darkice install with MP3 support.
Download, Compile, Install, Configure, and Starting DarkIce
- 1) Add a deb-src repository to your sources list at /etc/apt/sources.list.
Type the follow command exactly (or you can just cut & paste from here):
sudo sh -c "echo 'deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi' >> /etc/apt/sources.list"
be sure you include the quote signs.
- 2) Next type this command: sudo apt-get update
- 3) Now to make is all work, we need to fulfill the build dependencies by installing some additional
packages. I strongly suggest that you cut and past this command into your PuTTY screen as its
long and 1 mistake will cause problems later down the road. Type this command:
sudo apt-get --no-install-recommends install build-essential devscripts autotools-dev fakeroot dpkg-dev debhelper autotools-dev dh-make quilt ccache libsamplerate0-dev libpulse-dev libaudio-dev lame libjack-jackd2-dev libasound2-dev libtwolame-dev libfaad-dev libflac-dev libmp4v2-dev libshout3-dev libmp3lame-dev
You will see that this operation will require 37.7 MB of additional disk space, it will ask you
if you want to continue. Hit "Y" to continue. This process does take a little will so relax..
- 4) Next we are going to create a working directory. Type mkdir src then go to the src directory
by typing cd src
- 5) Now its time to download the source code for the DarkIce package. To do so type the
following: apt-get source darkice When I last downloaded DarkIce I did receive a
warning saying it failed to verify signature on ./darkice_1.0-1.dsc. Just disregard this error.
- 6) Next we need to change the compile configuration to match the Raspbian OS environment.
Type the following: cd darkice-1.0/ then type sudo nano debian/rules
This will open the nano editor and you're going to see a short file. While in nano use
the CTRL-K key and delete each line in the file, just delete all the lines. Next
using copy & paste I want you to copy the following section DarkIce Compile Rules
DarkIce Compile Rules It is very important that the lines
start with "tabs" instead of spaces, this is why you'll want to copy & paste from the DarkIce Compile Rules
ln -s /usr/share/misc/config.guess .
ln -s /usr/share/misc/config.sub .
dh_auto_configure -- --prefix=/usr --sysconfdir=/usr/share/doc/darkice/examples --with-vorbis-prefix=/usr/lib/arm-linux-gnueabihf/ --with-jack-prefix=/usr/lib/arm-linux-gnueabihf/ --with-alsa-prefix=/usr/lib/arm-linux-gnueabihf/ --with-faac-prefix=/usr/lib/arm-linux-gnueabihf/ --with-aacplus-prefix=/usr/lib/arm-linux-gnueabihf/ --with-samplerate-prefix=/usr/lib/arm-linux-gnueabihf/ --with-lame-prefix=/usr/lib/arm-linux-gnueabihf/ CFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard'
- 7) Now paste the entire section into nano. It is very important that each line starts with a TAB,
not just a series of spaces. If there are spaces, you will receive an error during
the build process regarding rules file. To review, you've deleted everything out of the
old debian/rules file, cut and paste the text from above DarkIce Compile Rules link into the file.
Now we're going to want and save the new debian/rules file. To do this hit the CRTL-O key,
you'll be asked if you want to write debian/rules file. Hit the enter key. Then to exit the
nano editor hit CTRL-X
- 8) Next we need to change the version of the package to reflect mp3 support.
Simply type debchange -v 1.0-999~mp3+1. Besure you use that squiggly line in front of
mp3 instead of a dash. You'll see that nano opened up the file called debian/changelog.dch.
We don't need to write anything into it, just hit the CTRL-O, then hit ENTER, then CTRL-X and
you're done with the change log.
- 9) It is now time to build and install the DarkIce package. Type the following:
dpkg-buildpackage -rfakeroot -uc -b This process will take a few minutes. You will see
some warning messages, these are ok and nothing to worry about. Next type
sudo dpkg -i ../darkice_1.0-999~mp3_1_armhf.deb again, watch the squiggly line before mp3.
- 10) Now we need to edit the DarkIce configuration file (darkice.cfg) to set DarkIce up for streaming mp3 audio to
the IceCast server. To get to the directory where darkice.cfg is located type cd /etc
then type sudo nano darkice.cfg. DarkIce does contain a simple template file however
there is a lot of stuff in it that we don't need. It is just easier to start from scratch instead
of using their template. Once you have the blank file open you will want to cut and paste
the Darkice Configuration File from below into your nano window:
# darkice configuration file
duration = 0 # 0 means forever
bufferSecs = 5 # Internal buffer, 5 is good
reconnect = yes # reconnect if stream broken? default: yes
device = plughw:1,0 # Assuming USB is 2ed sound device
sampleRate = 22050 # 11025, 22050, or 44100
bitsPerSample = 16 # 8 or 16
channel = 1 # 1 for mono, 2 for stereo
# Next section describes a streaming connection to an IceCast server
# there may be up to 8 of these sections, named [icecast-0] ... [icecast-7]
# these can be mixed with [icecast2-x] and [shoutcast-x] sections
# Don't forget, the name [icecast2-0] needs to change to [icecast2-1]
# and 2 and 3 as you add more feed destinations.
bitrateMode = cbr # do not use vbr with icecast
format = mp3 # we are using mp3 format
bitrate = 16 # 16 for mono, 32 for stereo
quality = 0.2 # between >0 & <=1 1.0 being the highest quality
# .1-.2 is good for scanner feed and takes less
# bandwidth than higher settings
channel = 1 # mixes input down to a mono output for the feed.
lowpass = 5000 # lowpass cuts off freqs above the specified value
# such as hiss. Might inhibit paging tones also.
sampleRate = 22050 # 22050 is the best for scanner feeds
############# From your "Feed Technical Details":
server = 188.8.131.52 # use the name or ip address of the icecast server
port = 8000 # Usually 8000
password = passwrd # ENTER your password
mountPoint = 123456789 # ENTER your mountpoint without leading "/"
name = Anytown MilAirComms Feed # ENTER name of your feed
#### use "man darkice.cfg" for more information about this file.
- 11) Using the arrow keys move to the top of the page. Find the line that says "device".
Make sure it says "device = plughw:1,0". This assumes you only have 1 sound card plugged
into your Raspberry and it occupies slot #1. If you remember earlier we typed the command
arecord -l which returned text stating our sound card was "card 1: Pro
[Sound Blaster X-Fi Go! Pro], device 0: USB Audio [USB Audio]". Next move down the file
until you find the line that says "server =" In my example I have it set to 184.108.40.206,
you'll want to change this to the IP address (or URL) of the Icecast server you want to stream
audio to. You will want to set this to your internal IP address which
probably starts 198.162.1.xxx If you use your WAN IP address you
could suffer with problems such drop outs, lower internet speeds and others.
The next line says "port = 8000" this is default for most Icecast servers.
If the server you want to stream audio to uses a different port number change 8000 to the
correct port number. The next line is the password needed for the Icecast server you
want to stream to. The next line is mountPoint. Change the number to the mountpoint name
for the Icecast server you want to stream to. The next line that says "name".
This is a short name for your feed should go here. While the Icecast server will display the
name, depending on what website is linking to your feed, that name may or may not show up on
the website itself. In the case of the MilAirComms.com/live_streaming_index.html the Feed name
is taken from the info you filled out when creating the feed on the MilAirComms.com website
and not from the darkice.cfg file. Now we want to save the darkice.cfg file by hitting CTRL-O,
the ENTER key, then CTRL-X.
- 12) Some people have had trouble with getting Data Overrun warning while running darkice.
I did as well, but here are 2 steps that greatly reduce Data Overrun warnings for me.
First run wicd-curses by typing sudo wicd-curses, hit "P" and remove "eth0" from the
wired network field. Hit F-10 then exit. Next when you run DarkIce, do it as a superuser,
this will give higher priority to the DarkIce task. In order to run DarkIce as a
superuser type sudo darkice -c /etc/darkice.cfg.
Now that you've typed sudo darkice -c /etc/darkice.cfg and if you didn't receive any errors you
are now streaming live audio from your scanner to the Icecast server you put in the darkice.cfg file.
You should now go to the Icecast server and see if you hear your audio!
I am trying to stream the Raspberry / DarkIce audio to a Windows PC where I
have Icecast Server running. My Icecast server has been performing perfectly
while streaming from some other PC's so I don't think its my Windows PC/Icecast
Server causing problems.
When I start DarkIce on the Raspberry all seems ok until someone connects to
the DarkIce stream, at that time it seems like my internet speed get super slow,
in fact my other PC's streaming to Icecast will time-out and disconnect. Also,
I will start getting Data Overruns from DarkIce.
After much hair pulling I finally discovered the problem. I had DarkIce's configuration file
(/etc/darkice.cfg) set to connect to my Icecast server via the WAN IP Address (ip address assigned
to you by your ISP). This created a "loop-back" problem which slowed my internet speed by 75% or more.
After changing DarkIce to connect to my Icecast server via my internal IP address. After doing this
the above problem was solved. Your internal
IP address probably will be something like 192.168.1.xxx.
I said in my the orginal article that I purchased the Sound Blaster Pro USB sound card
at a local Best Buy store. 5 days after buying my first, I went to the same Best Buy
store to puchase another. The first one was $30.99, 5 days later the price jumped over 20% to $37.99.
Needless to say I did not buy. I stopped at a local computer store and purchased a
StarTech.com model ICUSBAUDIO7 for $27.99. It appears to be working just as well as the Sound Blaster.
After having my new USB Sound Card for a day I've been able to compare the StarTech.com ICUSBAUD ($27.99)
and the Sound Blaster Pro X-Fi Go! Pro (now $37.99). The StarTech.com card is providing
considerably better audio and doesn't appear to be as "touchy" when it comes to adjusting
the volumn/audio levels. The Sound Blaster has very "hot" audio and as a result you're getting
"hot" background/static/noise amplified with the good audio. The cheapier card wins this round!
Update 3/13/2014 Using 1 Raspberry to stream 2 different Scanners
Today I finally had success in plugging 2 USB sound cards into my Raspberry Pi Computer
and stream 2 different scanners via 1 Raspberry. It is fairly easy to do, here you go:
- 1) Using a powered USB Hub plug both soundcards in and power up your Raspberry Pi.
You will want to use a powered USB Hub because the Raspberry Pi might not be able to
supply enough current to run all your USB devices.
- 2) Start a PuTTY session, login to your Raspberry and type the following command
arecord -l In my case the returned looked like this:
**** List of CAPTURE Hardware Devices ****
card 0: Pro [Sound Blaster X-Fi Go! Pro], device 0: USB Audio [USB Audio]
Subdevice #0: subdevice #0
card 1: Device [Generic USB Audio Device], device 0: USB Audio [USB Audio]
Subdevice #0: subdevice #0
Note you'll see 2 sound cards, card 0: and card 1:
- 3) Next we're going to copy your current DarkIce configuration file to a new file, actually
2 new files, 1 for each card. Type cd /etc this will put you in the directory
where the configuration file is located. Now type sudo cp darkice.cfg darkice_0.cfg
then type sudo cp darkice.cfg darkice_1.cfg. We have now made a configuration file
for "card 0:" and "card 1:".
- 4) Next we need to edit each configuration file to make sure it is using the correct USB sound
card. Type sudo nano darkice_0.cfg and go to the line that says "device = plughw:1,0 # OSS DSP soundcard device for the audio input".
"plughw:" is what we are interested in. For card 0 it should say plughw:0,0 and for card
1 it should say plughw:1,0. Once you have this config. file setup for the correct card you
will want to scroll down to where you enter server, port, password and mount point. Set these
in order to tell DarkIce which Icecast server it should send this cards audio to. When done save
and exit, then do the same for darkice_1.cfg (sudo nano darkice_1.cfg).
- 5) Now lets see if what we did actually worked. To start up the darkice session using "card 0"
type sudo darkice -c /etc/darkice_0.cfg make sure you can hear your audio and adjust
audio settings as needed. You can open up a second PuTTY session, log in and make audio setting
adustments while darkice is streaming if you wish. Just remember there could be a minute delay
between when you make an adjustment and until you hear it on via the streaming audio.
- 6) Now in one of your other PuTTY sessions we're going to start darkice to stream the
audio of your second sound card. Type sudo darkice -c /etc/darkice_1.cfg. Again
listen to the audio, actually you should now listen to both streams. If the audio from
your streams no longer sounds good such as broken audio, hi-pitched, or garbled. You will
need to make a speed adjustment to your USB ports. To do this type sudo nano /boot/cmdline.txt
You will only see 1 line of text starting with "dwc_otg.lpm_enable=0" After "dwc_otg.lpm_enable=0"
you are going to enter the follow text "dwc_otg.speed=1" besure to include a space after "...enable=0"
and before "console=tty..." Now reboot your Raspberry Pi and everything should work....
I hope you've enjoyed this article.