Saturday, July 2, 2011

Installing SHOUTcast Server on CentOS/RHEL

INTRODUCTION

This guide will explain you how to install SHOUTcast server on CentOS/RHEL. SHOUTcast lets you stream live music to listeners and start your own radio station on the web. For more information please visit their website.

What is shoutcast?
SHOUTcast is cross-platform proprietary software for streaming media over the Internet. SHOUTcast Radio is a related web site which provides a directory of SHOUTcast servers. The software, developed by Nullsoft, allows digital audio content, primarily in MP3 or HE-AAC format, to be broadcast to and from media player software, enabling the creation of Internet radio "stations".

WARNING: Please be aware of copyright laws. You cannot stream music unless you own the royalties to it or have permission from the owner, this blog is NOT responsible for what you use this tutorial to do, stream and set up your own server at your own risk.
We assume you have some Linux knowledge.

INSTALLING SHOUTCAST DNAS

 

The SHOUTcast Distributed Network Audio Server (DNAS) is responsible for the actual streaming and broadcasting of your audio content out to the world.

NOTE: If you are using some firewall don't forget to make exception on the appropriate ports.
ATTENTION: Please DO NOT run the DNAS as a root for the security reason, instead we'll create a

shoutcast user
adduser shoutcast
Update the password of 'shoutcast' using
passwd shoutcast
Now login as the new shoutcast user, or you can su to the user
su - shoutcast

Create a directory shoutcast
mkdir shoutcast
cd shoutcast
 
Lets download shoutcast from nullsoft
wget http://yp.shoutcast.com/downloads/sc1-9-8/sc_serv_1.9.8_Linux.tar.gz
Extract the files:

tar xzf sc_serv_1.9.8_Linux.tar.gz

Shoutcast has now been installed and you can tidy up the directory
rm -rf sc_serv_1.9.8_Linux.tar.gz

You need to edit the configuration file according to your needs
vi sc_serv.conf

We are not going to explain each options as they are well documented in the configuration file itself; the most important options are

1. "MaxUser=32"
"The maximum number of simultaneous listeners allowed. Compute a reasonable value for your available upstream bandwidth."

2. "Password=changeme"
"While SHOUTcast never asks a listener for a password, a password is required to broadcast through the server, and to perform administration via the web interface to this server."

3. "PortBase=8000"
"This is the IP port number your server will run on. The value, and the value + 1 must be available."
NOTE: at this point you can go through the settings and change them to what you want or you can save and start SHOUTcast and it will work perfectly.

So it's time to fire up your radio station
./sc_serv &


This will send the server into the background. The problem is, you will not be able to cleanly exit, so you need to just closed out your SSH client terminal window (in our case PUTTY). This way the server will keep running and you won't see it again. Now if you login to the server again and do ps aux, you will see sc_serv should be running still. Another test is to go to: http://serverurl:8000 (if you haven’t change the default ports).
To kill the shoutcast server, login to SHH, type in ps aux and find the PID of ./sc_serv and then in your next command type in kill -9 7537. where 8874 is the PID of the sc_serv process. This will kill your SHOUTcast. Keep in mind that SHOUTcast will not start at system boot, so you will manually need to restart it. Also, the SHOUTcast server uses approximately 32MB of memory while running.

INSTALLING WINAMP ON WINDOWS AND STREAMING TO A SHOUTCAST SERVER

Now lets get Winamp running on Windows so we can stream!
Winamp is a media player for Windows-based PCs, written also by Nullsoft, for more information and to download this software please visit http://www.winamp.com/

Install Winamp
The installation is pretty straight forward and it's just a few simple clicks
NOTE: Configure available options to meet your needs.

- Download and install the SHOUTcast DSP Plug-In for Winamp. By default it will be installed in the same directory as Winamp

- Start Winamp > go to Options > Preferences, then in that window scroll down to Plugins > Dsp/effect. Select Nullsoft shoutcast source dsp 2.0.0 then close it

- Find the new window that poped up, in it, go to the output tab and fill in the address: this is your server URL or IP address, port, and password. You can click on yellow pages and enter in personal info as well. If you make your server public, you will be listed in the SHOUTcast directory where anyone can find your server.

- Go to the encoder tab, and the encoder type should be MP3 encoder, and the settings should be whatever you want. In this example we're using 128Kbps, 44.1khz stereo.

- Go back to output and click on connect and it should be streaming to your server. Use Winamp to play a song of your choice. You can simply go to your now playing page in the main Winamp player window and open a song to play that's on your computer.

To broadcast your voice on mic, go to the input tab of the SHOUTcast source window and select sound card as input and push to talk (or lock if you want to click once to talk then click again to turn off your mic). Remember after done talking, switch back to Winamp as the input device to stream music playing in the player.

Visit http://yourserver:8000 to see the song title and information - which is live information with a total number of listeners. If you login, you will be able to see users connected and IPs with the ability to kick them. To login, the username is admin, and the password is your admin password, or if not set, your broadcast password.

On the website, you will find a link to the listen.pls file that clients can download and play in Foobar, Winamp or other Shoutcast enabled players.

NOTE: The SHOUTcast streams are normally delayed 30 seconds to listeners, so people listening will hear what you hear live about 30 seconds after the fact.

2 comments:

  1. The issues involving shoutcast hosting has been a popular topic amongst scholars for many years. There are many factors which influenced the development of shoutcast hosting. While it has been acknowledged that it has an important part to play in the development of man, it is yet to receive proper recognition for laying the foundations of democracy. The juxtapositioning of shoutcast hosting with fundamental economic,s

    ReplyDelete
  2. You need to edit the configuration file according to your needs.

    vi sc_serv.conf
    sc_serv.conf file does not exist with the latest version "sc_serv2_linux_x64-latest.tar.gz"

    ReplyDelete