How To: Install and Configure Shoutcast Radio

Shoutcast is a mp3 broadcasting/streaming media server software provided by NullSoft. One can setup a server on any system, GNU/Linux / Windows/ MacOS and can stream mp3 over the network, internet/intranet. I setup shoutcast on my system a long back and found it very useful. Here is a step by step how to on how you can setup shoutcast on a GNU/Linux system.

Shoutcast can be installed even if you don’t have root privileges. But in that case you can’t use port less than 1024 for broadcasting. Below, I’ll explain how to install it for a non-root user.

Shoutcast server depends on a tool shoutcast DNAS for audio input in Linux. So, here we go

Step 1

Download the latest version of shoutcast from here. Download the one for Linux (glibc).

Step 2

Let us assume we want to install shoutcast in a directory named ‘shoutcast’ in user’s home directory and we want to broadcast punjabi songs.

1
2
3
[saini@bordeaux shoutcast]# tar -xvzf sc_serv_1.9.8_Linux.tar.gz [Enter]
[saini@bordeaux shoutcast]# mkdir punjabi [Enter]
[saini@bordeaux shoutcast]# mv sc_serv.conf punjabi/sc_serv_punjabi.conf [Enter]

Step 3

Open sc_serv_punjabi.conf in your favorite editor and modify certain parameters as per you requirements. The essentials are below.

1
2
3
4
5
6
7
8
9
10
11
12
13
MaxUser=20
Password=yourPassword
PortBase=8300 #(Confirm that this port and the port PortBase+1 is not being used)
LogFile=none
RealTime=0
ScreenLog=0
ShowLastSongs=10
SrcIP=ANY
DestIP=ANY
Yport=80
NameLookups=0
AdminPassword=yourAdminPassword
TitleFormat=%s [IIIT Radio]

etc. My sc_serv.conf can be accessed here. That was all for installing the shoutcast server.

Now, the installation of DNAS tool is still pending. Here is a step by step procedure to install DNAS tool.

Step 1

Download the latest version of DNAS tool from here.

Step 2

1
2
3
4
[saini@bordeaux shoutcast]# tar -xvzf sc_trans_posix_040.tgz [Enter]
[saini@bordeaux shoutcast]# cd sc_trans_040/ [Enter]
[saini@bordeaux sc_trans_040]# mv sc_trans_linux ../ [Enter]
[saini@bordeaux sc_trans_040]# mv sc_trans.conf ../punjabi/sc_trans_punjabi.conf [Enter]

Step 3

Go to punjabi directory and open sc_trans_punjabi.conf in your favorite editor and make changes according to your needs. Here are some

1
2
3
4
5
6
7
8
9
PlaylistFile=/exactPathTo/punjabi.lst
ServerIP=
ServerPort=
 # 8300 in this case
Password=
 # yourPassword in this case
StreamTitle= %s
StreamURL=
Shuffle=1 # (1 for random songs)

etc. My sc_trans.conf can be accessed here.

Step 4

Generate a list of all the songs (mp3) you have and put it in punjabi.lst in punjabi directory.

[saini@bordeaux punjabi]# find /pathToPunjabiDir/ -type f -name "*.mp3" > punjabi.lst [Enter]

My dummy punjabi.lst can be accessed here.

The configuration part of shoutcast server with audio input is complete. Now we have to run the server so that we can listen to music.

Go to the shoutcast directory and run the sc_serv first and then run the sc_trans_linux. Here is way to do that.

1
2
[saini@bordeaux shoutcast]# ./sc_serv punjabi/sc_serv_punjabi.conf > /dev/null 2> /dev/null &
[saini@bordeaux shoutcast]# ./sc_trans_linux punjabi/sc_trans_punjabi.conf > /dev/null 2> /dev/null &

Now your system is a shoutcast server. Any client can use mplayer, vlc, amarok or any other multimedia player that support streaming media to listen to the music being played on your server.

1
2
[saini@bordeaux saini]# mplayer http://yourIp:port [Enter]
[saini@bordeaux saini]# mplayer http://localhost:8300 [Enter] # (in the above case).

If you want shoutcast to start every time your system boots. Put these lines in /etc/rc.local

1
2
/home/saini/shoutcast/sc_serv /home/saini/shoutcast/punjabi/sc_serv_punjabi.conf > /dev/null 2> /dev/null &
/home/saini/shoutcast/sc_trans_linux /home/saini/shoutcast/punjabi/sc_trans_punjabi.conf > /dev/null 2> /dev/null &

Shoutcast is fun and its more fun when everyone listens to what you are listening to 🙂