Streaming Audio with Ices and Icecast
The Sioux Empire Amateur Radio Club operates a repeater on 146.895MHz with the call name W0ZWY. On Tuesday evenings, it provides a time for club announcements. I like to listen in when I can, but sometimes I am still at work when the announcements start and can't get to my radio. I found a way to solve this problem by using a UHF/VHF scanner, Linux, Ices and Icecast. By rebroadcasting the transmission over the Internet, I can listen to the local club repeater anytime, anywhere.
The first step was to find a VHF tuner that could tune to 146.895MHz and output analog audio to a sound card. I found that the least expensive way to go was to buy a consumer-grade UHF/VHF scanner. The scanner needed to have either a line-level output or a headphone jack. I found that line-level outputs are rare, but there are a number of scanners with headphone jacks. I also wanted one with a digital tuner so that it would not drift off frequency over time. I found a Radio Shack PRO-2050 on eBay for around $75 US that met all my requirements.
Using an F-to-BNC adapter, I connected the scanner's antenna jack to the off-air TV antenna on the roof of my house. This worked well because 146.895MHz lies right between off-air TV channels 6 and 7. I spent some time setting the squelch as high as I could, so there would not be static when no one was transmitting. Figure 1 shows my scanner with the audio cable plugged in to the headphone jack.
In order to put the audio on the Internet, it first must be encoded. Then, that encoded information can be made available for streaming to clients on the Internet. For these tasks, Icecast and Ices make a great team. Icecast is a media streaming program that supports Ogg Vorbis or MP3 streams. It receives encoded media from one or more sources and makes it available for streaming to multiple clients. Ices is an Ogg Vorbis audio encoder that works well with Icecast. I chose Ogg because it is a patent- and royalty-free format. Plenty of players can decode Ogg. XMMS on Linux and Winamp on Windows are the most common. If you are interested in using MP3 encoding, check out LiveIce by following the link in the Resources for this article.
The encoding and streaming tasks can be done on the same machine, but I chose to do them on separate machines. This makes it easier to add more sources later. Additionally, it removes some of the processing burden from the streaming machine.
For the encoding computer, I chose a 233MHz Pentium I computer that had been unused for many years. I connected the headphone jack from the scanner to the line-in jack on the sound card using a 3.5mm-to-3.5mm audio cable that came from an old set of computer speakers. I connected the network interface to my LAN and set the IP address to 192.168.1.21.
For the streaming computer, I chose to use my existing router, which doubles as a Web server. The main reasons I chose it are that I already own it and it has my only public IP address. This computer has two network interfaces. One is connected to my cable modem and has a public IP address. The other interface is connected to my LAN and has the private IP address 192.168.1.1. Another way to accomplish this would be to use a consumer-grade cable/DSL router and forward port 8000 to the streaming computer's IP address.
Figure 2 shows a diagram of my network, including the scanner, encoder, streamer and cable modem.
My streaming computer is running Mandriva. Icecast is available from Mandriva's contrib RPM repository. Once I added that repository, installing Icecast was as easy as typing urpmi icecast from the command prompt. If you want to install from source, you can download the latest release from the Icecast Web site (see Resources). Simply click the download link, extract the archive, and run the familiar commands ./configure; make; make install.
The Icecast configuration file is an XML file and usually resides in /etc/icecast.xml. I was able to use most of the default settings, but I highlight some of the changes I did make here.
The limits section of the file allows you to set the maximum number of source streams (encoders) and the maximum number of clients that can connect to the streaming computer at once. The upload data rate on my cable modem is limited to 256Kbps by my ISP. As such, I need to limit the maximum number of clients to be sure that I don't use all of my upload bandwidth:
<limits>
<clients>10</clients>
<sources>2</sources>
</limits>
The authentication section is where you specify the user names and passwords. The source-password is the password used by the encoding machine when it connects. The relay-password is used by relays, which I am not using in my configuration. The admin-user and admin-password allow access to the administration Web page. It is important to change all passwords from the default for security:
<authentication>
<source-password>hackme</source-password>
<relay-password>hackme</relay-password>
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password>
</authentication>
The hostname is used so that Icecast knows what address to append to the beginning of the links on the Web page:
<hostname>example.com</hostname>
The listen-socket allows you to set the port on which Icecast listens; 8000 is the default:
<listen-socket>
<port>8000</port>
</listen-socket>
Once the configuration file is all ready, you can start Icecast by running the init script: /etc/init.d/icecast start. If there are any errors during startup, look in the log files to debug them.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- another very interesting
42 min 38 sec ago - Reply to comment | Linux Journal
2 hours 36 min ago - Reply to comment | Linux Journal
9 hours 30 min ago - Reply to comment | Linux Journal
9 hours 46 min ago - Favorite (and easily brute-forced) pw's
11 hours 37 min ago - Have you tried Boxen? It's a
17 hours 29 min ago - seo services in india
22 hours 58 sec ago - For KDE install kio-mtp
22 hours 1 min ago - Evernote is much more...
1 day 1 min ago - Reply to comment | Linux Journal
1 day 8 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?






Comments
Out of date
Hi,
I suggest removal of this article. It seems that things have moved on so much, that all it does is waste people's time. I need to do *exactly* what this guy is doing, but I can't follow the procedure here as the software has changed significantly in two years.
Best Regards,
Paul
~~~~~