Install and setup of a streaming server under Linux

Compile / install

You need these open source programs:

  1. libogg

  2. libvorbis

  3. libshout

  4. icecast

  5. ices2

Libogg and libvorbis is probably already installed if you use SuSE 9.3. If that is not the case, you could try “YaST | Install/remove programs” or download and install them from vorbis.org, using the method bellow.

Download the tar.gz version of libshout, icecast and ices2 from icecast.org. Begin with installing libshout, like this:

  1. wget http://downloads.us.xiph.org/releases/libshout/libshout-2.1.tar.gz
  2. tar zxvf libshout-2.1.tar.gz
  3. cd libshout-2.1/
  4. ./configure; make
  5. make install (need to be done as root, use su)

Repeat this for icecast and ices2, but replace program/library name and version.

Setup

Both the icecast server, and ices2 source client is using XML configuration files that is specified on the command line when the programs is started. We start by setting up icecast, simply by saving this text to a file:

<icecast>
        <authentication>
                <source-password>test53</source-password>
                <relay-password>test53</relay-password>

                <admin-user>admin</admin-user>
                <admin-password>test53</admin-password>
        </authentication>

        <listen-socket>
                <port>8000</port>
        </listen-socket>

        <paths>
                <basedir>./</basedir>
                <logdir>./</logdir>
                <pidfile>./icecast.pid</pidfile>
        </paths>

</icecast>

This is only the most basic settings that is needed to get icecast running. You can find many more in the documentation, located in /usr/local/share/doc/icecast/. Note that icecast should not be running as root, and that logfiles are saved in the current directory as specified in the above configuration.

To start icecast in the background, use this command:

icecast -b -c icecast-configuration.xml

Configuration of ices2 is being done in the same way, copy the following text to a file:

<ices>
        <background>1</background>
        <logpath>./</logpath>

        <stream>
        <metadata>
                <name>MMO</name>
                <url>http://www2.geo.uib.no/</url>
                </metadata>

        <input>
                <module>alsa</module>
                <param name="rate">44100</param>
                <param name="channels">2</param>
                <param name="device">hw:0,0</param>
        </input>

        <instance>
                <hostname>localhost</hostname>
                <port>8000</port>
                <password>test53</password>
                <mount>/mmo.ogg</mount>
                <yp>0</yp>

                <encode>
                        <quality>6</quality>
                        <samplerate>44100</samplerate>
                        <channels>2</channels>
                </encode>

                <downmix>0</downmix>

        </instance>
        </stream>
</ices>

Then start ices2 with this command:

ices ices-configuration.xml

Ices should now be running in the background, and should be encoding sound from one of the capture inputs on your soundcard. You can select this input with a mixer program like Kmix (if you are using KDE) or alsamixer.

In Kmix it could look like this if you have selected to record from line-in on your soundcard. The capture slider controls the recording volume level (you should adjust this), and the light red dot selects the Line input.

Listening to the streaming server

You could now tune in to your new streaming server from another machine. In Linux you could use programs such as XMMS, Beep media player or ogg123 (command line). In XMMS you use Ctrl+L to open a box where you type in the address to the stream, or use Ctrl+H in Beep. An example address could be http://192.168.0.11:8000/mmo.ogg – you probably have to change the IP address. If you want to make the stream available from a clickable link on a web page, you must create an play list file with this address in, and then link to the play list file on the web page.

If you want to do some signal analysis on the stream, on Linux, you could use the program Baudline that you can find on http://www.baudline.com. This can not be done on the machine that is running ices2, because ices is occupying the DSP device.

Select volume as input channel to analyze the output from your media player.

Below is a screenshot of Bauline monitoring the audio stream from a net radio. To record data with Baudline right click the main window, select Output > Play deck.


Baudline monitoring a net radio station.



JIS, 27 May 2005

University of Bergen,
Dept. of Earth Science
Norway