PDA

View Full Version : Your Mail/Radio Server [for beginners]


Mr. Hasselhoff
11-30-2006, 07:15 PM
What is a Streaming Audio Server
Its an application that will allow you to "stream" or send a continuous block of data to a client. In a few words, it will allow you to put your own radio station online, where it will be feed by sound files lying around your hardrive, and then clients will connect to the server, and will have the chance to listen whats being playing, just like a plain old school radio station, only that this one is digital, thus allowing better quality, and management is really simple after you follow some simple steps in the initial configuration.

1.1 Winamp
Required by the broadcasting client to send the music files straight to the server.

Download :
Code:
http://download.nullsoft.com/winamp/client/winamp5094_full_hawthorne_emusic-7plus.exe

1.2 SHOUTcast Server 1.9.5

Download :
Code:
http://www.shoutcast.com/downloads/sc1-9-5/shoutcast-1-9-5-windows.exe

Installation
What do you need to do? -> follow the "advanced" windows approach, aka "next->next->next"
Once you're done, you'll have a folder C:\Program Files\SHOUTcast

Configuration
What do you need to do? -> follow the newly created shortcuts in the start menu (folder SHOUTcast DNAS), and run the server configuration utility SHOUTcast DNAS (GUI)

Kill Server: Self-explanatory . It kills the serve, and all active client connections. So use it when you just want to shut it down for a while. Notice also that when you run the application, a little icon is displayed in the system tray.

Hide Monitor: Will basically minimize the window. The only way to get it back is via the aforementioned icon in the system tray. You can also access this function from the "X" button of the window.

Edit Log: Will simply give you access to the log file of the server, where useful information such as startup time, clients connection and so on are displayed. You can save the file to your hardrive, for historical purposes or whatever suits your needs.

Edit Config: This is the most important part, and the one Ill focus here, since it gives you access to all the configuration parameters of the server.

You need to restart the server if any changes were made in order to the server to reload the new values. Notice if it opens notepad by default, probably the end-line characters wont be parsed correctly, which in plain english means you'll see sort of gibberish. So, close the server, and go straight to C:\Program Files\SHOUTcast and open the file sc_serv.ini with another text editor, such as wordpad, which recognizes unix end-line characters correctly.

Now I'll explain the most important options, change them accordingly to suit your needs, or leave the default if you're still confused about any. Notice the developers of this great application made a good job, and they explained the options very well in the ini file, however, if you still are a little lost, follow my prior advice.

* MaxUser : This is the maximum allowed number of simultaneous listeners. This is, the max number of users that can be connected at the same time to your server. This one is a little tricky as it depends on your connection speed, so you might want to customize this to suit your needs.
Code:
MaxUser = [Upstream speed of your connection] * 0.9 / [Desired bitrate]

So lets suppose your upstream connection (the speed you can upload at) is 350, and the bitrate you want to serve your mp3's at is 32 kbps:

Code:
350 * 0.9 / 32 ~= 10 users

But be aware you can play around with this number, and you can even try to set it higher, but then you'll need a bunch of beta testers that might want to connect to your server and then report you how well it did, if they had connection problems, if the sound had glitches, etc...
So if you're not sure, set it to the number of users given by the above function (or even less).
* Password : This is the admin/broadcast password, that you will use to administer the server via a web-interface (more of this later) and to send the broadcast via the DSP plugin (next section..).As usual, enter a hard to break password, likely containing letters, numbers, punctuation characters and caps.
Notice there is an option to use this password as the one for broadcasters, and use another one for administration (separately that is), but for the sake of ease, lets just use this one for both functions.

Code:
Default:
Password=changeme
Example:
Password=YoU.W0nt.Bre4k.ME.587

* Portbase : Simply the port where your server will listen for client requests, aka the little door in your PC that clients will try to connect to (or open). Default value is recomended.
* AutoDumpUsers : Simply put, if you shut down the server, why dont you disconnect the clients too?

Code:
Default:
AutoDumpUsers=0
Recomended
AutoDumpUsers=1

Save the changes and close the file.

1.3 SHOUTcast DSP 1.8.2
This one directly also from Nullsoft. This is a Winamp Plugin that will allow you to send the real broadcast to the server you just configured, aka it will stream the mp3 so that it can be listened to.

