Thursday, January 17, 2013

Setting Up An Internet Radio Station


Objective

This guide aims to provide the steps in creating an Internet radio station.



Overview

In this guide we will run a SHOUTcast Distributed Network Audio Server (DNAS) that will broadcast audio stream coming from a transcoder. Initially we will use the SHOUTcast Transcoder to send audio streams to SHOUTcast DNAS for it to broadcast. Both SHOUTcast DNAS and SHOUTcast Transcoder will reside in one host computer running Linux OS.

After the initial setup is done, we will replace SHOUTcast Transcoder with Winamp+DSP running on Windows. This will give easier control on what audio file to stream or switch to live input from a microphone.

Next we will want other people to know of our Server and give them a way to connect to our service. To do that we will need to register our SHOUTcast DNAS to SHOUTcast directory to be included in SHOUTcast’s list of available servers.

We will then finish this guide with steps on how to configure SHOUTcast DNAS accept multiple input and broadcast these in different streams.




Requirements

Computer running Linux OS
SHOUTcast  DNAS 2.0
SHOUTcast Transcoder

For Winamp
Computer running Windows OS
Winamp
DSP Plug-In for Winamp



SHOUTcast DNAS

Installation

We need to download a copy of SHOUTcast DNAS from http://www.shoutcast.com/broadcast-tools, and extract it to its own folder. This copy of SHOUTcast DNAS comes pre-compiled and is ready to run as soon as it’s been extracted. 

#cd /usr/src
#mkdir shoutcast
#cd shoutcast
#wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_07_31_2011.tar.gz  

for a 64 bit version, download http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_x64_07_31_2011.tar.gz

#tar -xzvf /sc_serv2_linux_07_31_2011.tar.gz


Configuration

SHOUTcast DNAS comes with several sample configuration files that are ready to use. For  our need we just need to change the administrator password for SHOUTcast DNAS’s web interface.

Open sc_serv2_basic.conf and look for the line “adminpassword=changeme”. Replace the value with your desired password. Save and close the file.


Testing

Since we are still not sending audio stream to our Server, we cannot test if our Server is working by using an audio player and listening to it. However, we can still run the Server and test its status by checking its web interface.

In the Server
#cd /usr/src/shoutcast
#./sc_serv sc_serv_basic.conf

In a computer with an Internet browser
  • Open a browser
  • In the address bar, type the IP address of our Server followed by port 8000 (e.g. 192.168.1.1:8000)
  • Use the following for the login credentials
username = admin
password = <the password you provided during the configuration>
  • You will now then be presented with the Server’s web interface

Do not worry if the status says that the Server is currently down. This is just because we have not yet provided the Server with an audio stream to broadcast.



SHOUTcast Transcoder

Installation

Now we’re ready to install the Transcoder that will provide the Server with audio stream to broadcast. Just like SHOUTcast DNAS, SHOUTcast Transcoder comes pre-compiled so we only need to create another directory then download and extract the Trancoder there.

#mkdir /usr/src/shoutcast/transcoder
#cd /usr/src/shoutcast/transcoder
#wget http://download.nullsoft.com/shoutcast/tools/sc_trans_linux_10_07_2011.tar.gz 

for a 64 bit version, download http://download.nullsoft.com/shoutcast/tools/sc_trans_linux_x64_10_07_2011.tar.gz 

#tar -xzvf sc_trans_linux_10_07_2011.tar.gz 


Configuration

Again, just like SHOUTcast DNAS, SHOUTcast Transcoder comes with sample configuration files that we can use right away. All we need to do now is to copy audio files into /usr/src/shoutcast/transcoder/music folder (or to other location you like as long as it is accessible by the Transcoder).

Open /usr/src/shoutcast/transcoder/playlists/main.lst and add the location of the audio file to include in the stream, one file per line. Just follow the example provided in main.lst (don’t forget to remove this line after you are finished adding your audio files). Save and close main.lst


Start Streaming

To start streaming audio to the server, just run sc_trans with the file name of the configuration file to use

#./sc_trans sc_trans_basic.conf

Make sure the SHOUTcast DNAS is running before you execute the above command


Testing

This time we can use an audio player like Winamp, iTunes, VLC, etc. to see if our Server is indeed broadcasting the audio stream provided to it by the Transcoder.

Do this in another computer that has an Internet browser:
  • Open an Internet browser
  • Go to <your Server’s IP address>:8000/listen.pls (e.g. 192.168.1.1:8000/listen.pls)
  • If your browser is configured to open an application that can handle PLS files it will run and start playing the audio broadcasted from our Server
  • Otherwise, run your audio player and open the downloaded listen.pls file. This will start playing the audio broadcasted from our Server



Registration to SHOUTcast Directory

By now we have a working Internet radio that is ready to broadcast to the whole world. What is left now is for the whole world to know that our server exists. We can easily let the whole world know our server and give them a easy way to connect to us by registering our server to SHOUTcast directory. So with the Server and Transcoder still running, follow the following instructions.

  • Open an Internet browser
  • In the address bar, type the following

