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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.2 - (show annotations) (download) (as text)
Fri Sep 10 13:54:18 2004 UTC (14 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.1: +1 -1 lines
File MIME type: application/xml
Change link in guide tag

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

  ViewVC Help
Powered by ViewVC 1.1.20