Streaming Audio with Ices and Icecast
My encoding computer is also running Mandriva. Because this machine is running only at 233MHz with 64MB of RAM, I decided to do a minimal install and leave off the window manager. Ices is also available from the contrib repository. So once again, typing urpmi ices is all it took to install Ices. However, you can download the latest releases from the Ices Web site (see Resources). Make sure you use the 2.0 series if you want to use Ogg. It also requires that libshout is installed. Once you have that, you can extract the archive and run ./configure; make; make install to get everything installed.
The Ices configuration file is also an XML file. It is usually stored in /etc/ices.conf.
The beginning of the configuration file has some settings that dictate how Ices runs. It can be helpful to change these during the initial setup, so that Ices runs in the foreground and sends messages to the console. These messages can be very helpful in debugging problems on initial setup. Once everything is set up and running, make sure Ices runs in the background and logs messages to a file:
<background>1</background> <logpath>/var/log/ices</logpath> <logfile>ices.log</logfile> <loglevel>3</loglevel> <consolelog>0</consolelog>
The rest of the file is under the stream section. This is where you configure settings specific to this particular audio stream. Within the stream section, the metadata section is where you specify information about the stream. This information will be displayed on the Icecast Web page:
<metadata>
<name>W0ZWY 146.895 MHz</name>
<genre>Live</genre>
<description>Live feed of the
W0ZWY repeater</description>
</metadata>
The input section is the place to define where the audio actually comes from. There are many possibilities, including options for playlists and scripts. Because I want to encode live audio, I used the oss module. Don't be alarmed if your system uses the ALSA sound system instead of OSS. ALSA has OSS compatibility, so this module works with both ALSA and OSS. Use the device parameter to specify the sound device from which to get data. On most systems it will be /dev/dsp. The rate parameter specifies the sample rate of the data in hertz. Most devices use 44100. Use the channels parameter to specify the number of channels available for capture. For most devices this will be 2 (stereo):
<input>
<module>oss</module>
<param name='device'>/dev/dsp</param>
<param name='rate'>44100</param>
<param name='channels'>2</param>
</input>
The instance section allows you to specify the number of instances of this stream. You might have more than one instance if you want to send the stream to more than one server, or if you want to have different versions of the same stream at different bitrates. For my system, I want only one instance.
The first part of the instance section is where you specify the streaming server information. The hostname tells Ices where to send the data. The port and password must match the values you specified in the Icecast configuration file. The mount option specifies what the name of the stream will be called.
The encode section specifies how the audio will be encoded. The easy way to do it is to set the sample rate and channels to match the input section above. But, I didn't need that much quality for my stream. So, I used the downmix and resample sections to tell Ices to resample the audio to 11127Hz and downmix it to 1 channel (mono). There are two options you can use to adjust the final bitrate of the stream: quality and nominal-bitrate. Notice that I commented out nominal-bitrate and set quality to 2:
<instance>
<hostname>192.168.1.1</hostname>
<port>8000</port>
<password>hackme</password>
<mount>/146.895.ogg</mount>
<encode>
<quality>2</quality>
<!--nominal-bitrate>32000</nominal-bitrate-->
<samplerate>11127</samplerate>
<channels>1</channels>
</encode>
<downmix>1</downmix>
<resample>
<in-rate>44100</in-rate>
<out-rate>11127</out-rate>
</resample>
</instance>
Once the configuration file is all ready, make sure that Ices has permission to access the audio device through /dev/dsp. Mandriva creates an audio group, which owns the /dev/dsp file. It also creates an ices user and group when ices is installed. I simply added ices as a member of the audio group in the /etc/groups file by editing the audio group:
audio:x:81:ices
Finally, you can start Ices by running the init script: /etc/init.d/ices start. If there are any errors during startup, look in the log files to debug them. It also can be helpful to examine the Icecast log files on your streaming computer to debug problems.
Once everything is up and running, you can access the Icecast status page on the port you specified in the configuration file. Figure 3 shows an example of an Icecast status page. Clicking on Click to Listen launches your audio player.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
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
| 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 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- New Products
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Validate an E-Mail Address with PHP, the Right Way
- Tech Tip: Really Simple HTTP Server with Python
- Trying to Tame the Tablet
- New Products
- git-annex assistant
5 hours 46 min ago - direct cable connection
6 hours 8 min ago - Agreed on AirDroid. With my
6 hours 18 min ago - I just learned this
6 hours 23 min ago - enterprise
6 hours 53 min ago - not living upto the mobile revolution
9 hours 44 min ago - Deceptive Advertising and
10 hours 19 min ago - Let\'s declare that you have
10 hours 20 min ago - Alterations in Contest Due
10 hours 22 min ago - At a numbers mindset, your
10 hours 23 min ago
Enter to Win an Adafruit Prototyping Pi Plate 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 Prototyping Pi Plate 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
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.





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
~~~~~