Farid Ahmadian / Slackware

Slackware 13.37 - Setup an online radio station using icecast / ices

Public domain

icecast Server

cd /usr/src/
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/icecast-2.3.3.tar.gz"
su - install
cd /usr/src/
tar xf icecast-2.3.3.tar.gz
cd icecast-2.3.3
./configure --prefix=/usr --sysconfdir=/etc/icecast
make install DESTDIR=/usr/local/encap/icecast-2.3.3
cp /usr/local/encap/icecast-2.3.3/etc/icecast/icecast.xml{,.default}
mkdir /usr/local/encap/icecast-2.3.3/usr/share/icecast/log

cd /usr/local/encap/icecast-2.3.3
mv usr/share/doc/ usr/

cat > /usr/local/encap/icecast-2.3.3/postinstall << EOF
chown -R nobody:nogroup /usr/share/icecast
chmod +x /usr/local/encap/icecast-2.3.3/postinstall

cd /usr/local/encap/
chown -R root:root icecast-2.3.3

mkencap icecast-2.3.3/
epkg icecast-2.3.3



    <admin>[email protected]</admin>






        <alias source="/" destination="/status.xsl"/>

            <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
            <logsize>10000</logsize> <!-- Max size of a logfile -->


Launch icecast

/usr/bin/icecast -b -c /etc/icecast/icecast.xml
tail -f /usr/share/icecast/log/error.log
    user: admin
    pass: adminhackme

libshout (client side)

cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/libshout-2.3.1.tar.gz"
su - install
cd /usr/src/
tar xf libshout-2.3.1.tar.gz
cd libshout-2.3.1
./configure --prefix=/usr && make
make install DESTDIR=/usr/local/encap/libshout-2.3.1
cd /usr/local/encap/libshout-2.3.1
mv usr/share/doc/ usr/
cd /usr/local/encap/
chown -R root:root libshout-2.3.1/
mkencap libshout-2.3.1/
epkg libshout-2.3.1

ices client

cd /usr/src
wget -c "http://pmoghadam.com/homepage/Pages/Deposit/Source-packages/ices-2.0.2.tar.gz"
su - install
cd /usr/src/
tar xf ices-2.0.2.tar.gz 
cd ices-2.0.2
./configure --prefix=/usr/ --sysconfdir=/etc/ices
make install DESTDIR=/usr/local/encap/ices-2.0.2
cd /usr/local/encap/ices-2.0.2/
mkdir -p var/log/ices
mkdir -p etc/ices
cp usr/share/ices/ices-*.xml etc/ices
touch etc/ices/ices.xml
cd /usr/local/encap/
mkencap ices-2.0.2
epkg ices-2.0.2

playback : /etc/ices/ices.xml

<?xml version="1.0"?>
    <!-- 1=error,2=warn,3=info,4=debug -->
    <!-- set this to 1 to log to the console instead of to the file above -->

            <Name>Radio Pejman</Name>
            <Genre>General genre</Genre>
            <Description>Pejman's Online Radio Station</Description>

        <!-- input module

            The module used here is the playlist module - it has 
            'submodules' for different types of playlist. There are
            two currently implemented, 'basic', which is a simple
            file-based playlist, and 'script' which invokes a command
            to returns a filename to start playing. -->

            <param name="type">basic</param>
            <param name="file">/etc/ices/playlist.txt</param>
            <param name="random">0</param>
            <!-- if the playlist get updated that start at the beginning -->
            <param name="restart-after-reread">0</param>
            <!-- if set to 1 , plays once through, then exits. -->
            <param name="once">1</param>

            <!-- Stream instance
            You may have one or more instances here. This allows you to 
            send the same input data to one or more servers (or to different
            mountpoints on the same server). Each of them can have different
            parameters. This is primarily useful for a) relaying to multiple
            independent servers, and b) encoding/reencoding to multiple
            If one instance fails (for example, the associated server goes
            down, etc), the others will continue to function correctly.
            This example defines two instances as two mountpoints on the
            same server.  -->
            <!-- Server details:
                You define hostname and port for the server here, along with
                the source password and mountpoint.  -->

            <!-- Reconnect parameters:
                When something goes wrong (e.g. the server crashes, or the
                network drops) and ices disconnects from the server, these
                control how often it tries to reconnect, and how many times
                it tries to reconnect. Delay is in seconds.
                If you set reconnectattempts to -1, it will continue 
                indefinately. Suggest setting reconnectdelay to a large value
                if you do this.

            <!-- maxqueuelength:
                This describes how long the internal data queues may be. This
                basically lets you control how much data gets buffered before
                ices decides it can't send to the server fast enough, and 
                either shuts down or flushes the queue (dropping the data)
                and continues. 
                For advanced users only.

            <!-- Live encoding/reencoding:
                Currrently, the parameters given here for encoding MUST
                match the input data for channels and sample rate. That 
                restriction will be relaxed in the future.
                Remove this section if you don't want your files getting reencoded.
                <nominal-bitrate>64000</nominal-bitrate> <!-- bps. e.g. 64000 for 64 kbps -->




Launch ices

ices /etc/ices/ices.xml


mplayer http://localhost:8000/ices.ogg

BY: Pejman Moghadam
TAG: icecast, ices, radio
DATE: 2012-08-23 23:50:42

Farid Ahmadian / Slackware [ TXT ]

With many thanks and best wishes for dear Pejman Moghadam, someone who taught me alot in linux and life :)