Friday, May 26, 2006

Radio Benji !!


Here I'll explain how to transform your mp3 directory into a web radio (on a local network at least), on a Mandriva Linux box.

We'll be using icecast, and ices0. You'll need to have a plf media configured (see easyurpmi), since ices0 streams mp3 and that's such a nasty thing, ouch. (stream oggs if you don't want this).

Installation

# So, let's start with this good old urpmi. su and then,
[root@flanders bsergean]# urpmi icecast ices0

# Here's a 2 cents tips to have a nice emacs mode for xml.
[root@flanders bsergean]# (cd /etc/ices ; ln -s ices.conf ices.xml)

# some backup just in case
[root@flanders bsergean]# cp /etc/icecast.xml /etc/icecast.xml.dist
[root@flanders bsergean]# cp /etc/ices/ices.conf /etc/ices/ices.conf.dist

# And, then, the funky part, editing config files :(
[root@flanders bsergean]# emacs /etc/icecast.xml /etc/ices/ices.conf &

We create a dummy playlist for ices.
[root@flanders bsergean]# find /perso/mp3 -name '*.mp3' > /etc/ices/playlist.txt

icecast

Some infos on this /etc/icecast.xml here

The two things I'm gonna change are (1) the source password and (2) the hostname.


changemeplease

fully.qualified.hostname.here

Then we start it.

[root@flanders bsergean]# icecast -b -c /etc/icecast.xml
Changed groupid to 304.
Changed userid to 304.

icecast will log here:
[bsergean@flanders ~]$ tail -f /var/log/icecast/error.log
[2006-05-26 11:32:31] INFO main/main Icecast 2.1.0 server started
[2006-05-26 11:32:31] INFO stats/_stats_thread stats thread started
[2006-05-26 11:32:31] INFO fserve/fserv_thread_function file serving thread started
[2006-05-26 11:32:31] INFO yp/yp_update_thread YP update thread started


ices0

For ices0, infos can be found here

But since I cannot make it using the conf file, I use the command line arguments :)

I create a playlist, in the supported m3u format, using the brute force find method:
[root@flanders bsergean]# find /perso/mp3 -name '*.mp3' > /etc/ices/playlist.txt

[root@flanders bsergean]# ices0 -n 'My Stream Name' -r -F /etc/ices/playlist.txt -h fully.qualified.hostname.here -P changemeplease
Logfile opened
Playing /perso/mp3/gnocchi/iTunes/iTunes Music/Placebo - Sleeping with ghosts/03 This Picture.mp3
Mounted on http://fully.qualified.hostname.here:8000/ices

Security

The bad thing is that ps -ef shows the command lines and also show changemeplease

Daemon

Start icecast with option -b and ices0 with option -B to detach from the terminal.

Listening

Now, go on another machine (or yours, but it's less fun :), and enter fully.qualified.hostname.her:8000 into your browser and click on listen, or enter fully.qualified.hostname.her:8000 in your favorite music client (Open Location most time), click on listen and it works !!

0 Comments:

Post a Comment

<< Home