Download :
Code:
http://www.shoutcast.com/downloads/shoutcast-dsp-1-8-2b-windows.exe

Installation
Close Winamp if its opened. Then, again, follow the "next->next->next" approach...

Once you're done, you'll want to check out if the plugin was installed correctly, and get ready for the next step.
Simply open Winamp, then hit Ctrl+P to open the preferences window:

Now close the preferences window, and the DSP dialog should be shown by now (and everytime you start Winamp).
At this point we have to configure the DSP plugin to start the broadcast.

Configuration
Now we'll take a look at the different tabs, and what we should fill in the different fields of these

* Main Tab: Its the worthless of them all. Basically it will show you the status of the different Outputs and the DeciBels.


* Output Tab: This is the most important of them all. Screw something here and you wont have your server streaming any sound



Lets go easy on this one.
The output part will show you which one of the 5 outputs are you configuring. What this means is that you can have your DSP plugin stream sounds to 5 different servers, thats all. For ease purposes, lets just leave it selected in the output #1 and forget about the others.
The status part will show more or less the same stuff that in the Main Tab. But whats important is the button connect. You are supossed to push it once all this configuration is done, to start broadcasting the sound right to your server. (Final step).

Now lets head over the Output Configuration part.
In the address field just write the IP or domain name for your server (the server you will be broadcasting to, that is). Notice that if your server is at the same computer where you will be using the winamp+DSP plugin, then you can just put localhost and thats it.
In the port field, put the Portbase value you configured for your server above, in the former section...
In the password field, put the Password value you configured for your server above, in the former section...
From the encoder list, just pick up 1, since basically you will be able to make 5 different configurations for 5 different outputs (remember?), so, since we'll be using just output, then we just configure 1 encoder, and this is the one we select here (more on encoders later)
Push the checkbox Enable Reconnection on Reconnection Failure, that means if there is a problem with your server, then the DSP plugin will try infinitely to reconnect until its up again

