Ever since I received the prestigious title of web master/mistress for next year at wbar.org, I dreamed of updating the streaming server. I wanted, first of all, to have a unix-like operating system to play with. I also wanted to stream in Vorbis. Using Windows made doing such a thing very tough, because in order to stream MP3’s on Shoutcast, you (normally) run Winamp and configure it to use a special output plugin for encoding. Well, the output plugin only knows how to encode MP3, so encoding Vorbis requires another plugin. But you can only use one plugin at once, and when it comes down to it, you have to choose between the two formats.
I found a nifty program called Darkice that could simultaneously encode MP3 and Vorbis. It required an Icecast server. I wanted to run all of this on FreeBSD, but the system’s sound card had only commercial drivers on that platform. Linux with ALSA it would be.
After consulting the techie brain trust, I decided on Debian testing, the pretty-stable-but-we-can’t-guarantee-it version of Debian. I was excited. I read Crime and Punishment and sat through a few hours of class, anticipating the joy of installing Linux (oddly enough, the previous statement bears some truth).
The station has two servers: a “real” Dell server, and an old Compaq desktop computer. They both ran Windows 2000, but the Dell box did pretty much all of the tough work. I started by downloading a Debian netinstall image and setting up the Compaq box to act as a temporary server. When it came time to burn the netinstall image, though, it turned out that wbar didn’t actually have any burners in their computers. Somehow one turned up in the closet, and after about an hour of fiddling (don’t ask) I managed to get it installed in one of the servers (don’t ask).
With the netinstall CD burned, I turned off the Dell server and gave the Compaq its old IP address. Instant changeover! The listeners wouldn’t know the difference… or they shouldn’t have, if I had done things right. But there were only around 5 listeners, and, well, you know…
I used the rescue mode of my SUSE install CD to resize the Dell’s main partition. GNU parted worked like a charm and within minutes I had space for Debian. I rebooted into the Debian installer and immediately noticed that it was different from previous versions. The dreaded kernel module configuration dialog was no longer, and I didn’t have to enter any partitioning information. Excellent! My only gripe was that I couldn’t figure out a way to add my own source for grabbing the base system.
Once base was installed the system rebooted and I did some final configuration. I chose packages to install, which worked fine except for the fact that I needed to do several runs through the package installation step. I’m not sure why this always happens with Debian — for large apt-get’s, you always seem to need to run apt-get several times. Eventually apt-get kept failing on inn, so I just removed it. My system was installed.
X worked more or less out of the box, although some mouse driver tinkering in XF86Config-4 was necessary. I installed ALSA so that I could drive the high-end sound card. I also downloaded alsa-tools and compiled envy24control by myself — Debian doesn’t include it for some reason. Well the damn program kept on refusing to detect the sound inputs and segfaulting! After endless tinkering, I realized that it was a version incompatibility — 1.0.4 of alsa-tools, 1.0.3 of alsa-base. Jesus. One minor version! The slightly older envy24control worked like a charm, showing the input levels and letting me adjust gain. Why Debian won’t include alsa-tools, I have no idea.
With sound set up, I began working on Icecast/Darkice. Icecast2 wasn’t included in testing, so I downloaded the deb from unstable and installed it. I gave the streaming server a base configuration, then configured Darkice. Oh yeah, because Debian has some worries about patents, they didn’t compile Darkice with LAME (mp3 encoding) support. Thus making it useless. Compile-from-source, here we come.
I downloaded the sources for Darkice and LAME, compiling them both into Debian packages. In all my years using Debian I had never compiled a Debian package from source (not counting Kernel), so this was a big thing for me. Surprisingly easy! I modified the Darkice package so that it used LAME, and soon thereafter I had a functioning MP3 streaming server.
With the high bitrate MP3 stream working, I added a low bitrate MP3 stream and a high bitrate Vorbis stream, all of which the server handled very well. Unfortunately Darkice can’t downsample/downmix audio for Vorbis (even though the Vorbis encoder supports just downmixing), so I couldn’t get a low bitrate Vorbis stream running.
I made an init script for Darkice by basically copying the init script for icecast-server. I really like start-stop-daemon: I was able to figure out how to use it in almost no time. I made some simple modifications and quickly had Darkice automatically starting up and shutting down. After a reboot to test if the server knew what to do automatically, I declared my work more or less done.
I switched the stinky Compaq machine back to DHCP, and gave the Dell machine back its old IP address. By the way, Debian’s “interfaces” file is an amazingly simple way to manage network configurations. I had my IP info typed in in a few minutes, even though I had little experience with this system beforehand. As a final measure, I added some aliases on the server to make the Icecast server look more like the old Shoutcast server (e.g. requesting http://server:8000/ gets you an MP3 stream, instead of a 404 Not Found error). I tried the links on the site for one more sanity check. Everything a-ok. Time to go.
It was 9:20PM when I left. I had arrived at 12:30.