<Server IP>:<Port #>/admin.cgi?sid=0
(e.g. 192.168.1.1:8000/admin.cgi?sid=0)

  • Login
  • Click on Create Authhash
  • Fill up the form that follows then click Create Authhash button

This time instead of using sc_serv_basic.conf as the parameter for sc_serv, use sc_serv_public.conf

i.e. 
sc_serv sc_serv_public.conf

That’s it! Our server is not included in SHOUTcast directory and ready for the whole world to use.



Winamp

Since SHOUTcast Transcoder does not have a GUI interface it becomes hard to add or remove files to be included in the stream. Also, switching between recorded and live feed. To make is easier to control what is to be included in the stream, we will replace SHOUTcast Transcoder with Winamp with DSP plug-in. DSP plug-in is used for sending live feed into the stream. SHOUTcast DSP Plug-In for Winamp only works on Windows so get a Windows computer and start installing.


Install Winamp

  • Download Winamp from www.winamp.com
  • Double-click the downloaded file and follow the installation prompts


Install SHOUTcast DSP Plug-In for Winamp

  • Download the DSP plug-in from http://www.shoutcast.com/broadcast-tools 
  • Double-click the downloaded file and follow the installation prompts


Configuration

  • Open Winamp’s preferences window by clicking Options then Preferences
  • Select DSP/Effect under Plug-ins in the left side list box
  • In the right side list box, select Nullsoft SHOUTcast Source DSP v2.3.2  [dsp_sc.dll]
  • Click Configure active plug-in button located at the bottom of the window
  • In Nullsoft SHOUTcast Source, Open the Output tab then the Login tab
  • Under Server Address, type in the IP address of our SHOUTcast DNAS (e.g 192.168.1.1)
  • Under Port, type the port number used by our SHOUTcast DNAS (e.g. 8000)
  • Keep Stream’s value of 1
  • Ignore the DJ / User ID
  • Under password, type in the administrator password you provided for the SHOUTcast DNAS
  • Select Automatic reconnection on connection failure
  • Keep Reconnection timeout of 1 second
  • Unselect Use SHOUTcast v1 mode
  • Click on the Input tab
  • Select the Input Device you want to use
        • Winamp (to send the audio being produced by Winamp when it plays)
        • Souncard Input (to send the audio being received by the computer’s audio input, like your voice from a microphone) 

Testing

  • Before clicking the Connect button in Nullsoft SHOUTcast Source window, make sure that you have stopped SHOUTcast Transcoder but keep SHOUTcast DNAS running.
  • If you selected Winamp as the Input Device, add audio files into Winamp’s playlist and click the Winamp’s play button
  • Re-open Nullsoft SHOUTcast Source window (if it closed) and click the Connect in the Output tab
  • On a different device, connect an audio player to our SHOUTcast DNAS

Once your done you should hear the audio player playing the broadcast from our SHOUTcast DNAS



Multiple Stream

SHOUTcast DNAS is capable of broadcasting multiple streams, meaning we broadcast more than one audio source from our SHOUTcast DNAS. We are going to reconfigure our Server to allow two Transcoders / sources to send input to our Server for it to broadcast. One source will be coming from SHOUTcast Transcoder and the other from Winamp.


Server Configuration

  • Open sc_serv_basic.conf 
  • Comment the lines 

streamid=1
streampath=/test.aac

and uncomment the following lines

streamid_1=1
streampath_1=/test.aac
streamid_2=2
streampath_2=/test2.aac

  • Save and close the configuration file (Note: you still start sc_serv using sc_serv_public.conf if you want to make the Server public. sc_serv_public.conf reads and includes the configuration in sc_serv_basic.conf)


Transcoder Configuration

SHOUTcast Transcoder

  • Open sc_trans_basic.conf
  • Look for streamid and set its value to 1 to occupy broadcast stream 1 of our Server
  • Optionally change the value of adminport in case it is being used by other Transcoder or other programs
  • Save and close the file


Winamp + DSP

  • Open Nullsoft SHOUTcast Source window
  • Open Output tab then the Login tab
  • Set the value of Stream to 2 to occupy broadcast stream 2 of our Server


Registering Stream 2

SHOUTcast DNAS is now ready to broadcast these two input sources. However, we still have not registered stream 2 to SHOUTcast directory. We have to do the registrations steps as instructed in Registration to SHOUTcast Directory section. This time choose Create Authhash for stream 2.


Testing

  • Start our server using sc_serv_public.conf as the parameter
  • Start SHOUTcast Transcoder
  • Start Winamp and click the Connect button in Nullsoft SHOUTcast Source window
  • Use an audio player to listen to the streams. You can manually input the source and select the stream to listen to by accessing this URL pattern

<Server IP address>:<Port #>/test.aac for stream 1
<Server IP address>:<Port #>/test2.aac for stream 2

e.g.
192.168.1.1:8000/test.aac

1 comment:

  1. When I’m looking for the latest country music, I always end up in one spot – 103.1 WIRK. I was even lucky enough to catch up with Keith Van Allen in the streets and got free ‘Rib Round Up’ tickets. Just one of the many events that keep me tuned into www.wirk.com

    ReplyDelete