Streaming Audio with Ices and Icecast
Once I had everything set up and running, I spent a fair amount of time fine-tuning the audio. The first thing I found was that the audio level was quite low. Normally, when I want to turn up the audio level, I use KMix. But, I hadn't installed a window manager on my encoding computer. My system uses ALSA as the sound system, and I found out that there is a great curses-based mixer for ALSA named Alsamixer. It allows you to use the arrow keys to change settings. Figure 4 shows the settings I chose for my card. My final preference was to have the Master and PCM both at 100%. I also chose to mute everything else, because I knew they would not be in use.
Now that the audio was loud enough, I still had another problem. The audio sounded choppy. After looking around for a while, I realized that the processor usage was at 100%. I tried to reduce the bitrate by changing the value of the nominal-bitrate setting. With the bitrate set sufficiently low, the audio sounded good. I guess you can't encode very high-quality audio with a 233MHz processor.
When the audio sounded good, my goal was to lower the bitrate as much as possible while keeping an acceptable level of audio quality. In my case, an “acceptable level” is quite low. The traffic on the W0ZWY repeater is only voice, because it is illegal to transmit music in the amateur radio bands.
Three aspects of the encoded audio will affect its quality and bitrate: number of channels, sample rate and bitrate. I started by setting the downmix to 1, because the scanner is only mono. Then, I incrementally decreased the sample rate until I found the lowest setting that rendered acceptable audio; 11127Hz ended up being the minimum. Instead of setting the bitrate with the nominal-bitrate setting, I used the quality setting. The quality setting directly affects the final bitrate. With a few tries, I chose a quality level of 2.
With my final settings, the bitrate stays around 30Kbps, and the processor hovers around 40% usage.
There are probably many other applications where this type of system would be useful. Keep in mind, however, if you are interested in using this type of system for streaming music, make sure you have permission from the artists and recording studios.
This combination of open-source projects really worked well together. Setting up everything was quite simple. I spent most of my time tweaking the quality and sample rate settings. The traffic on my streamer is quite low. I usually have only one or two connections per week. But, it was fun to learn, and it is my little way of participating in the amateur radio community.
Ices Settings and Bitrates
The quality, sample rate and channels settings all will affect the bitrate of the stream. Table 1 shows various combinations of these settings and their resulting bitrates.
Brian Matherly is a Software Engineer at Sencore Electronics in Sioux Falls, South Dakota. He is also an adjunct professor at Colorado Technical University.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
- Django Models and Migrations
- Hacking a Safe with Bash
- Secure Server Deployments in Hostile Territory, Part II
- The Controversy Behind Canonical's Intellectual Property Policy
- Huge Package Overhaul for Debian and Ubuntu
- Home Automation with Raspberry Pi
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- KDE Reveals Plasma Mobile
- diff -u: What's New in Kernel Development