This tutorial outlines the installation and set-up of an Icecast MP3 audio streaming server using the binary Linux RPM from icecast.org. Icecast comes with an http server built in. Icecast can use this if staticdir directive is incuded in the configuration file or icecast will use an existing server such as Apache or Netscape. This example will employ the http server within Icecast.
Note on using Linux RPM's: The configuration I used was the icecast 1.3.10 server from the RPM downloaded from icecast.org and the shout module supplied by the Red Hat RPM.
The icecast.org icecast-1.3.10 RPM did not include the shout module. The Red Hat powertools icecast RPM included shout but in other ways the RPM was horribly incomplete (No templates or configuration file.) and thus the icecast server it shipped with was unuseable. The configuration file detailed below is intended for the icecast 1.3.10 server and does NOT work with the Red Hat RPM (icecast-1.3.op2). Bottom line: I had to install both RPM's to get a complete set of tools. Amazingly enough there were no RPM conflicts and both installed without hassle.
- The prefered RPM for the icecast server can be found at
http://www.icecast.org/download.php - RPM download (Install with the "rpm -ivh" command)
After installation, the icecast manual will then be found in /usr/share/doc/icecast-1.3.10/manual.html. This is the best source for configuration information. Runtime icecast html templates can be found in /usr/share/icecast/templates/.
Configuration files: /etc/icecast/icecast.conf
Log Files: /var/log/icecast/...
This RPM did not include shout. Download and compile the source or use the Red Hat powertools version of shout.
- Another RPM version of icecast is available on the
Red Hat Powertools CD (or download site) (RPM Dependency:
"perl-Time-HiRes" Powertools RPM)
Documentation for Red Hat 7.1 is found in /usr/doc/icecast-1.3.0p2/.
- /usr/bin/shout: Streams MP3 files to the icecast server. A perl equivalent, "iceplay" is also included.
- /usr/bin/listen: Listen to streaming audio.
- /usr/bin/liveiceconfigure.tk: Tcl GUI configuration tool for Liveice.
- The prefered RPM for the icecast server can be found at http://www.icecast.org/download.php - RPM download (Install with the "rpm -ivh" command)
- Compile from source obtained from IceCast.org/download.php.
- Note: If installing a source RPM, the install (rpm -ivh) will place icecast-1.x.x.tar.gz in /usr/src/redhat/SOURCES/
- tar zxvf icecast-1.x.x.tar.gz -C /tmp
- cd /tmp/icecast-1.x.x/
- ./configure - View options: ./configure --help
- Note: Red Hat 6.x places documentation in /usr/doc/program-name/
Red Hat 7.1 places documentation in /usr/share/doc/program-name/
To follow this convention on 7.1 I made the following changes to Makefile:
- ./configure --sysconfdir=/etc/icecast --prefix=/usr --exec-prefix=/usr --datadir=/usr/share --enable-fsstd --with-libwrap
- make install
- tar zxvf shout-1.x.x.tar.gz -C /tmp
- cd /tmp/shout-x.x/
- ./configure --sysconfdir=/etc/icecast --prefix=/usr --exec-prefix=/usr --enable-fsstd
- make install
- Configuration file: /etc/icecast/icecast.conf
location Music from the University of Linux - Server and location of Streaming Station - Display only rp_email firstname.lastname@example.org - State contact info server_url http://www.your-domain.com - URL of the web page corresponding to the music # Set Limits max_clients 300 - Max simultaneous clients connected to the server. max_clients_per_source 20 client_password not_used - This feature has not been implemented yet throttle 10.0 encoder_password mypassword - Clear text password by which the server accepts encoders admin_password mypassword - Required to use admin console oper_password mypassword - For access to server operator commands port 8000 port 8001 - +1 for shoutcast compatability. server_name node.your-domain.com - Not required. Used when virtual hosting multiple URL's with the icecast server. logdir /var/log/icecast logfile icecast.log - Log file in directory /var/log/icecast/ console_mode 3 - Run icecast server in the background, as a daemon process. client_timeout 30 staticdir /home/MP3 - Turns on http server capabilities of Icecast and sets root directory for content.
Sample files: icecast conf
- M3U playlist file: playlist_01.m3u
/home/MP3/classical/Beetovan1.mp3Use fully qualified path names.
- Start icecast: /usr/sbin/icecast
- Start shout: /usr/bin/shout localhost -P mypassword -a -x -p /directory-name/playlist_01.m3u -l -u "http://node.your-domain.com:8000" -z
For a full list of options: shout -h
Red Hat RPM binary logs to: /tmp/shout/shout.log
- Test: xmms http://node.your-domain.com:8000
- View icecast server statistics: http://node.your-domain.com:8000/list.cgi
- Try the web based administration interface: http://node.your-domain.com:8000/admin
Using TCP wrappers:
- File: /etc/hosts.deny
icecast: ALLor use nothing at all to allow everyone.
- File: /etc/hosts.allow
icecast: 192.168.10. - Allow from 192.168.10.* network addressesOR
icecast: ALL - Allow all to listen
More Icecast Info:
- People typically use 128 kbps compression mono MP3 files. (Sample rate: 44100 Hz)
- Icecast uses TCP port 8000
[Potential Pitfall]: Many corporate firewalls block everything except port 80. Many of the large MP3 streaming stations such as live365.com have changed all their servers to stream over port 80 to avoid problems.
- The streaming protocol used is called the shoutcast protocol.
- Header type: application/x-audio
- Icecast has a web interface for administration which is good for viewing the status of the icecast server but useless at making changes. (That part is broken.)
- Remote administration can be performed in console mode:
- telnet node.your-domain.com 8000
- Enter: ADMIN password then Enter + Enter (carraige return twice)
- Switch to operator status: oper operator-password
- Get list of commands: help
- You can list your server with a directory server to gain exposure and more listeners.
List of directory servers:
- Icecast can run as a relay thus adding scalability by adding more servers. Use the "alias" directive to employ this capability.
- Icecast can support access control lists (ACL) using "deny" and "allow" directives.
- There are NO man pages.
Icecast configuration file directives for /etc/icecast/icecast.conf
|icydir yp.shoutcast.com||Directive for old directories.|
|directory yp.shoutcast.org||Directive for new directories. Icecast 1.3+
Default port: 80
|touch_freq integer||How often the directory servers get 'touched' by the icecast server.
Default: 5 minutes
|max_admins integer||Max. number of simultaneous connected admins.|
|console_mode integer||0: admin console
1: same as 0 but without logfile info
2: Use as logfile window
3: Run icecast as a daemon process.
|reverse_lookups integer||0: Turns off reverse lookups of IP addresses.
1: Reverse lookup all ips to hostnames.
|acl_policy integer||0: Deny connections if no rule is given.
1: Allow connections by default if no rule is given.
|logfiledebuglevel integer||Debugging messages output to log file:
0: No debigging output
2: Even more output
6: Max debugging output
|consoledebuglevel integer||Debugging messages output to console:
0: No debigging output
2: Even more output
6: Max debugging output
|streamtitletemplate string||Template for stream title sent to client and directory servers. The symbol "%s" will be replaced with the filename of the current song.|
|accessfile file-name||Access logging which can be parsed by Apache log file parsers.|
|templatedir directory-name||HTML templates.
|http_admin integer||0: No www admin access
1: Allow www admin access
|include file-to-be-included||Include the contents of another include file.|
|alias /directory-1 /directory-2||Server mount points set as the same logically.|
|mount_fallback integer||0: Send message "HTTP 404 Stream Not Found" if not found.
1: Send default stream if not found.
For more information and a full list of directives see the icecast manual.
Icecast command line directives:
Usage: icecast [options]
|-c configuration-file||Command line parameters overide configuration file directives.
|-P port-number||Used for all client, source, and admin connections.
|-m max-clients||If exceeded, icecast will issue the error: 'HTTP/1.0 504 Server Full'|
|-p encoder-password||Password used to deliver stream to server.|
|-b||Run in background as a daemon process.|
|-d directory||Configuration files.
Shout configuration file directives for /etc/icecast/shout.conf:
Format: option value or option bool
where bool is yes/no, on/off or 1/0.
|port 8000||Same port as configured in icecast.conf.
|server_name localhost||Name of server.|
|password password||Same as defined in the icecast.conf as the encoder password.|
|mount default||Mount point for this stream/channel. (Other examples: rock, rap, etc)
|name name||Name of this stream.
Default: Icecast Radio
|desc text||A description of the channel.|
|url URL||Web address associated with this stream.|
|public bool||If you want this published on a yp server lookup list.
Supported only if the icecast server has yp touch enabled.
|genre genre||talk, rock, rap, alt, techno...
|playlist file||Fully qualified file names to play.|
|loop bool||true: Endless playing loop.|
|shuffle bool||true: Shuffle playlist entries.|
|autodetect bool||Check the file for bitrate info, before trying to stream it. If no, it will be sent at the default bitrate.|
|default_bitrate 128000||If different than file and autodetect is off, you get a mess.|
|force bool||on: If file does not match the default_bitrate, skip file.|
|djprogram file||Program/script to run before every song.|
|short_titles bool||Trim path names from file names when using non ID3 data for stream title info.|
|title_streaming bool||Turns title updates on or off.|
|id3 bool||Use id3 tags for title streaming.
Requires: title_streaming yes
|autocorrect bool||Adapt the stream calculations to match each file's bitrate.|
|daemon bool||yes: launched in the background.|
|verbose bool||yes: Extra text output.|
Download source and see file shout.h for full list of directives and the defaults.
# Comments are valid
password mypassword mount default name Radio_Linux desc The_best_linux_music genre Music url http://www.your-domain.com/
- SIGINT: makes shout skip to the next song.
- SIGUSR1: makes shout reshuffle the internal playlist.
- SIGHUP: makes shout re-read its configuration file.
You may run multiple instances of shout, one for each channel. i.e. http://localhost:8000/rock, http://localhost:8000/rap, etc... using rock and rap etc as the different mount points.
Shout command line directives:
Usage: shout host-name [options]
|-B directory-name||Base/root for all of shout's files.
|-C configuration-file||Specify a configuration file.|
|-D DJ-file||Run this before every song.|
|-P password||Specify encoder password.
Must match that specified in /etc/icecast.conf
|-S||Display all settings and exit.|
|-V||Use verbose output.|
|-X description||Use specified description.|
|-a||Turn on automatic bitrate (transfer) correction.|
|-l||Go on forever. Loop through playlist endlessly.|
|-p playlist-file||Use specified file as a playlist.|
|-u URL||Use specified url|
|-z||Go into the background (Daemon mode)|
|-t||Enable title streaming|
To view all directives use the command shout -h.
MP3 MIME Types:
|audio/x-scpls||pls||Used by shoutcast.com for their MP3 streams|
|audio/mpegurl||m3u||Used by icecast.org for their MP3 streams|
|audio/x-mpegurl||m3u||Used by mp3.com for their MP3 streams|
Testing with the Xmms client:
- Attaching xmms to a streaming server:
- xmms http://localhost:8000
- xmms http://188.8.131.52:8016 - Clasical
- xmms http://netrock.inyc.com:8045 - Rock
- xmms http://www.live365.com/play/26395 - Heavy Rock
ctrl-L will allow you to enter a new URL.
- xmms http://localhost:8000
Testing with the FreeAmp client:
- Attaching FreeAmp to a streaming server:
- freeamp http://184.108.40.206:8016
MP3 Streaming Stations: See http://www.live365.com
- XMMS.org - 4Front Multimedia
- Real Audio:
- MPG123 - Console MP3 player
- List of Linux clients
Directories of MP3 Streaming Stations: (pick one and listen)
Audio Streaming Servers:
- IceCast.org - Open Source MP3 and OggVorbis Streaming Server
- Shoutcast.com - Commercial MP3 Audio streaming
- DarkIce - Live streamer - Takes live input from a soundcard, encodes it and sends the encoded stream to an IceCast server. DarkIce uses an external mp3 encoder.
- AmpJuke - Web based. Uses Apache, MySQL and PHP. AmpJuke streams music files to one or more clients using the HTTP-protocol. Scanning and import of music stored in the MP3, OGG, WMA and/or APE format.
- Ampache - Web-based Audio file manager. Implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web. Supports playlists, artist and album views, album art, random play, playback via Http/On the Fly Transcoding and Downsampling.
- kPlaylist.net - PHP interface to a streaming web site (ogg, mp3, wav, ...) Allows upload, creation of playlists, share, search and download.
- Agatha - Stream music and playlists
- Edna - MP3 streaming
- Fluid - MP3 streaming server written in JAVA
- Streamcast - Supports ID3 tags, mountpoints. The PHP-stream version is a database enabled version of streamcast.
- netjukebox - Web based Winamp/httpQ media jukebox.
- Shout - MP3 stream encoder from the icecast site
- LiveIce - Provide "Real Time" streams for icecast.
- MuSE - Desktop GUI application for the mixing, encoding, and network streaming of sound. Can use 6 encoded audio bitstreams (from files or network) plus a souncard input signal to be played locally or encoded for broadcast. Also hadles Ogg Vorbis.
- MAES - PERL scripts which interface with MySQL to provide streaming MP3's over the net. (Based on myMP3) - Nice web interface for Internet broadcasters.
- PIBS: Personal Internet Broadcasting Script - PHP/Apache fron-end to create dynamic MP3 playlists for broadcast.
- List of MP3 encoders
- RAT: Robust Audio Tool - Audio conferencing and streaming application. (Multicast capable)
- PhpXmmx - Web fron-end to icecast
- Tunez - Web PHP MP3 jukebox with a voting system
Ogg Vorbis Encoders:
- RAIN: Radio and Internet Newsletter - Internet radio news magazine - Kurt Hanson
- Streaming Media With Linux (Part 1) - Part 2 - Great overall coverage of this topic - This is a must read tutorial on this subject. Very complete and informative!!
- List of Linux MP3 Software
- MP3-HOWTO document - by Phil Kerr
- MP3-howto.com Web Site - Also by Phil Kerr
- Xiph.org - Xiphophorus - open protocols and software.
- Ecasound - Record to a WAV file.
- Sound & MIDI Software For Linux
- MP3-Tech.org - Info
- Broadcast Open Development Exchange Initiative - R-BOSS suite of digital broadcast content management applications. Broadcast 3D.
- Icecast Scripts - by Jamie Zawinski
- Webcasting Legally - by Jamie Zawinski
- MP3 Archiving scripts - archive webcasts - by Jamie Zawinski
- YoLinux Video/multimedia Links