03/01/21 16:36:58 UTC
276.500 MHz
Mid air re-fueling training
02/26/21 18:37:21 UTC
238.900 MHz
(Corrected) R135 COBRA55 (62-4129) transiting southern WI
02/26/21 18:35:29 UTC
238.900 MHz
KC135 COBRA55 (62-4129) transiting southwest WI
02/25/21 20:20:31 UTC
252.100 MHz
MASH82 20 min out looking for parking with one writeup
02/25/21 18:52:01 UTC
319.175 MHz
air/air chat and heading for the tanker KC135 just left Grissom on flightradar

02/14/21 02:49:06 UTC
132.550 MHz
02/12/21 07:43:49 UTC
121.500 MHz
02/12/21 07:41:41 UTC
123.300 MHz
02/12/21 07:40:05 UTC
252.100 MHz
02/12/21 07:38:31 UTC
281.025 MHz
02/12/21 07:31:27 UTC
243.000 MHz
02/12/21 07:29:55 UTC
123.550 MHz

Military Air & Space Communications Facebook Group
Facebook Group: Military Air & Space Communications.
2700+ members, logs, how too's & more. Please click the link and join.

Streaming Your Scanner Audio Using a $35 Raspberry Pi Computer

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.

  • 1) Power down your Raspberry Pi comptuer.
  • 2) Plug your sound card into the Raspberry Pi's USB port.
  • 3) Power up your Raspberry Pi and give it a few minutes to boot.
  • 4) Use PuTTY to log into your Raspberry.
  • 5) To see if your Raspberry is seeing your sound card type arecord -l If the Raspberry is seeing the sound card you should see something simular on your screen:

    **** List of CAPTURE Hardware Devices ****
    card 1: Pro [Sound Blaster X-Fi Go! Pro], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    If you are using a different sound card then the Sound Blaster, the name on your screen will be different.
  • 6) Next to verify the sound card is functioning I connected headphones to the Raspberry Pi's audio jack. This is the 3.5mm jack closest to the LED's. I then took the scanner audio and feed the audio into the "Mic" jack of the sound card. Next make sure you're in your home directory, to do this type cd then type pwd and you should see "/home/pi".
  • 7) Tune your scanner to a frequency where there is always audio, I suggest using an active NOAA weather radio frequency for your area.
  • 8) Now type arecord -D plughw:1,0 temp.wav This will take the scanner audio coming into the sound card and save it to a file called temp.wav. Don't worry that we are saving the audio as a .wav file and not an .mp3 file. We will fix that later when we install Darkice, the software that does the actual streaming. After allowing arecord to run a few seconds then hit CTRL C to stop the recording process. To listen to the recorded audio type aplay temp.wav. You should hear the audio coming out of your headphones.
  • 9) Here is where setting audio levels can get tricky. Audio level settings are going to depend on if you're using "speaker-out" audio from your scanner, or "line-out" audio from your scanner. When possible I usually use "line-out" but not all scanners have a "line-out" jack. You might need to adjust the settings. To adjust sound level settings type alsamixer then press the F6 key and select your sound card. Next press the F5 key to show the controls for this device. You can adjust these, exit alsamixer and try your recording experiment again. I found that if you use the "speaker" jack of your scanner with the scanners volume set to about 25%, the alsamixer mic setting was "50", however your results could be different. If you wish to delete the sound file you recorded simply type rm temp.wav (rm is the unix command for delete). When you're happy with your audio levels and want to save these so the Raspberry so it remembers them during a reboot simply type sudo alsactl store.
  • 10) Anytime you want to change the audio level you can use alsamixer, even when you're actually streaming. Remember if you are adjusting audio levels during streaming there could be a long delay from the time you make an adjustment til the time you hear it from the Icecast server. This could be from 20 seconds to in some cases nearly 2 minutes due to internet speed, buffering, server load, etc. Don't forget that anytime you use alsamixer to change the audio level always run sudo alsactl store so the settings are remembered anytime you reboot the Raspberry Pi.

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 text file.

    #!/usr/bin/make -f

    dh $@

    .PHONY: override_dh_auto_configure
    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 = # 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, 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!

Update 3/10/2014
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.

Update 3/11/2014
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.

Update 3/12/2014
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.

Update 3/13/2014
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]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 1: Device [Generic USB Audio Device], device 0: USB Audio [USB Audio]
    Subdevices: 0/1
    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....

Good Luck!

I hope you've enjoyed this article.