Contents of /xml/htdocs/doc/en/shoutcast-config.xml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.16 - (show annotations) (download) (as text)
Mon May 19 20:43:16 2008 UTC (10 years, 8 months ago) by swift
Branch: MAIN
Changes since 1.15: +174 -172 lines
File MIME type: application/xml
Coding style

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/shoutcast-config.xml,v 1.15 2006/11/02 18:52:48 nightmorph Exp $ -->
4 <guide link="/doc/en/shoutcast-config.xml">
5 <title>Streaming Radio With SHOUTcast</title>
7 <author title="Author">
8 <mail link="chriswhite@gentoo.org">Chris White</mail>
9 </author>
10 <author title="Editor">
11 <mail link="fox2mike@gentoo.org">Shyam Mani</mail>
12 </author>
14 <abstract>
15 This guide will walk through the steps needed to setup a streaming radio server
16 with SHOUTcast Server and SHOUTcast Trans.
17 </abstract>
19 <!-- The content of this document is licensed under the CC-BY-SA license -->
20 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
21 <license/>
23 <version>1.5</version>
24 <date>2006-11-02</date>
26 <chapter>
27 <title>Setting up SHOUTcast Server</title>
28 <section>
29 <title>Installing the files</title>
30 <body>
32 <p>
33 The SHOUTcast Server can be found in media-sound/SHOUTcast-server-bin. You can
34 install it with the following command:
35 </p>
37 <pre caption="Emerging SHOUTcast">
38 # <i>emerge shoutcast-server-bin</i>
39 </pre>
41 <p>
42 The SHOUTcast Server will now be installed. The next step is configuring your
43 new SHOUTcast Server.
44 </p>
46 </body>
47 </section>
48 <section>
49 <title>Configuring SHOUTcast Server</title>
50 <body>
52 <p>
53 Now that SHOUTcast Server is installed, it must be configured. The
54 configuration file can be found in <path>/etc/shoutcast/sc_serv.conf</path>.
55 Let's begin with the configuration. Make sure you are root, and open the
56 configuration file with your favorite editor. I choose vi for this example.
57 Now I'll bring up the file with vi:
58 </p>
60 <pre caption="Opening the configuration file">
61 # <i>vi /etc/shoutcast/sc_serv.conf</i>
62 </pre>
64 <p>
65 This will bring up the SHOUTcast Server configuration file for viewing.
66 From there you will see the configuration file and the different options
67 that you can set. Let's take a look on how to setup these particular options.
68 </p>
70 </body>
71 </section>
72 <section>
73 <title>Mandatory Options</title>
74 <body>
76 <pre caption="Setting the user limit">
77 <comment>; MaxUser. The maximum number of simultaneous listeners allowed.
78 ; Compute a reasonable value for your available upstream bandwidth (i.e. if
79 ; you have 256kbps upload DSL, and want to broadcast at 24kbps, you would
80 ; choose 256kbps/24kbps=10 maximum listeners.) Setting this value higher
81 ; only wastes RAM and screws up your broadcast when more people connect
82 ; than you can support.</comment>
83 MaxUser=10
84 </pre>
86 <p>
87 This is where the maximum number of users is set. As the caption states,
88 it is foolish to setup 100 users on a 256kbps upload (This is what I have set,
89 as my upload is about that). If you're running SHOUTcast Server to serve a
90 LAN, you can probably set this MUCH higher (to the 100 mentioned easily).
91 Please remember to not abuse whatever bandwidth you are using though. Bandwidth
92 comes at quite a high price to ISPs and some will cut your account, fine you
93 high costs to makeup, or both.
94 </p>
96 <pre caption="Setting the password">
97 <comment>; Password. While SHOUTcast never asks a listener for a password, a
98 ; password is required to broadcast through the server, and to perform
99 ; administration via the web interface to this server. This server should
100 ; consist of only letters and numbers, and is the same server your broadcaster
101 ; will need to enter in the SHOUTcast Source Plug-in for Winamp. THIS VALUE
102 ; CANNOT BE BLANK.</comment>
103 Password=a_hard_to_crack_password
104 </pre>
106 <p>
107 Here is where you setup the password. The password itself is clear text. For
108 security purposes, I STRONGLY recommend that you don't use passwords that are
109 used to access critical system components or other sensitive information.
110 Make this as random as possible, with a combination of letters and numbers.
111 This password will be what SHOUTcast Trans (or any other content provider)
112 will use to connect and provide streaming content.
113 </p>
115 <pre caption="Setting up your listening port">
116 <comment>; PortBase. This is the port number your server will run on. The
117 ; value, and the value + 1 must be available. If you get a fatal error when
118 ; the DNAS is setting up a socket on startup, make sure nothing else on the
119 ; machine is running on the same port (telnet localhost port number -- if you
120 ; get connection refused then you're clear to use that port). Ports less than 1024
121 ; may require root privileges on *nix machines. The default port is 8000.</comment>
122 PortBase=8000
123 </pre>
125 <p>
126 This value sets up what port users will connect to on your SHOUTcast Server.
127 The default is 8000, as it is what most mp3 server capable programs will
128 default to (Audacious, winamp, etc.). As it states, if you wish to use a port
129 less than 1024, you will need to be root. However, I strongly urge against
130 using any port lower than 1024 for your SHOUTcast Server.
131 </p>
133 <pre caption="Setting up logging">
134 <comment>; LogFile: file to use for logging. Can be '/dev/null' or 'none'
135 ; or empty to turn off logging. The default is ./sc_serv.log
136 ; on *nix systems or sc_serv_dir\sc_serv.log on win32.
137 ; Note: on win32 systems if no path is specified the location is
138 ; in the same directory as the executable, on *nix systems it is in the
139 ; current directory.</comment>
140 LogFile=/var/log/SHOUTcast.log
141 </pre>
143 <p>
144 This sets the location of the SHOUTcast server log file. The ebuild
145 has it set to /dev/null, so you will need to change it in order to get a real
146 log. I have it setup in the basic /var/log location. You can have it log to
147 wherever you need.
148 </p>
150 <pre caption="Enabling real time stats">
151 <comment>; RealTime displays a status line that is updated every second
152 ; with the latest information on the current stream (*nix and win32
153 ; console systems only)</comment>
154 RealTime=0
155 </pre>
157 <p>
158 This displays information on the current song to stdout every second. This
159 is disabled by the ebuild so that the SHOUTcast daemon can run as silently
160 as possible. Set this to 1 if you want these updates each second. However, I
161 recommend you use the status page instead.
162 </p>
164 <pre caption="Enabling real time logging">
165 <comment>; ScreenLog controls whether logging is printed to the screen or not
166 ; on *nix and win32 console systems. It is useful to disable this when
167 ; running servers in background without their own terminals. Default is 1</comment>
168 ScreenLog=0
169 </pre>
171 <p>
172 This is disabled by default in the ebuild to make the daemon run as
173 silently as possible. This will log any events (connects, disconnects, etc)
174 to stdout as they happen in real time. However, because the log file
175 does the same thing, I recommend using it instead.
176 </p>
178 <pre caption="Setting the last number of songs displayed">
179 <comment>; ShowLastSongs specifies how many songs to list in the /played.html
180 ; page. The default is 10. Acceptable entries are 1 to 20.</comment>
181 ShowLastSongs=10
182 </pre>
184 <p>
185 Just as it states, this value will set how many of the most recently played
186 /played.html will display. If you put more than 20, you should probably
187 consider more coffee.
188 </p>
190 <pre caption="Setting up filesystem modification logging">
191 <comment>; TchLog decides whether or not the DNAS log file should track yp
192 ; directory touches. Adds and removes still appear regardless of
193 ; this setting.
194 ; Default is yes
195 ; TchLog=yes</comment>
196 </pre>
198 <p>
199 This setting enables or disables logging for directory modifications
200 by the DNAS (Distributed Network Audio Server), or SHOUTcast for short.
201 Recommended for those who wish to have the most secure logging possible.
202 Basic home/casual users probably don't need this.
203 </p>
205 <pre caption="Enabling http request logging">
206 <comment>; WebLog decides whether or not hits to http:// on this DNAS will
207 ; be logged. Most people leave this off because the DSP plug-in
208 ; uses http:// calls to update titles and get the listener count,
209 ; which takes up a lot of log space eventually. If you want to
210 ; see people making hits on your admin.cgi or index pages, turn
211 ; this back on. Note that this setting does NOT affect XML stats
212 ; counters for hits to http:// pages.
213 ; Default is no.
214 ; WebLog=no</comment>
215 </pre>
217 <p>
218 This specifies whether or not you want to log hits to the HTTP server that
219 SHOUTcast provides. Once again, recommended for those who wish the most
220 secure logging possible, but not recommended for home/casual users.
221 </p>
223 <pre caption="Enabling W3C Logging">
224 <comment>; W3CEnable turns on W3C Logging. W3C logs contain httpd-like accounts
225 ; of every track played for every listener, including byte counts those listeners
226 ; took. This data can be parsed with tools like Analog and WebTrends, or given
227 ; to third parties like Arbitron and Measurecast for their reporting systems.
228 ; Default is Yes (enabled).</comment>
229 W3CEnable=Yes
231 <comment>; W3CLog describes the name of the log file for W3C logging. Default log file is
232 ; sc_w3c.log, in the same directory wherever the DNAS gets started from.</comment>
233 W3CLog=/dev/null
234 </pre>
236 <p>
237 The first option enables W3C logging. This type of logging can be easily parsed
238 by the programs listed. This is highly recommended for those who wish to
239 have the most in depth statistics possible. The second option specifies where
240 to store the W3C log. This is set to /dev/null by the ebuild.
241 </p>
243 </body>
244 </section>
245 <section>
246 <title>Network Configuration</title>
247 <body>
249 <pre caption="Setting the source IP">
250 <comment>; SrcIP, the interface to listen for source connections on (or to make relay
251 ; connections on if relaying). Can and usually will be ANY or
252 ; (Making it will keep other machines from being able to
253 ; broadcast using your SHOUTcast Server )</comment>
254 SrcIP=ANY
255 </pre>
257 <p>
258 The SrcIP variable sets what IP streaming content is coming from. This can
259 be another server (relaying), localhost (regular), or any other IP that your
260 interface supports. Setting to localhost prevents any other server from
261 using your SHOUTcast Server as a broadcast source. The default is ANY
262 and will cause your SHOUTcast Server to source from any IP. Security wise, it
263 is better to set this to something specific.
264 </p>
266 <pre caption="Setting the destination IP">
267 <comment>; DestIP, IP to listen for clients on (and to contact yp.SHOUTcast.com)
268 ; can and usually will be be ANY. If your machine has multiple IP addresses,
269 ; set this to the one you want it to be accessed by.</comment>
270 DestIP=ANY
271 </pre>
273 <p>
274 This determines which IP on your interface you will allow users to connect to.
275 This can be localhost (if you're anti-social and wish only to
276 stream to yourself), a private IP (for instance,, for hosting to
277 a local network), or your external IP (for instance,, for
278 streaming to a WAN, but not a LAN). In most cases, you can reach your own
279 stream by using instead of what is listed here. ANY lets your
280 SHOUTcast Server bind to all IP addresses on all available interfaces.
281 </p>
283 <pre caption="Setting proxy/yp.SHOUTcast.com port">
284 <comment>; Yport, port to connect to yp.SHOUTcast.com on. For people behind caching
285 ; web proxies, change this to the alternate port (666 is what it might be,
286 ; check www.SHOUTcast.com if you have problems). Otherwise, leave this at 80.
287 ; We're actively working on re-opening port 666, but as of release the only
288 ; working port is port 80.</comment>
289 Yport=80
290 </pre>
292 <p>
293 This has 2 functions. First is the port to connect to yp.SHOUTcast.com with.
294 yp.SHOUTcast.com is nullsoft's page for public servers so users know where to
295 listen in on. Users can search for your station from this page. The
296 secondary use is for web proxies. Set this to the port you use for proxy
297 connects, and set DestIP to your proxy for streaming.
298 </p>
300 <pre caption="Setting up reverse DNS">
301 <comment>; NameLookups. Specify 1 to perform reverse DNS on connections.
302 ; This option may increase the time it takes to connect to your
303 ; server if your DNS server is slow. Default is 0 (off).</comment>
304 NameLookups=0
305 </pre>
307 <p>
308 This option specifies whether or not you want to perform reverse DNS lookups
309 on clients. This would take an IP address and try to find out the corresponding
310 host name. Use this for logging purposes to create a more detailed report.
311 </p>
313 <pre caption="Setting up relaying">
314 <comment>; RelayPort and RelayServer specify that you want to be a relay server.
315 ; Relay servers act as clients to another server, and rebroadcast.
316 ; Set RelayPort to 0, RelayServer to empty, or just leave these commented
317 ; out to disable relay mode.
318 ; RelayPort=8000
319 ; RelayServer=</comment>
320 </pre>
322 <p>
323 This specifies that you are acting as a relay server. Relay servers are
324 often used to take a low bandwidth connection that can only stream to one
325 client, and use its own higher bandwidth to serve to more clients. RelayPort
326 specifies the port and IP address of the SHOUTcast Server you wish to
327 relay for. Comment this out if you don't plan on using your server as a relay.
328 </p>
330 </body>
331 </section>
332 <section>
333 <title>Server Configuration</title>
334 <body>
336 <pre caption="Setting the admin password">
337 <comment>; AdminPassword. This password (if specified) changes the
338 ; behavior of Password to be a broadcast-only password, and
339 ; limits HTTP administration tasks to the password specified
340 ; here. The broadcaster, with the password above, can still
341 ; log in and view connected users, but only the AdminPassword
342 ; will grant the right to kick, ban, and specify reserve hosts.
343 ; The default is undefined (Password allows control for both
344 ; source and admin)
345 ; AdminPassword=adminpass</comment>
346 </pre>
348 <p>
349 Setting this will create a broadcaster and administrator. The broadcaster can
350 log in with Password, and view connections. However, should the person want
351 to kick/ban/administer the server, they must have the Admin password. This
352 option creates more specific roles for your server. This is recommended for
353 instances where the system administrator is not the same person as the
354 broadcaster.
355 </p>
357 <pre caption="Setting up auto user disconnect">
358 <comment>; AutoDumpUsers controls whether listeners are disconnected if the source
359 ; stream disconnects. The default is 0.</comment>
360 AutoDumpUsers=0
361 </pre>
363 <p>
364 This specifies whether or not users are kicked out if the stream disconnects
365 for any reason. This is set to 0, so that clients will either timeout
366 themselves, or keep trying to buffer a stream. Use this if you expect
367 short interruptions at any time.
368 </p>
370 <pre caption="Setting up the source timeout">
371 <comment>; AutoDumpSourceTime specifies how long, in seconds, the source stream is
372 ; allowed to be idle before the server disconnects it. 0 will let the source
373 ; stream idle indefinitely before disconnecting. The default is 30.</comment>
374 AutoDumpSourceTime=30
375 </pre>
377 <p>
378 This specifies when the SHOUTcast Server should give up waiting for a source
379 (mainly a relay server) to stream content from. Anywhere from 30 to 60 should be
380 a reasonable value for this.
381 </p>
383 <pre caption="Setting up the content directory">
384 <comment>; ContentDir specifies the directory location on disk of where to stream
385 ; on-demand content from. Subdirectories are supported as of DNAS 1.8.2.
386 ; Default is ./content/, meaning a directory named content in the same directory
387 ; as where sc_serv was invoked from.</comment>
388 ContentDir=/opt/SHOUTcast/content/
389 </pre>
391 <p>
392 The ContentDir specifies where to put on demand content. For example, if you
393 wish to stream an announcement to employees, you could use this for that
394 purpose. The SHOUTcast Server ebuild sets this to
395 <path>/opt/SHOUTcast/content</path> for you. To use this, put an mp3 in the
396 content directory, then point your browser to
397 <c>http://example.com:[port]/content/mp3name.pls</c>. SHOUTcast Server will
398 automatically create a streaming media compatible play list for the mp3, and
399 stream it on demand. Use this as an alternative to SHOUTcast Trans for
400 streaming media source.
401 </p>
403 <pre caption="Setting up an intro file">
404 <comment>; IntroFile can specify a mp3 file that will be streamed to listeners right
405 ; when they connect before they hear the live stream.
406 ; Note that the intro file MUST be the same sample rate/channels as the
407 ; live stream in order for this to work properly. Although bit rate CAN
408 ; vary, you can use '%d' to specify the bit rate in the filename
409 ; (i.e. C:\intro%d.mp3 would be C:\intro64.mp3 if you are casting at 64kbps).
410 ; The default is no IntroFile
411 ; IntroFile=c:\intro%d.mp3</comment>
412 </pre>
414 <p>
415 This allows you to configure an intro file. Every time users connect, they'll
416 hear this file played. As it states, the stream bit rate and the intro song
417 bit rate must match, or else things will break. You can, however, put
418 something such as intro128.mp3 and intro64.mp3, and it will play intro128.mp3
419 to users connecting to a 128kbps stream, and intro64 for users connecting at
420 64kbps.
421 </p>
423 <pre caption="Setting up a back file">
424 <comment>; BackupFile can specify a mp3 file that will be streamed to listeners over
425 ; and over again when the source stream disconnects. AutoDumpUsers must be
426 ; 0 to use this feature. When the source stream reconnects, the listeners
427 ; are rejoined into the live broadcast.
428 ; Note that the backup file MUST be the same sample rate/channels as the
429 ; live stream in order for this to work properly. Although bit rate CAN
430 ; vary, you can use '%d' to specify the bit rate in the filename
431 ; (i.e. C:\backup%d.mp3 would be C:\backup32.mp3 if you are casting at 32kbps).
432 ; The default is no BackupFile
433 ; BackupFile=C:\intro%d.mp3</comment>
434 </pre>
436 <p>
437 This is the same as above, but will be played when the stream source ends,
438 instead of when users disconnect. This will only work if AutoDumpUsers is set
439 to 0.
440 </p>
442 <pre caption="Setting up a title format">
443 <comment>; TitleFormat specifies a format string for what title is sent to the listener.
444 ; For example, a string of 'Justin Radio' forces the title 'Justin Radio' even
445 ; when the source changes the title. You can use up to one '%s' in the string
446 ; which lets you contain the title from the source. For example, if your
447 ; TitleFormat is 'Justin Radio: %s', and the source plug-in's title is
448 ; 'Billy plays the blues', then the net title is
449 ; 'Justin Radio: Billy plays the blues'. Note: only works on non-relay servers.
450 ; The default is no format string.</comment>
451 TitleFormat=Chris Gentoo Beats: %s
452 </pre>
454 <p>
455 This sets up a non-variable title for your Shoutcast server. Use this if your
456 source stream differs from your SHOUTcast Server's name. This will NOT work
457 with relay servers.
458 </p>
460 <pre caption="Setting up a URL format">
461 <comment>; URLFormat specifies a format string for what URL is sent to the listener.
462 ; Behaves like TitleFormat (see above).
463 ; The default is no format string.
464 ; URLFormat=http://www.server.com/redirect.cgi?url=%s</comment>
465 </pre>
467 <p>
468 This is the same as TitleFormat except that the URL listed above is used
469 instead of the source stream's URL.
470 </p>
472 <pre caption="Setting up the public status of a source stream">
473 <comment>; PublicServer can be always, never, or default (the default, heh)
474 ; Any setting other than default will override the public status
475 ; of the source plug-in or of a SHOUTcast Server that is being relayed.</comment>
476 PublicServer=default
477 </pre>
479 <p>
480 This specifies whether or not you want to be listed as a public server even if
481 your relay server/source plug-in is listed as such.
482 </p>
484 <pre caption="Allowing relaying">
485 <comment>; AllowRelay determines whether or not other SHOUTcast Servers will be
486 ; permitted to relay this server. The default is Yes.</comment>
487 AllowRelay=Yes
488 </pre>
490 <p>
491 AllowRelay determines if other servers are allowed to relay your content.
492 If you don't think you'll ever relay at all, set this to No.
493 </p>
495 <pre caption="Allowing relays to publically display the source">
496 <comment>; AllowPublicRelay, when set to No, will tell any relaying servers not
497 ; to list the server in the SHOUTcast directory (non-public), provided
498 ; the relaying server's Public flag is set to default. The default is
499 ; Yes.</comment>
500 AllowPublicRelay=Yes
501 </pre>
503 <p>
504 AllowPublicRelay specifies whether or not you wish to be listed in the
505 SHOUTcastpublic directory if the server you're relaying to is already listed.
506 Note that PublicServer can override this setting.
507 </p>
509 <pre caption="Setting MetaInterval">
510 <comment>; MetaInterval specifies how often, in bytes, meta data sent.
511 ; You should really leave this at the default of 32768, but the option is
512 ; provided anyway.</comment>
513 MetaInterval=32768
514 </pre>
516 <p>
517 Just leave this as is.
518 </p>
520 </body>
521 </section>
522 <section>
523 <title>Access Configuration</title>
524 <body>
526 <pre caption="Setting the max listner time">
527 <comment>; ListenerTimer is a value in minutes of maximum permitted time for
528 ; a connected listener. If someone is connected for longer than this
529 ; amount of time, in minutes, they are disconnected. When undefined,
530 ; there is no limit defined. Default is undefined.
531 ; ListenerTimer=600</comment>
532 </pre>
534 <p>
535 I'm not to sure why you'd need this one. Basically, if a user is on for too
536 many minutes, disconnect them. Only thing I can think of is to kick idlers
537 off, or people you think should be doing other things than listening to your
538 stream. Value is measured in minutes.
539 </p>
541 <pre caption="Setting up the ban file">
542 <comment>; BanFile is the text file sc_serv reads and writes to/from
543 ; for the list of clients prohibited to connect to this
544 ; server. It's automatically generated via the web
545 ; interface.
546 ; BanFile=sc_serv.ban</comment>
547 </pre>
549 <p>
550 This is the filename for the list of clients that are banned from your server.
551 The default is sc_serv.ban, but you can use whatever name you so desire with
552 this setting.
553 </p>
555 <pre caption="Setting the Rip list">
556 <comment>; RipFile is the text file sc_serv reads and writes to/from
557 ; for the list of client IP addresses which are *ALWAYS* permitted
558 ; to connect to this server (useful for relay servers).
559 ; This file is automatically generated via the web
560 ; interface. Note that if your server is FULL, and someone
561 ; from a Reserved IP connects, the DNAS will force the person
562 ; listening for the longest time off to make room for the new
563 ; connection.
564 ; RipFile=sc_serv.rip</comment>
565 </pre>
567 <p>
568 As grim as it sounds, Rip actually stands for "Reserved IP". Use this for
569 your friends or other people you consider more important than random users.
570 If you are currently streaming to the max number of users possible, and one
571 of your rip members tries to get on, it will kick the longest listening person
572 from the server to get them on.
573 </p>
575 <pre caption="Setup if Rip only users can access your server">
576 <comment>; RipOnly, when set to Yes, will only allow IP addresses listed in the Reserved
577 ; IP list to connect and relay. All other connections for listening will be denied.
578 ; This is really only useful for servers whose sole purpose is to provide the
579 ; primary feed to all public relays. Setting this value to Yes also forces the
580 ; server into Private mode, since listing this server in the directory would
581 ; be pointless. Default is No.
582 ; RipOnly=No</comment>
583 </pre>
585 <p>
586 This allows for only Rip members to connect to your SHOUTcast Server. You can
587 either use this for private radio streams, or to make it so that only certain
588 relays will be able to access your stream.
589 </p>
591 </body>
592 </section>
593 <section>
594 <title>Mass Configuration</title>
595 <body>
597 <pre caption="Setting Unique variables">
598 <comment>; Unique: assigns a variable name for use in any configuration item which points to a
599 ; file. Useful for servers running lots of SHOUTcast Servers that have similar
600 ; configuration parameters, excepting log file names, ban file names, etc. Any
601 ; parameter that takes a pathname can include the character $, which will
602 ; substitute $ for the variable assigned here. Keep in mind that the unique
603 ; variable can only be used after it is defined, so don't try to use a unique
604 ; variable substitution in a path before you define it. For example, you
605 ; could set:
606 ; Unique=my_server
607 ; and then define Log=/usr/local/SHOUTcast/$.log in an included configuration
608 ; file. Default is Unique=$, so that by default any file with $ in the name
609 ; won't substitute anything at all.</comment>
610 </pre>
612 <p>
613 Basically, if you're running lots of SHOUTcast Servers, it would be a dire
614 pain to change all the log/ban/etc. files to something unique for every
615 configuration. Instead, you can set Unique to something, and $ will be
616 replaced with whatever Unique is set to. For example, if one file had
617 Unique=Jazz and another had Unique=Rock, then Log=/var/log/$.log would
618 produce /var/log/Jazz.log on one configuration file and /var/log/Rock.log
619 on another configuration file. Much easier when dealing with multiple
620 SHOUTcast Servers on similar configurations.
621 </p>
623 <pre caption="Setting up common configure variables">
624 <comment>; Include: instructs the sc_serv to read from the named configuration file,
625 ; *at the point of insertion of the Include statement*, and process as though
626 ; the included file was part of itself. Note that all configuration parameters
627 ; in the DNAS configuration file are processed first to last, so if an item is defined
628 ; twice in a configuration, the last item to process will be the one that takes
629 ; effect. For this reason, it's usually a good idea to use the Includes first
630 ; in a configuration file.
631 ; example:
632 ; Include=/usr/local/SHOUTcast/common.conf
633 ; Default is not applicable.</comment>
634 </pre>
636 <p>
637 If you're running multiple SHOUTcast Servers and wish to utilize similar
638 configuration variables without setting them all for each configuration
639 file, you can set this to point to a file that contains settings that are
640 similar between multiple configurations.
641 </p>
643 </body>
644 </section>
645 <section>
646 <title>Optimization Configuration</title>
647 <body>
649 <pre caption="Setup number of CPU's utilized">
650 <comment>; CpuCount is used to explicitly limit the DNAS to dominating a finite
651 ; amount of processors in multiprocessor systems. By default,
652 ; SHOUTcast creates one thread for every processor it detects in the
653 ; host system, and assigns listeners equally across all the threads.
654 ; In the event SHOUTcast doesn't correctly determine the number of
655 ; CPUs in your host, or if you for whatever reason want to force
656 ; the DNAS to not use other processors, you can say so here.
657 ; Default behavior is to use as many processors as the DNAS detects on
658 ; your system.
659 ; CpuCount=1</comment>
660 </pre>
662 <p>
663 On multiple CPU systems, use this setting to force the SHOUTcast Server to
664 utilize CpuCount # of processors. The default to assign one thread to each
665 processor, and have listeners across all the threads. If you set this lower
666 than your total processor count, this will leave processors free to do other
667 things.
668 </p>
670 <pre caption="Setup data submission gap">
671 <comment>; Sleep defines the granularity of the client threads for sending data.
672 ; DNAS 1.7.0, per client thread, will send up to 1,024 bytes of data
673 ; per socket (or less depending on the window available), and then
674 ; sleep for the provided duration before repeating the whole process.
675 ; Note that making this value smaller will vastly increase CPU usage on
676 ; your machine. Increasing reduces CPU, but increasing this value too far
677 ; will cause skips. The value which seems most optimal for 128kbps
678 ; streaming is 833 (833 microseconds per client poll) on our test labs.
679 ; We wouldn't recommend setting it any lower than 100, or any higher than
680 ; 1,024. If you have a slower machine, set this number lower to fix
681 ; skips.
682 ; Default value is 833.
683 ; Sleep=833</comment>
684 </pre>
686 <p>
687 The SHOUTcast Server will use the sleep value in determining the gap between
688 sending data. The higher the value, the longer the gap, the lower the value,
689 the shorter the gap and the more CPU usage SHOUTcast Server will take up. On
690 slower systems, as it states, you might want to lower this so that the
691 SHOUTcast Servers sends data more and more frequently to users. Best to leave
692 as is.
693 </p>
695 <pre caption="Setup XML output">
696 <comment>; CleanXML strips some whitespace and line feeds from XML output which
697 ; confuses some (poorly written) XML parsers. If you get XML rendering errors,
698 ; try turning this on. Default is No (off).
699 ; CleanXML=No</comment>
700 </pre>
702 <p>
703 Probably don't need to worry about this setting to much unless you use custom
704 XML parsers to create custom statistics for you server. If the XML parser
705 cannot handle whitespace and line feeds in XML, set this to Yes, and all should
706 work.
707 </p>
709 </body>
710 </section>
711 <section>
712 <title>Configuration Conclusion</title>
713 <body>
715 <p>
716 Your SHOUTcast Server should now be configured. For businesses that are using
717 SHOUTcast, I recommend turning on WC3 logging, as it can be easily parsed, and
718 used for creating custom statistics. You should also enable the
719 AdministratorPassword. You might also wish to enable some of the mass
720 configuration options if you're creating multiple SHOUTcast Servers.
721 </p>
723 <p>
724 With the configuration setup, we'll now work on getting SHOUTcast up and
725 running. We'll start with simple on demand streaming for a simple startup,
726 then work on SHOUTcast Trans later (as it is somewhat more involved).
727 </p>
729 </body>
730 </section>
731 </chapter>
733 <chapter>
734 <title>Getting started with SHOUTcast Server</title>
735 <section>
736 <title>Setting up on demand streaming</title>
737 <body>
739 <p>
740 On demand streaming, as shown in the configuration chapter, automatically sets
741 up on demand play lists for mp3 files in the content directory. The Shoutcast
742 server ebuild has a directory setup in /opt/SHOUTcast/content for all your on
743 demand mp3's. Let's get started by creating a simple on demand streaming mp3.
744 </p>
746 <p>
747 First we'll need to get an mp3 from somewhere and put it in the content
748 directory. We'll take this sample.mp3 file from an /Mp3 directory I have
749 created.
750 </p>
752 <pre caption="Copying an mp3 to the content directory">
753 # <i>cp sample.mp3 /opt/SHOUTcast/content/</i>
754 # <i>cd /opt/SHOUTcast/content/</i>
755 # <i>ls</i>
756 sample.mp3
757 </pre>
759 <p>
760 OK, so the file is copied over now. Now we'll need to startup our SHOUTcast
761 Server so the file can be accessed.
762 </p>
764 <pre caption="Starting up the Shoutcast Server">
765 # <i>/etc/init.d/shoutcast start</i>
766 * Starting Shoutcast Server...
767 *******************************************************************************
768 ** SHOUTcast Distributed Network Audio Server
769 ** Copyright (C) 1998-2004 Nullsoft, Inc. All Rights Reserved.
770 ** Use "sc_serv filename.ini" to specify an ini file.
771 *******************************************************************************
772 [ ok ]
773 </pre>
775 <p>
776 The little banner is there to make sure that nothing dies right away (i.e. so
777 you know your server actually started). Your SHOUTcast Server is now started!
778 Because of the nature of on demand content, you will ONLY be able to access it
779 from a browser. MPlayer or anything else won't be able to stream it as is. I
780 use kmplayer in order to access the stream directly from my browser. You can
781 see the result on the next image.
782 </p>
784 <figure caption="On Demand Content" short="OnDemandContent"
785 link="/images/docs/shoutcast-OnDemandContent.jpg" />
787 <p>
788 Some people have Audacious setup to handle their audio mime types, so your
789 browser may spawn Audacious up in order to play the resulting streaming
790 content. Now that you are able to work with on demand content, we'll now work
791 on using SHOUTcast Trans to create a true streaming radio server.
792 </p>
794 </body>
795 </section>
796 </chapter>
798 <chapter>
799 <title>Setting up SHOUTcast Trans</title>
800 <section>
801 <title>SHOUTcast Trans introduction</title>
802 <body>
804 <p>
805 SHOUTcast Trans stands for SHOUTcast Trans(coder), as it is able to transcode
806 mp3's to lower or higher bit rates. SHOUTcast Trans works by streaming mp3's
807 from a play list specified in the configuration file. We'll begin to setup the
808 configuration for SHOUTcast Trans, so that we can have a real to goodness
809 streaming radio station. We'll begin by opening the configuration file for
810 SHOUTcast Trans, which just so happens to be located in
811 /etc/shoutcast/sc_trans.conf.
812 </p>
814 <pre caption="Opening the SHOUTcast Trans configuration file">
815 <comment>(First install SHOUTcast Trans)</comment>
816 # <i>emerge shoutcast-trans-bin</i>
817 <comment>(Next open the SHOUTcast Trans configuration file)</comment>
818 # <i>vi /etc/shoutcast/sc_trans.conf</i>
819 </pre>
821 <p>
822 Now that we have the SHOUTcast Trans configuration file open, we'll begin to
823 setup the streaming source.
824 </p>
826 </body>
827 </section>
828 <section>
829 <title>Configuring SHOUTcast Trans</title>
830 <body>
832 <pre caption="Setting up the playlist">
833 <comment>; PlaylistFile (required EVEN IF RELAYING) - play list file (to create, use
834 ; find /path/to/mp3/directory -type f -name "*.mp3" &gt; playlist_filename.lst</comment>
835 PlaylistFile=/opt/SHOUTcast/playlists/playlist.lst
836 </pre>
838 <p>
839 This setting tells SHOUTcast where to find its streaming media content from.
840 This setting requires an existing file, so let's go ahead and create a
841 play list. I'll create one real quick from my /Mp3 directory referred to
842 earlier.
843 </p>
845 <pre caption="Creating the playlist">
846 # <i>find /Mp3 -type f -name "*.mp3" &gt; /opt/SHOUTcast/playlists/playlist.lst</i>
847 </pre>
849 <p>
850 Now that the play list is setup, we point the configuration file to it, and
851 SHOUTcast Trans will now know what files to stream.
852 </p>
854 <pre caption="Setting the server IP and port">
855 <comment>; Serverip/ServerPort are the target server to send to</comment>
856 Serverip=
857 ServerPort=8000
858 </pre>
860 <p>
861 This setting decides where to send the streaming content. In this guide,
862 it will be the SHOUTcast Server's IP and port that you setup previously
863 (DestIP and PortBase).
864 </p>
866 <pre caption="Setting the SHOUTcast Server password">
867 <comment>; Password is the password on the sc_serv you're sending to.</comment>
868 Password=password_you_setup_in_sc_serv.conf
869 </pre>
871 <p>
872 The is the same password that you setup in the SHOUTcast Server configuration.
873 </p>
875 <pre caption="Setting up your stream information">
876 <comment>; StreamTitle/URL/Genre define the data that appears on the directory and in the
877 ; stream info.</comment>
878 StreamTitle=Chris Gentoo Beats
879 StreamURL=http://www.gentoo.org
880 Genre=JPOP Electronica And More!
881 </pre>
883 <p>
884 This sets up the title of your stream (i.e. Radio One), the URL (i.e.
885 http://www.radio-one.com), and the Genre (i.e. Electronica Trance Tribal).
886 </p>
888 <pre caption="Setting up your logfile">
889 <comment>; Logfile optionally denotes a text file to log sc_Trans to. a kill -HUP
890 ; will force a close and re-open of this file (but will also cease logging to
891 ; the console)</comment>
892 LogFile=/var/log/sc_Trans.log
893 </pre>
895 <p>
896 This will point to the log file for SHOUTcast Trans. All your logging goes
897 here.
898 </p>
900 <pre caption="Setting up shuffling">
901 <comment>; Shuffle the play list</comment>
902 Shuffle=1
903 </pre>
905 <p>
906 Decide on whether or not you want your play list to play random songs from your
907 list each time. Most will set this to 1. If you're going to be accepting
908 song requests, set this to 0 and I'll explain how to do that later on.
909 </p>
911 <pre caption="Setting up the stream">
912 <comment>; Bitrate/SampleRate/Channels recommended values:
913 ; 8kbps 8000/11025/1
914 ; 16kbps 16000/11025/1
915 ; 24kbps 24000/22050/1
916 ; 32kbps 32000/22050/1
917 ; 64kbps mono 64000/44100/1
918 ; 64kbps stereo 64000/22050/2
919 ; 96kbps stereo 96000/44100/2
920 ; 128kbps stereo 128000/44100/2</comment>
921 Bitrate=128000
922 SampleRate=44100
923 Channels=2
924 <comment>; Quality is from 1-10. 1 is best, 10 is fastest.</comment>
925 Quality=1
926 </pre>
928 <p>
929 Bitrate sets up the bit rate for your stream. This can be from 8000 (8kbps) to
930 128000 (128kbps). SampleRate sets the sampling rate of the stream. This can
931 be anything from 11025 (11025kHz) to 44100 (44100kHz). Channels sets how
932 many channels your stream will broadcast. This can be anything from 1 (mono)
933 to 2 (stereo). Quality sets the stream quality. This is somewhat still
934 controlled by the Bitrate/SampleRate/Channels. This is where you deal with
935 how compressed the stream is. 1 gives you best quality, 10 gives you the best
936 speed. Keep your connection in mind when you set these values! Use the guide
937 given in order to figure out what your mp3's should be streamed at.
938 </p>
940 <pre caption="Setting up crossfading">
941 <comment>; Mode=0 for none, 1 for 100/100->100/0, 2 for 0/100->100/0</comment>
942 CrossfadeMode=1
943 <comment>; Length is ms.</comment>
944 CrossfadeLength=8000
945 </pre>
947 <p>
948 This sets up song cross fading. Setting this to 0 will disable cross fading.
949 If you set it to 1, Song 1 will fade out and Song 2 will fade in. If you set
950 it to 2, Song 1 will fade in and Song 2 will fade out. The length is how long
951 in ms the cross fade occurs.
952 </p>
954 <pre caption="Enabling ID3 usage">
955 UseID3=1
956 </pre>
958 <p>
959 This decides whether or not you wish to use the ID3 tag for information about
960 the mp3.
961 </p>
963 <pre caption="Setting up public status">
964 <comment>; Public determines whether or not this station will show up in the directory</comment>
965 Public=0
966 </pre>
968 <p>
969 This sets up whether or not streams should be publicly listed when relaying to
970 a server. Remember PublicServer in sc_serv.conf can over-ride this!
971 </p>
973 <pre caption="Setting up user interaction">
974 <comment>; Put stuff here for user interaction (AOL IM, ICQ, IRC)</comment>
975 AIM=AIMHandle
976 ICQ=
977 IRC=SHOUTcast
978 </pre>
980 <p>
981 This sets up the information on how to reach you (the DJ). You can setup AIM
982 or ICQ channels for song requests/anything. You can setup your own IRC channel
983 as well, so that you can interact with multiple users at once.
984 </p>
986 </body>
987 </section>
988 <section>
989 <title>SHOUTcast Trans Setup Conclusion</title>
990 <body>
992 <p>
993 Your SHOUTcast Trans is now ready to stream to your SHOUTcast Server! We'll
994 now get started on streaming your mp3's.
995 </p>
997 </body>
998 </section>
999 </chapter>
1001 <chapter>
1002 <title>Getting Started With SHOUTcast Trans</title>
1003 <section>
1004 <title>Starting up SHOUTcast Trans</title>
1005 <body>
1007 <p>
1008 As I most often use SHOUTcast Trans with SHOUTcast Server, I tend to startup
1009 SHOUTcast Trans, which in turns starts up SHOUTcast for you (much easier). So
1010 we'll go ahead and get SHOUTcast Trans started.
1011 </p>
1013 <pre caption="Starting up Shoutcast Trans and Shoutcast Server">
1014 # <i>/etc/init.d/shoutcast_trans start</i>
1015 * Starting Shoutcast Server...
1016 *******************************************************************************
1017 ** SHOUTcast Distributed Network Audio Server
1018 ** Copyright (C) 1998-2004 Nullsoft, Inc. All Rights Reserved.
1019 ** Use "sc_serv filename.ini" to specify an ini file.
1020 *******************************************************************************
1021 [ ok ]
1022 * Starting Shoutcast Trans... [ ok ]
1023 </pre>
1025 </body>
1026 </section>
1027 <section>
1028 <title>Listening to the SHOUTcast Trans stream</title>
1029 <body>
1031 <p>
1032 Now that SHOUTcast Trans is started, we'll start listening to the stream. I
1033 use MPlayer in this example to play the stream.
1034 </p>
1036 <pre caption="Listening to your stream">
1037 # <i>mplayer -cache 1024</i>
1038 ...
1039 Playing
1040 Connecting to server[]:8000 ...
1041 Name : Chris Gentoo Beats
1042 Genre : JPOP Electronica And More!
1043 Website: http://www.gentoo.org
1044 Public : no
1045 Bitrate: 128kbit/s
1046 Cache size set to 1024 KBytes
1047 Connected to server:
1048 Cache fill: 9.38% (98304 bytes) Audio file detected.
1049 ==========================================================================
1050 Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
1051 MP3lib: init layer2 and 3 finished, tables done
1052 mpg123: Can't rewind stream by 156 bits!
1053 AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 16000->176400 (128.0 kbit)
1054 Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
1055 ==========================================================================
1056 Checking audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
1057 AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
1058 AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
1059 AO: [oss] 44100Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
1060 Building audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
1061 Video: no video
1062 Starting playback...
1063 </pre>
1065 <p>
1066 This was somewhat clipped. The -cache variable was put in to over-ride my
1067 somewhat larger buffering settings. And viola! You're now listening to
1068 streaming media! In the next chapter, we'll show you how to do a little
1069 bit more with your SHOUTcast Server.
1070 </p>
1072 </body>
1073 </section>
1074 </chapter>
1076 <chapter>
1077 <title>Advanced SHOUTcast Usage</title>
1078 <section>
1079 <title>Business Usage</title>
1080 <body>
1082 <p>
1083 Businesses can use SHOUTcast in a number of ways:
1084 </p>
1086 <ol>
1087 <li>
1088 Use on demand content streaming to make more interesting daily
1089 announcements.
1090 </li>
1091 <li>
1092 Have streaming public announcements available as they happen, let your
1093 clients know what's going on, on the spot! Then archive them as on
1094 demand content streaming for future reference.
1095 </li>
1096 <li>
1097 Do interviews as streaming media and archive them as on demand content
1098 streaming.
1099 </li>
1100 </ol>
1102 <p>
1103 There are more possibilities on how to utilize SHOUTcast Server for businesses.
1104 Use live streaming media instead of boring old text!
1105 </p>
1107 </body>
1108 </section>
1109 <section>
1110 <title>DJ-ing with SHOUTcast</title>
1111 <body>
1113 <p>
1114 SHOUTcast Server is one of the most popular servers for both new and veteran
1115 DJs alike. For those just starting, there are a few ways to increase the
1116 user experience of your SHOUTcast Server. Having an intro song is very key.
1117 It gives the users an idea of what your station is all about. Be sure to
1118 include this! Post your server on yp.SHOUTcast.com (described in the
1119 SHOUTcast Server configuration section) so that everyone knows where you
1120 are. One of the most unique things is to be able to take requests. To set
1121 up requesting, first turn Shuffle off in sc_Trans.conf. Have about, I'd say,
1122 10 or so songs ready to get you started. Then start requesting song requests
1123 in the middle. When someone requests a song, simple add it to the end of your
1124 play list, and then you can use this script here to control what SHOUTcast
1125 Trans does with your play list:
1126 </p>
1128 <pre caption="djcontrol">
1129 <comment>#!/bin/bash</comment>
1131 case "$1" in
1132 "reload")
1133 kill -s USR1 `cat /var/run/SHOUTcast_Trans.pid`
1134 ;;
1135 "next")
1136 kill -s WINCH `cat /var/run/SHOUTcast_Trans.pid`
1137 ;;
1138 *)
1139 echo "Invalid command"
1140 ;;
1141 esac
1142 </pre>
1144 <p>
1145 When you've added the song to the play list, you need to tell SHOUTcast Trans
1146 that your play list has changed with the new request entry.
1147 </p>
1149 <pre caption="Reloading the playlist">
1150 # <i>djcontrol reload</i>
1151 </pre>
1153 <p>
1154 You should now let the users know after what song the requests will start. Or
1155 if you want, you can keep skipping with:
1156 </p>
1158 <pre caption="Skipping through the playlist">
1159 # <i>djcontrol next</i>
1160 </pre>
1162 <p>
1163 Be careful not to skip too much, as there is no previous control. Once you
1164 hit their song, the requesting begins. I'd get about 5 or so requests before
1165 you start requesting. This way you don't run all the way back to the
1166 beginning. If you start to lack in requests and expect that your request
1167 hour is over with, then simply copy your next session's play list over the
1168 requests play list and reload the play list. Once the current song is over,
1169 it will go back to the new play list.
1170 </p>
1172 </body>
1173 </section>
1174 <section>
1175 <title>Conclusion</title>
1176 <body>
1178 <p>
1179 That ends it for the SHOUTcast Server and SHOUTcast Trans tutorial. I hope
1180 you benefited from the information here and please email me any comments or
1181 suggestions for this page! Enjoy your new streaming SHOUTcast Server!
1182 </p>
1184 </body>
1185 </section>
1186 </chapter>
1187 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20