If you can translate this HOWTO, please drop the author an email. Also please state the URL where the translation will be housed.
<sect>Acknowledgments.
<p>
In writing this HOWTO I have had to draw heavily on the <em/Sound-HOWTO/ By Jeff
Tranter, and the <em/Sound-Playing-HOWTO/ By Yoo C. Chung.
Thanks also to the other HOWTO authors whose works I have referenced:
<em/Linux System Administrators Guide/ By Lars Wirzenius.
<em/Linux Network Administrators Guide/ By Olaf Kirch.
<em/Multi Disk System Tuning HOWTO/ By Stein Gjoen.
Also a big thank-you to all who have sent in feedback, comments and bug-reports.
<sect>Disclaimer.
<p>
Use the information in this document at your own risk.
I disavow any potential liability for the contents of this document.
Use of the concepts, examples, and/or other content of this document is entirely at your own risk.
All copyrights are owned by their owners, unless specifically noted otherwise.
Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as endorsements.
You are strongly recommended to take a backup of your system before major installation and backups at regular intervals.
<sect>Hardware Requirements & Performance Issues.
<p>
Digital Audio processing is a resource intensive task that relies heavily on
the processing and I/O capabilities of a system. I would strongly recommend
a Pentium class machine as a minimum.
If you are going to be encoding from an analogue audio source via the line or microphone input, a PCI soundcard will give the best results. The I/O performance difference between an ISA and PCI based card is significant, over 132 MBytes/sec for PCI (quote taken from the <em/PCI-HOWTO/). Naturally, the better the quality of the soundcard in terms of its signal-to-noise ratio, the better the encoded MP3. I've been using the Soundblaster PCI128 and just switched over to a Soundblaster Live Value; both cards give good audio performance, but the Live has significantly better S/N ratios, good enough for semi-pro audio work. Remember the old data processing maxim:- garbage in - garbage out!
Creative have a Beta driver for the Soundblaster Live! which can be
average transfer rates will be slower. If you can find, or afford, an AV
SCSI drive, go for it. AV drives have had the read/write head system optimised for continuous data transference; other SCSI and IDE drives normally cannot sustain continuous data transfer as the write head heats up!
Naturally a drive that has cache will give more consistent results than one that
doesn't, as the cache will act as a buffer if the heads do lift or it cannot
handle the throughput.
If your drive isn't up to spec, your recording will suffer from dropouts and
glitches, where the drive failed to record the signal. If you are recording
one-off events, such as live performances invest in a good SCSI based disk
system.
Another cause of d2d dropouts is a heavily loaded system. Background tasks
can cause the system to momentarily glitch. Its recommended to run as few
background services as you can, especially networked based services. For
more information about setting network services, and startup scripts please
refer to the <em/SAG/ and <em/NAG/ guides.
Virtual memory paging will also cause glitches, so run with as much physical
RAM as you can, I'd recommend at least 32 Mb, but you may well need more.
For those wanting to extract the most out of their system, optimising the
For streaming MP3's the better the network card the better the throughput, naturally a 100Mb interface will give better throughput than a 10Mb interface :)
While the hardware specifications above will give you a decent system to
encode audio data, don't discount using older, lower spec kit if that's all
you have access to.
It'll be a good challenge for a sys-admin to tweak a low-spec system to
give good results, and the end result will probably be a happier Linux box.
Another important issue is the audio cabling. Cheap, poor quality cables
and connectors will result in poor recording quality. If your soundcard has
the option to use phono, sometimes referred to as RCA connectors, use them.
Gold plated contacts will also help maintain audio quality, as will keeping
audio cables away from data cables as there will be a chance of interference
between them.
But don't forget, spending a fortune on the best audio cabling will be lost
if the rest of the system hasn't been optimised.
For encoding MP3's from CD-ROM, the speed or type of drive will determine the
time taken to read the raw information from it. A single speed drive will
probably be too slow for all but the most patient.
Your CD-ROM must be connected to your soundcard if you want to hear what you
are recording, either using the internal connector or by connecting headphone's to the headphone output, although you will not be able to listen to MP3's through the CD-ROM headphone socket!
For detailed instructions on setting up soundcards, now would be an excellent
time to read the <em/Sound-HOWTO/.
<sect>Software Requirements.
<p>
Converting audio to MP3's is normally a 2 stage process, first the audio is
recorded into a WAV format, then the WAV is then converted into an MP3. Some
utilities will do both processes in one go for you.
The format you wish to encode audio from, CD or direct audio, will determine what software tools you need to produce the WAV file.
If you are wanting to encode from audio input, you will need a program that will record from your soundcard's input and save the results in a WAV format. Below are some useful utilities (most of the comments are taken from the respective website of the app.)
<sect1>
Rippers & WAV Recorders
<p>
To grab from analog audio line-in.
<em/Wavrec/
Wavrec is distributed as part of wavplay, which can be downloaded from:-
Cdparanoia is a Compact Disc Digital Audio (CDDA) extraction tool, commonly known on the net as a 'ripper'. The application is built on top of the
Paranoia library, which is doing the real work (the Paranoia source is included in the cdparanoia source distribution). Like the original cdda2wav,
cdparanoia package reads audio from the CDROM directly as data, with no analog step between, and writes the data to a file or pipe in WAV, AIFC or raw 16 bit linear PCM. Compared to cdda2wav, it's much slower but really gets the best results you can get even from CDs that are difficult to rip for scratches or other read-errors.
RipEnc is a bourne shell script frontend to Cdparanoia, cdda2wav, tosha and Bladeenc, 8hz-mp3, l3enc. It utilizes CDDB lookups to automate the naming of songs as they are ripped. A manual naming option is also available. The entire CD can be ripped or you can pick the songs to rip. ID3 tags are also supported.
Grip is a GTK-based CD-player and CD-ripper/MP3-encoder. It has the ripping capabilities of cdparanoia built in, but can also use external rippers (such as cdda2wav). It also provides an automated frontend for MP3 encoders, letting you take a disc and transform it easily straight into MP3s. The CDDB protocol is supported for retrieving track information from disc database servers. Grip works with DigitalDJ to provide a unified "computerized" version of your music collection.
<url url="http://www.nostatic.org/grip/">
<sect1>
Encoders
<p>
To convert the WAV file to MP3 format you will need an encoder:
<em/Blade's MP3 Encoder/
BladeEnc is a freeware MP3 encoder. It is based on the same ISO compression routines as mpegEnc, so you can expect roughly the same, or better, quality . The main difference is the appearance and speed. BladeEnc doesn't have a nice, user-friendly interface like mpegEnc, but it is more than three times faster, and it works with several popular front-end graphical user interfaces.
<url url="http://bladeenc.cjb.net">
<em/Lame/
In the great history of GNU naming, LAME stands for LAME Ain't an Mp3 Encoder. LAME is not an mp3 encoder. It is a GPL'd patch against the dist10 ISO demonstration source. LAME is totally incapable of producing an mp3 stream. It is incapable of even being compiled by itself. You need the ISO source for this software to work. The ISO demonstration source is also freely available, but any commercial use (including distributing free encoders) may require a license agreement from FhG (Fraunhofer Gesellschaft, Germany).
<url url="http://www.sulaco.org/mp3/">
<em/Gogo/
This is a very fast MP3 encoder for x86-CPU, which is based on LAME ver 3.29beta and optimized by PEN@MarineCat, Keiichi SAKAI, URURI, kei and shigeo.
(You will also need to download NASM to compile the source, which can be found <url url="http://www.web-sites.co.uk/nasm/">)
Audio playback, especially targeted at MPEG Audio (MP1, MP2 and MP3) decoding.
<url url="http://www.xaudio.com">
<em/AlsaPlayer/
AlsaPlayer is a new type of PCM player. It is heavily multi-threaded and tries to exercise the ALSA library and driver quite a bit. It has some very interesting features unique to Linux/Unix players. The goal is to create a fully pluggable framework for playback of all sorts of media with the focus on PCM audio data.
<em/Full speed (pitch) control, positive *and* negative! First Linux- and
only GPL player that does this!! MP3's and CD's do varispeed :) /
<url url="http://www.alsa-project.org/~andy/">
<em/mpg123/
What is mpg123? It is a fast, free and portable MPEG audio player for Unix.
It supports MPEG 1.0/2.0 layers 1, 2 and 3 (those famous "mp3" files), and
it has been tested on a wide variety of platforms, including Linux, FreeBSD,
NetBSD, SunOS, Solaris, IRIX, HP-UX and others. For full CD quality playback
(44 kHz, 16 bit, stereo) a Pentium (or fast 486), SPARCstation10, DEC Alpha
or similar CPU is required. Mono and/or reduced quality playback (22 kHz or
LiveIce is the source client for Icecast which encodes an mpeg stream for broadcast as it is created. Unlike clients such as Shout and IceDJ this permits the broadcast of live audio, rather than prerecorded mp3's.
LiveIce is bundled with Icecast, newer versions together with documentation may be found at the website below:
eMixer is an easy-to-use front-end to mpg123 that allows you to play and mix two mp3 streams together. The ability to mix two mp3s makes eMixer act like a cross-fader, effectively giving the user DJ-like capabilities from the computer console. eMixer is also very able in a "real time" party environment. eMixer is based on the original mp3 mixing code upon which liveice's mixing component is built.
GDAM is real-time digital dj mixing software package. Any number of mp3 files can be played and mixed simultaneously. Effects can be added, changed, and rearranged dynamically. GDAM features a client-server architecture; all sound is produced by a server, which receives instructions from any number of clients. Other features include plugins for audio effects and interface components, caching and looping, sequencing, assisted beatmatching, a waveform viewer/beat calculator, contiguous queuing (no pauses between songs when using a playlist), an online help system, an mpg123 clone which runs on a gdam server, flexible command line interface for direct control of server, recording of entire mix or any point in stream to buffer/disk/mp3 encoder, support for multiple sound devices, and support for midi hardware control.
<url url="http://gdam.org/">
alternative:
<url url="http://gdam.sourceforge.net">
<sect1>
ID3 Editors
<p>
<em/id3ed/
id3ed is an ID3 tag editor for mp3 files. You can set tags interactively or from the command line, or a combination of both. id3ed can set genre by name or number. You can also remove or view tags.
MP3info is a small utility for reading and writing MPEG Layer 3 (MP3) ID3 tags. Console (command-line and interactive ncurses) and GTK versions are included.
<url url="http://metalab.unc.edu/mp3info/">
<sect1>Stream Grabbers
<p>
<em/Streamripper/
Streamripper records shoutcast streams. If the stream contains track info (meta data), streamripper creates a separate file for each track.
<url url="http://streamripper.sourceforge.net/">
<em/Wget/
GNU Wget is a freely available network utility to retrieve files from the World Wide Web using HTTP and FTP, the two most widely used Internet protocols. It works non-interactively, thus enabling work in the background, after having logged off.
I'm basing this section around my Intel based Linux system which is running Redhat, but should be reasonably distribution neutral. If you have any success in using this HOWTO on other hardware, please get in touch.
Naturally a reasonable prerequisite is a working soundcard. At this point in
the HOWTO, I invite you to read the excellent <em/Linux Sound HOWTO/, by Jeff
Tranter. After which a good read of the <em/Linux Sound Playing HOWTO/, by
Yoo C. Chung. Both of the above mentioned HOWTO's cover the details of
getting a sound system working under Linux far better than I could.
<sect1>Setting up for Analogue Audio Capture
<p>
Firstly, set up your audio. There are a multitude of ways to route audio
before it gets to your Linux box, some common ones are:
Line out to Soundcard Line in. Most audio devices have a Line output sockets. Line level is a standard that specifies what voltage the audio device
will send out. If I remember correctly it is 500mV for domestic and Semi Pro
devices, and 750mV for Pro audio devices. I would guess that the standard
set for most soundcards will be 500mV, but some of the newer Pro audio may
be to the higher standard It shouldn't make too much difference unless you
are recording at very high levels.
The Line level output is normally used to connect HI-FI equipment to an
amplifier, so things such as Tape Decks, Radio Tuners, CD players, DAT
machines and Mini-Disc players should connect without problem. Turntables
can be more of a problem, see below for more information.
You could capture audio from VCR's as well. Most VCR's will either have
Line out for sound, or you can Get a Line out from a SCART socket if your
VCR has one.
Amplifier Tape out to Soundcard Line in, Soundcard Line out to Amplifier Tape in. This configuration is essentially replacing a traditional tape recorder connected to your HI-FI amplifier with your Linux system. The Soundcard Line out to Tape in allows monitoring of the recording levels.
Mike to Soundcard Mike in. The voltages generated by microphones is very much smaller than those used in Line level devices. If you were to plug a Microphone
into the Soundcard Line in, chances are you would never record anything.
<em/WARNING, doing the reverse, plugging a Line level device into the Soundcards Microphone input, can damage your soundcard!!/
Turntable to Mike in.
Many thanks to Mark Tranchant for the following.
<em/
The raw output from a record deck cartridge is very low level.
However, you cannot plug it directly into a microphone input and expect good
results. The output requires equalization, as records are mastered with less
bass and more treble to optimize the physics of the moving needle. This
equalization is carefully defined and referred to as RIAA equalization. You
*need* to run the output through a phono preamp first, and then into a line
input./
Music keyboards & synths should be connected to the Soundcards Line in, with guitars connecting to Line in via a DI (Direct Injection, used to convert the signal to Line level) box.
Before you plug in anything into your soundcard, make sure the volume levels are turned down to minimum, or if using microphones they are either turned off or away from speakers.
<sect1>Setting up for CD-ROM Audio Capture
<p>
Setting up your Linux system to extract audio data from CD-ROM is reasonably
straight forward.
If you can hear a track playing from your CD-ROM through your speakers or
amplifier, connected to your soundcard, then there's a reasonable chance you
should be able to record from it.
<sect1>Additional Setting up
<p>
Log in as per normal to your system, then using a mixer program set the
recording levels that are loud enough to give you a decent recording level,
but aren't too loud and distorting. I normally just judge this by ear,
after a while you'll get to know what levels are best for your kit.
I recommend either turning off all unnecessary services or switching to the
single user runlevel, especially when encoding from an audio source. This is
to ensure that the bare minimum of services are running and thus minimising
system glitches when recording.
I've set up a separate SCSI drive, exclusively to record the audio to, which
I'll refer to as /mp3. I've done this mainly for the performance gains
in using a SCSI drive. Also, recording onto a dedicated drive, where you
are almost certain the head isn't going to suddenly skip to another part of
the drive as you are writing audio data to it, is a good thing :)
For details on setting up a Linux system with multiple disk drives, a good
read of the <em/Multi-Disk-HOWTO/, by Stein Gjoen may be useful.
<sect>Encoding from Audio.
<p>
Firstly, make sure you have enough space on your drive. At CD quality, 44.1
Khz 16 Bit stereo, 1 minute takes nearly 10 Mb (5 MB per channel).
I normally record at DAT quality, which is 48 Khz 16 Bit stereo.
In a similar way to encoding from audio, encoding from CD is a 2 stage process. Firstly the audio data is extracted from the cd and converted into a wav file. Then the wav file is converted into MP3.<p>
There are basically 2 types of encoders, console based and X based. Both do the same job, but the X based are easier to use (and look nicer).
Again, before you start to encode, check you will have enough drive space on your system.
<sect1>Command Line encoding
<p>
I've written a very simple Perl script that will rip and encode tracks
GUI based encoders offer all the functionality of console based encoding, but wrap it all up in a nice easy to use interface. Grip and RipperX are similar in operation, both offer you the ability to select one, several or all tracks on a CD and convert them. They also offer CDDB support which allows you to retrieve the album and track information from a server and saves you having to enter the information by hand.
<sect1>Encoder Performance
<p>
In the encoding sections I've mentioned 3 different encoders, bladeenc, lame and gogo. The main difference is their performance in encoding (although there are differences in the available options which were listed earlier).
A little example. I ripped a track from a CD and then encoded it with the different encoders. All encoders were run with the same system conditions and all produced stereo out mp3's.
A streaming server allows you to transmit MP3 files over a TCP based network. This can be the Internet itself or your local network / intranet.
The connection principal is very similar to that of a web server, files are streamed when a client (the MP3 player) connects to the server.
<sect1>Icecast
<p>
After downloading and untaring, a good look around the doc/ directory would be a good thing, the HTML manual is very helpful and comprehensive.
If you have downloaded the source code, follow the instructions regarding compiling pertinent to your system.
Icecast will not work correctly unless you correctly set the servername in the config file, icecast.conf, which is located in the etc directory. It must match the name that resolves to your IP address exactly.
If you see the following line when Icecast starts-up you have problems:
<code>
-> [05/Jan/2000:17:21:04] WARNING: Resolving the server name [your.server.name] does not work!
</code>
Edit icecast.conf which is located in the etc directory and locate the line containing the entry for "server_name" and enter your servers name. If you are unsure you can find out by using the <em>hostname</em> command, or by cat'ing /etc/hosts.
Once you've made the neccesary changes you'll need to either copy the conf file to the bin directory, or start icecast with the -c option and specify the location, like so:
The -P option specifies the password needed to add a mount-point to Icecast, this is the aptly set as <em>hackme</em>..... I strongly suggest you change it otherwise someone may :) The -p option specifies the location of the playlist file.
Below is a list of all of the command line options:
-B <directory> - Use directory for all shout's files.
-C <file> - Use file as configuration file
-D <dj_file> - Run this before every song (system())
-P <password> - Use specified password
-S - Display all settings and exit
-V - Use verbose output
-X <desc> - Use specified description.
-a - Turn on automatic bitrate (transfer) correction
-b <bitrate> - Start using specified bitrate
-d - Activate the dj.
-e <port> - Connect to port on server.
-f - Skip files that don't match the specified bitrate
-g <genre> - Use specified genre
-h - Show this text
-i - Use old icy headers
-k - Don't truncate the internal playlist (continue)
-l - Go on forever (loop)
-m <mount> - Use specified mount point
-n <name> - Use specified name
-o - Turn of the bitrate autodetection.
-p <playlist> - Use specified file as a playlist
-r - Shuffle playlist (random play)
-s - (Secret) Don't send meta data to the directory server
-u <url> - Use specified url
-v - Show version
-x - Don't update the cue file (saves cpu)
-z - Go into the background (Daemon mode)
-t - Enable title streaming
</code>
<sect2>LiveIce<p>
LiveIce can work in 2 modes, it can pass a playlist to Icecast or can pass live audio from the soundcard.
After untaring and reading the README concerning building the package, make sure you have mpg123 installed and available as LiveIce requires it.
There are two ways of configuring LiveIce editing the config file with vi/emacs/or whatever or by using the TK based configuration tool, which is a pretty way of editing it :)
The best place for describing the internals of liveice.cfg can be found at LiveIce's homepage where Scott covers all of the options.
This is a copy of my config file with LiveIce set to mixer mode (stream from a list of MP3's)
NOTE: I've added comments to the file, so if you cut and paste make sure the comments haven't wrapped around to a new line otherwise LiveIce will not work :)
<code>
# liveice configuration file
# Automatically generated
SERVER megajukebox # Your server name * MUST BE THE NAME THE SERVER RESOLVES TO *
PORT 8000 # The port Icecast is running on
NAME Megajukebox # Information regarding the name of your server which is sent to MP3 players, and
# to directory servers.
# Examples 'Sarah FM' or 'ThisTown: Loud and Heavy Jazz - Internet Radio 24/7'
GENRE Live # Information regarding the genre. Examples 'Talk' or 'Dance'
DESCRIPTION # Information regarding the station. Example 'The best for reggae in the North'
URL http://megajukebox:8000 # The URL and port of the server.
PUBLIC 0 # Set this to 1 if you want Icecast to announce your station and list it's details
# on a directory server, otherwise leave 0
XAUDIOCAST_LOGIN # can be either ICY_LOGIN or X_AUDIOCAST_LOGIN. X_AUDIOCAST is better.
MOUNTPOINT /techno # Sets the mountpoint name of the stream for Icecast. Only used if X_AUDIOCAST is used
# otherwise defaults to icy_0
PASSWORD hackme # Icecast's admin password
SAMPLE_RATE 44100 # The sample rate of the stream
STEREO # Can be MONO or STEREO
NO_SOUNDCARD # See below
HALF_DUPLEX # Sets the soundcard duplex mode. Can be HALF_DUPLEX or FULL_DUPLEX
USE_GOGO # Sets the encoder to use. Check the README for the list
BITRATE 128000 # Sets the bit rate of the stream (see below)
VBR_QUALITY 1 # Sets the variable bit rate quality.
MIXER # See below
PLAYLIST /megajukebox/playlist # Location of the playlist (see details on the find command later in this chapter)
TRACK_LOGFILE track.log # Filename and location to dump list of MP3's streamed
</code>
Once you have your config file you start LiveIce like so:
<code>
[dj@megajukebox liveice]$ ./liveice
/megajukebox/playlist
1
opening connection to megajukebox 8000
Attempting to Contact Server
connection successful: forking process
opening pipe!...
writing password
Setting up Interface
Soundcard Reopened For Encoding
Input Format: 16Bit 44100Hz Stereo
Output Format: 256000 Bps Mpeg Audio
IceCast Server: megajukebox:8000
Mountpoint: /techno
Name: megajukebox - this and that radio - broadcasting 24/7
Description: a load of digital noise -> but i know you like it :)
Press '+' to Finish
adding /megajukebox/demotunes/track_1.mp3
adding /megajukebox/demotunes/track_2.mp3
adding /megajukebox/demotunes/track_3.mp3
adding /megajukebox/demotunes/track_4.mp3
/megajukebox/demotunes/track_4.mp3
Adding New Channel 1
Adding New Channel 2
Channel 1 selecting
/megajukebox/demotunes/track_1.mp3
Channel 2 selecting
/megajukebox/demotunes/track_1.mp3
Playing track_1.mp3
searching for Id3v2
searching for Id3v1
copying the data
fixing the nulls
adding the url
closing input file
Using log track.log
</code>
The last line is a peak meter.
These are the keyboard controls for mixer mode:
<code>
Action Channel 1 Key Channel 2 Key
~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Select next track on channel 1 a
Select prev track on channel q z
Start/Stop channel 2 s
Reset channel w x
Increase volume on channel 3 d
Decrease volume on channel e c
Increase speed on channel 4 f
Decrease speed on channel r v
Sticky mode On/Random/Off 5 g
Preview channel t b
Random Track u m
</code>
The above liveice.cfg is for mixermode. To use LiveIce in audio mode change the line relating to MIXER to NOMIXER and set NO_SOUNDCARD to SOUNDCARD and restart LiveIce.
Forgetting to set the correct options will lead to some interesting warning ;)
<code>
946:Error: Line In mode *and* no soundcard??????? Eeejit!
</code>
Once you have it all correctly set up and have plugged in an external source, you should be able to stream =:)
<code>
[dj@megajukebox liveice]$ ./liveice
/megajukebox/playlist
0
Initialising Soundcard
16Bit 22050Hz Stereo Full Duplex
opening connection to megajukebox 8000
Attempting to Contact Server
connection successful: forking process
opening pipe!...
writing password
Setting up Interface
Soundcard Reopened For Encoding
Input Format: 16Bit 22050Hz Stereo
Output Format: 32000 Bps Mpeg Audio
IceCast Server: megajukebox:8000
Mountpoint: /daves_band_live_at_the_club
Name: megajukebox - Dave and the Dynamite - Live at the Roxy
Genre: Live/Rock
Url: http://megajukebox
Description: megajukebox::Louder than a frog in a trashcan..... and almost as musical
The last line is a signal level meter, if the input signal is too high you will get a *clip* warning. If you do, turn down the gain of the input source.
The keen eyed amongst you may of noticed that in liveice.cfg the first comment lines point out that the file is automatically generated. If you are using the TK based GUI liveiceconfigure.tk and you've made manual changes, you will lose them when you save. Either use the GUI or learn vi/emacs :)
<sect1>Fluid
<p>
After untaring the bundle cd to the directory, then read the README :)
Fluid has three basic modes of operation, transmit, relay and forward. I'll only focus on transmit.
The config files associated for transmit are located in config/MP3TX.cfg. To test the server run with the following, at this point the default config settings should be ok:
java Fluid TX
Naturally enough you'll need Java of some form installed first. You can use either the Blackdown port of JDK available from <url url="http://www.blackdown.org"> or if you are using Redhat, Kaffe.
Fluid comes with a few sample MP3 files, so if everything is working you should see something similar to this (I've started the server using Kaffe in this example, you may have to start it using java):
<code>
[dj@megajukebox Fluid-Beta2J]$ kaffe Fluid tx
------- Fluid Streaming Server Beta 2 -------
This program is ShareWare(tm) and it will not
be crippled in any way because of it. However
if you do like the program and will use it
commercial purposes, we ask of you to contact
us at the address below for pricing info:
Eldean AB E-mail:
Sjoangsvagen 7 fluid@subside.com
S-192 72 Sollentuna
SWEDEN
Fluid is Copyright Subside (C) 1998
written by Lars Samuelsson
http://www.subside.com
---------------------------------------------
* Transmission mode *
Reading config from: config/MP3TX.cfg
Reading playlist: playlist.m3u
Server started on port: 2711
Accepting administrator login on port: 2710
P| Dr. Nick - Hello Everybody
</code>
If you get this far, it looks like things are working, but I'm sure you'll want to stream more than the demo files!
You'll need to compile a playlist of the MP3's you want to stream. This will be a static list users will not be able to alter this list or make requests. This playlist is named playlist.m3u and is located by default in the root directory.
To compile a playlist of all MP3's in a particular directory (or disk) use the following command:
The reference to "jaguar" is the admin password, this is the default. There is no prompt for the password so please don't sit there waiting for one! I suggest that you change the password from the default otherwise you will invite a hack! This can be changed in the config file, which looks like this:
<code>
[dj@megajukebox config]$ cat MP3TX.cfg
2711
2710
5
4096
32
1000
jaguar
playlist.m3u
current.txt
# --- The lines are ---
# 1. PORT number (the server will use)
# 2. PORT number (for maintaining the server remotely)
# 3. Maximum number of connections (the server will accept)
# 4 Packetsize when reading/sending (in bytes)
# 5. Bitrate of the mp3s in kbit/s (all mp3s must have same bitrate)
# 6. Delay between songs (in milliseconds)
# 7. Password for remote administration
# 8. Playlist name (list in .m3u format)
# 9. Name of the file to write song info to (from ID3-tag)
</code>
The reference to the playlist being in m3u format means that it is in the same format as produced by the find command mentioned earlier.
<em/source port/ Is the port you connect the 'audio' source to.<p>
<em/stream host/ This is the IP or FQDN of your server (find this out with the hostname command for domain name or cat /etc/hosts for your IP address).<p>
<em/stream port/ This is the port number clients connect to.<p>
<em/max listeners/ This is the number of clients who can connect to your server.<p>
<em/log ident/ Log messages are written to /var/log/messages. <log ident> is a ident string used to identify the Litestream server, eg.<p>
If you use the ident string 'Litestream' the server starting message in /var/log/messages would look similar to:
<code>
Sep 18 19:32:20 linux Litestream[1901]: stream.c:555: main: 'server started'
</code>
<yp host & yp port> These 2 options specify the host and port of an yp server, used to announce your server to mp3 directory servers.
<em/ip or hostname/ is the hostname or IP address of the computer
running Litestream Server.
<p>
<em/port/ is the port on which Litestream Server is waiting for a
streaming source.
<p>
<em/name/ is the name of your stream.
<p>
<em/genre/ is the genre of your stream.
<p>
<em/url/ is the URL for your streams web page.
<p>
<em/irc/ is the IRC channel for your stream.
<p>
<em/icq/ is your ICQ ID.
<p>
<em/aim/ is your AIM ID.
<p>
<em/public/ is either 0 or 1. 0 for private, 1 for public.
<p>
<em/reported bitrate/ is the stream bitrate which will be reported
to the YP server. This does not necessarily reflect the actual
bitrate of your stream.
<p>
<em/playlist.txt/ is the name of the file containing your playlist.
<p>
<em/log ident/ is the syslog identifier which will be prepended to
each log message generated by Litestream Streaming Source.
<p>
Here is an example which would match the Litestream command earlier:
<code>
[dj@megajukebox]$ source megakukebox 5000 'Megajukebox The best jukebox ever' Various http://www.megajukebox.com \#megajukebox 0 N/A 1 128 /jukebox/playlist LitestreamSource
</code>
<sect1> Apache::MP3 Module
<p>
The Apache:MP3 module allows the Apache WebServer to stream MP3's. It does not offer the same level of features as Fluid, Litestream & Icecast.
The module is dependant on MP3::Info and mod_perl, both of which are
available on CPAN.
After downloading the files needed a read of the README will help things!
Firstly make the module, then make the config changes to Apache's config files (your changes may be made in either httpd.conf or srm.conf).
You will also have to create directories for icons and a directory hierarchy for MP3's.
Section 6 of the README details the editing (or creation) of a Perl config file.
This is to preload the MP3::Info module which without this may cause Apache to crash.
In httpd.conf create an entry like so:
<code>
Perlrequire /etc/httpd/conf/startup.perl
</code>
Alter the /etc/httpd/conf reference to point to where your Apache config files are located on your system.
Now create the file startup.perl at the location specified above. At the very minimum you should have the following (again adjust the path of perl to fit your system).
Streaming audio can consume vast quantities of bandwidth if the MP3 servers' bit-rate is set too high.
Consider this scenario. A T1 link has a capacity of approx. 1.55 Mb/Sec. If you stream your MP3's at 128K/Bps stereo, each connecting player will use 256K/Bps, so only 6 users could connect to your MP3 server at any time without problems. And at 256K/Bps, you will not get too many modem users connecting!
So you must make a decision at what to set your stream rates not only on what your server's internet connection is rated at, but what your users will be connecting at. 24K/Bps Stereo will give a reasonable quality signal that 56K modem users will be able to connect to, and for the same T1 line would allow approx. 32 simultaneous connections.
If your server is running on an Intranet, bandwidth issues will still have to be considered especially if your network is running 10M/Sec.
But please let either your ISP or sys admin know you are going to stream otherwise you may be in for a shock. Some ISP's will charge you for bandwidth over a certain limit and sys admins like to know why their network is now running slow :)
<sect1>Copyright Issues
<p>
I think it's reasonable to assume that record companies will not like you streaming material without their permission or payment of some kind! So what can you stream?
This is an area where you will need to be aware of the legal ramifications, because it will be you who will be liable.
Below are two links, one for the Electronic Frontier Foundation who are advocates of freeing restrictions surrounding the technology. The other link is to the Recording Industry Association of America, which seeks to protect the rights of artists from piracy.
I strongly suggest visiting both of the sites, and any others relevant to where you are physically based.
GDAM is a GUI based MP3 mixer with a large bank of built in, real-time effects.
<sect>ID3 Editing.
<p>
ID3 tags are information fields contained within the MP3 data that contain information about the MP3 such as who the artist is, what album the track came from, and so on.<p>
Editors allow you to view and edit this information.<p>
<sect1>id3ed<p>
<code>
[dj@megajukebox]$ id3ed
id3ed v1.10 - mpeg layer 3 file information editor