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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.3 - (show annotations) (download) (as text)
Wed Sep 22 21:57:14 2004 UTC (14 years, 4 months ago) by neysx
Branch: MAIN
Changes since 1.2: +1 -0 lines
File MIME type: application/xml
Added $Header$ CVS Keyword -- No Content Change --

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

  ViewVC Help
Powered by ViewVC 1.1.20