As part of my home network rejiggering, I wanted to start serving my music files from my desktop machine. In part, this is to save space on my iBook, and in part, it’s just because I can.
I started by googling for a precise howto for my system. While this didn’t turn up anything for Ubuntu, it did point me to mt-daapd, the multithreaded DAAP server. DAAP is Apple’s Digital Audio Access Protocol, which is what iTunes uses to share music. mt-daapd also requires Howl, a cross-platform implementation of the Zeroconf standard (which Apple calls Rendezvous).
To set up my server, I first installed howl:
sudo apt-get install howl-utils libhowl-dev libhowl0
Unfortunately, there’s no deb for mt-daapd in the Ubuntu universe. So I had to download the deb from SourceForge and install it like so:
sudo dpkg -i mt-daapd_0.2.0_sid_i386.deb
I created a directory /var/media/music for my music files, and copied some MP3s there for testing. Then I edited /etc/mt-daapd.conf to tell mt-daapd where to find music files, as well as some other details. Then I took a deep breath and started mt-daapd with its script:
sudo /etc/init.d/daap start
The admin web page (on http://localhost:3689 by default) came right up and showed me that mt-daapd was running, and had scanned four MP3 files.
For extra bonus points, I added mt-daapd to the runlevel startup scripts, so it will start every time the machine starts up:
sudo update-rc.d daap defaults
I fired up the iTunes player on my iBook and connected to the server. There it was! However, double-clicking on a song didn’t do anything.
The mt-daapd log showed a variety of errors. After scanning the mt-daapd forums without finding an exact remedy, I decided to ditch the deb and installed the latest source tarball (version 0.2.1-pre2) instead. This required installing a few more dependencies (like libgdbm-dev and libid3tag0-dev), but all of them were available in the Ubuntu universe. I configured it to install in /usr/local, so as not to conflict with the version from the deb.
To make sure that the right version of mt-daapd starts up, I edited /etc/init.d/daap, changing the DAEMON variable to point to /usr/local/sbin/mt-daapd.
That one worked. I packaged up all the music files ripped on my iBook and copied them over to my Ubuntu box. Et voila! Now I had music streaming across my home network.
But I still can’t play all my music files locally on the server, where the nice Harmon Kardon speakers are plugged in, because many of them are encoded as AAC. XMMS, my music player of choice on Linux, doesn’t seem to handle AAC encoding.
Next step: finding and installing an MP4 codec for XMMS. I’ll leave that for a future weblog.
Are you streaming iTunes on Linux?