Now lets head over the Yellow Pages Configuration part.
The checkbox Make this server public (Recommended) basically will allow your server to be listed in www.shoutcast.com (http://www.shoutcast.com/) listings. Wheter you want to do this or not (you want to keep this private) its your call. Two things you need to have in account. First, your shoucast server needs to have a domain; if it has an IP, then you wont be listed there. And second, from the instant you begin the broadcast by pressing the button mentioned above, it will take from 10 to 15 minutes for your server to be listed there. Once its listed, it will look like this (I made a search for Billy Boy and thus I got my server among the results)

So as you can see, anyone going to www.shoutcast.com (http://www.shoutcast.com/) could find out about my server, and tune it. If you want to keep it private, then just dont click the checkbox, thats all.
In the Description field... well, just put your server description, to be shown in shoutcast listing as shown above, and this is also what your listeners will see in the music player playlist.
The URL field is usually an address where people who got to your server through the shoutcast listings, can find more information. This should be sort of your website or the radio's website. You get the picture. But please notice this URL has nothing to do with the Address field we went through before, they can be the same, but dont have to...
Now the Genre field is self-explanatory...
And finally the fields AIM, ICQ and IRC are just contact addresses, pretty much like URL so you know what to (or what not to) put in here...
* Encoder Tab: This one is simple. As explained before, choose the Encoder 1 item in the list, and select the appropiate Encoder Settings, aka the bitrate we even made a math formula above, remember?
In the Encoder Type field just leave the default value...

* Input Tab: This part will tell your Winamp what to broadcast, your MP3s (Winamp (Recommended)) that winamp is playing right now or...

Code:
Mom, I wanna be a real DJ

* Ok, sometimes, you'll want to broadcast your ugly voice :twisted: to your listeners (poor them)... How do you do that? Simple. You select Soundcard Input as your Input Device, change the Input Settings to what you consider and then pull out that dusty microphone and start speaking...
One tip here, you can dynamically change between Winamp (Recommended) and Soundcard Input as much as you want, and play to be like a real DJ in a radio station. Notice that when you change from Soundcard Input to Winamp (Recommended), if you take, lets say 10 seconds to hit the play button in winamp (to start playing a song), these 10 secs wont be streamed to your listeners, so you have time to speak, something among the lines "Now enjoy SongX", change the Input Device to Winamp (Recommended), search for the song in the playlist (or load it), then hit the play button. Your listeners will only listen to the "Now enjoy SongX" and right away the song, no interruptions in the middle. Rather cool, eh?

Now you're done. Hit the connect button in the Output Tab and you'll be broadcasting to your shoutcast server right away.

THIS WILL CONTINUE SOON,don't get mad at me!

Administration
You can now administer your shoutcast server from a web-based interface.
To access it, just go with your browser to

Code:
http://yourserver:port

Where yourserver is the value configured in the field address of the Output Tab in the DSP plugin, and port is the Portbase value you configured for your server
In the example we have been following along, its would be

Code:
http://www.billyboy.com:8000/

# And replace the href tag to what the link in Listen points to.

# Stream URL: Basically, the URL in Yellow Pages (DSP configuration dialog if I lost you here)
# Admin Login: This is where you play to be an admin. I will only tell you, to login you need a login/password combo. The login is just admin, and the password is the Password variable in the shoutcast configuration file (sc_serv.ini).
As I explained above, you could have a unique password for admin functions, if you fill in the field AdminPassword in the aforementioned ini file. (Just take away the ; (semicolon) and put the password you want.
If you enter a password there (in AdminPassword), then this is the one you will use here, otherwise just use the mentioned one (Password). If you're lost here, then nevermind and just forget what I said in the last 2 paragraphs (including this one)
Since I hate to be a party boomer, Ill let you enjoy the fun and test all of the options in the admin page by yourself.

Testing
Ok, so you have your server up and running, but now you need to somehow test it, to check out if everything is working as expected, right?
If you dont have two computers to test it, and knowing the fact that winamp wont allow two instances of itself to be running at the same time, what would you do? :roll:
So dont fear. There are a number of media players that support shoutcast streams, and we will look at one of them.
The name's XMPlay, and its a very lightweight media player, that can be freely downloaded from here

Code:
http://www.un4seen.com/files/xmplay32.zip

Now lets see what might be the URL your users will need in order to connect to your server. I explained in the subsection above how to get this URL by means of the admin panel, but if you want to know how do you get int manually, here it is

Code:
http://yourserver:port/listen.pls

Where yourserver is the value configured in the field address of the Output Tab in the DSP plugin, and port is the Portbase value you configured for your server.
In our now old and rusty example, it is

Code:
http://www.billyboy.com:8000/listen.pls

Then fire up XMPlay, press the key O (keyboard shortcut to open files/URL) and fill the appropiate value

Now you shoould be listening to your radio server!

Just FYI, in Winamp you open an URL with Ctrl+L.

2.1 Winamp
Refer to Section 1.1

2.2 Icecast 2.2.0
This one directly from the creators of the ogg sound format, among other open source niceties.

Download
Code:
http://downloads.us.xiph.org/releases/icecast/icecast2_win32_2.2.0_setup.exe

Installation
This is far easy. Just follow the "next, next, next" approach and you're done with it.

Configuration

So, we're all set to start configuring the server. Run it by using the shortcut in the desktop (Icecast2 Win32)

Ill just tell you the help is located in the About menu
The configuration is done by changing/adding values to an XML file, namely icecast.xml in C:\Program Files\Icecast2 Win32 (if you installed icecast in the standard path). If you're familiar with XML, then you have a slight advantage on your side.If you dont know XML or don't even know what it is, no problem, the configuration procedure is still piece of cake [like every thing in this tut ] http://www.infected-database.net/forum/Smileys/classic/tongue.gif
But I know there are some ''folks'' out there who like to learn something new, so the beginner point by excellence to learn XML is this one

Code:
http://www.w3schools.com/xml/default.asp

THIS WILL CONTINUE SOON,don't get mad at me!

winningfreak
12-31-2006, 08:09 PM
Already knew how to do this but I prefur Icecast :P

BIOHazard87
01-01-2007, 04:47 AM
Already knew how to do this but I prefur Icecast :P

whats the difference between icecast and shoutcast? jw