I need to setup Linux machines for streaming audio to an Icecast2 server from time to time and I always forget how to do it. This post will outline the install process on a machine with a minimal Debian Lenny system.
After you first boot into a fresh system, log in as root and install a couple things to make the next steps work.
$ apt-get install openssh-server sudo htop alsa g++ gcc oss-compat
You need to add your username into the sudoers file by running visudo and adding yourusername ALL=(ALL) ALL
once that’s done, find your IP address by
write down whatever eth0 says and you can get rid of your keyboard and monitor attached to the target machine. SSH into the box with your username and download source code for lame, then compile it.
$ tar xfz lame-3.91.tar.gz $ cd lame-3.91 $ ./configure –with-fileio=lame –without-vorbis –disable-gtktest –enable-expopt=full –prefix=/usr $ make $sudo make install
For the last step, you need to be root or have write permissions in the target directories.
You might as well use ogg vorbis too. Go find libogg +libvorbis tarballs somewhere.
$ tar xfz libogg-1.0.tar.gz $ cd libogg-1.0 $ ./configure –prefix=/usr $ make $ sudo make install $ cd .. $ tar xfz libvorbis-1.0.tar.gz $ cd libvorbis-1.0 $ ./configure –prefix=/usr $ make $ sudo make install
You need to be root to make install. Now, grab the darkice source code and compile.
$ ./configure –with-lame –with-vorbis –with-alsa $ make $ make install
You should probably make a configuration fie in /etc as well. A sample config file is in /usr/local/etc/
Here is my config file for your reference.
[general] duration = 0 # duration of encoding, in seconds. 0 means forever bufferSecs = 5 # size of internal slip buffer, in seconds reconnect = yes # reconnect to the server(s) if disconnected # this section describes the audio input that will be streamed [input] device = /dev/dsp # OSS DSP soundcard device for the audio input #device = hw:0,0 sampleRate = 44100 # sample rate in Hz. try 11025, 22050 or 44100 bitsPerSample = 16 # bits per sample. try 16 channel = 2 # channels. 1 = mono, 2 = stereo [icecast2-0] format = mp3 bitrateMode = vbr bitrate = 128 quality = .8 server = (your server) mountPoint = conway128 port = 8000 password = (your pass) name = rev.mook description = rev. mook url = mookserve.com genre = Mix public = yes [icecast2-1] format = mp3 bitrateMode = vbr bitrate = 320 quality = 1 server = (your server) mountPoint = 320 port = 8000 password = (your pass) name = rev. mook description = rev. mook url = mookserve.com genre = Mix public = yes