Setting up a home audio server

Category: MusicTech Comments: No comments

Over the years my iTunes library has been growing substantially, and so has my collection of computers and harddisks. As a result, my personal archive had become quite scattered. Documents, photos, videos, mp3s, it was everywhere! In my quest to archive everything to a big harddisk attached to my Ubuntu server, I came up with the plan to also have a central music server. That would save a lot of space on my laptop harddisk. Plus I would be able to listen to my music wherever I was, in the house or in the world!

In this article I’ll describe how to setup a home audio server on Ubuntu. I tried it on kernel 2.6.22-14, but it will probably work similarly on other systems. The client audioplayer in my setup is iTunes running on Mac OSX 10.4 (Tiger). There’s a number of articles available online, describing how to do this, but somehow none of them seemed to really cut the mustard for me. I’ll start with a short inventory:

Running an iTunes server on Ubuntu
Streaming iTunes from Ubuntu
Using Ubuntu to share with Firefly (mt-daap)
How to share your music via iTunes on the Net

After some investigation and hacking, I arrived at the following setup:

homeaudio1

Step 1: Update and upgrade
Make sure you got all the relevant upgrades and updates for your Ubuntu machine, by typing at a command prompt:

sudo apt-get update
sudo apt-get upgrade


Step 2: Format your external harddisk
If you’re a Mac adept like me, you will want to format your kickass external harddisc to Apple’s HFS+ filesystem. To do so, attach it to a Mac, open Applications -> Utilities -> Disk Utility and Erase the Disk using Volume Format HFS (“Mac OS Extended”). I recommend not to use journaling. Although it helps recovering your data in case of a corrupt disk, I found that Ubuntu support for HFS+ Journaled disks is still a bit shaky.

Step 3: Move your music to central storage
Now go attach your external disk to all your computers, move or copy all your mp3s onto it, and attach the disk to your Ubuntu machine.

Step 4: Install a DAAP server
iTunes speaks and listens to a protocol called DAAP (Digital Audio Access Protocol) for sharing media across a network. By default, DAAP uses TCP port 3689. The DAAP server is the sofware that will spit out your audio onto the network. We will install Firefly on the Ubuntu machine for this purpose. Firefly, or mt-daap as it used to be called, requires some additional packages, install them by typing the following at a command prompt:

sudo apt-get install howl-utils libhowl-dev libhowl0
sudo apt-get install mt-daapd

Now you’re ready to start the server with:

sudo mt-daapd &

Step 5: Configure DAAP server
Open a webbrowser and goto http://your_ubuntu_machine:3689/
If you installed correctly, the server will prompt you with an authentication window. By default, don’t specify a username and use mt-daapd as password.

homeaudio2

Go to the Configuration tab and change the default Admin password. It’s probably illegal to open up your music collection online for the whole world to see, so choose a Music password as well.
Set the Music Folder to a directory on the harddisk that you just stuffed with your music collection. I started out with a small test directory first, but if that works just scan your whole database. To verify that Firefly actually found all your files, go to a command prompt and check how many files you’ve really got:

find . -type f | wc -l

When I was setting things up, I found that I had to fiddle around with file permissions and ownership before the Firefly admin console would see them.

Step 6: Test on local network
Right now you should already be able to connect to your music server within your private network. Open up iTunes and check that a Shared Playlist is shown:

homeaudio3

Step 7: Port forwarding on router
Go your router’s admin console and setup a virtual server for port 3689. All incoming traffic on port 3689 should be routed to your Ubuntu machine.

Step 8: Installing rendezvous proxy
iTunes cannot find your shared playlist from another network. You need to configure a proxy on your client machine that will mimic a shared playlist to iTunes, and connect to your home network on the other side. You can use the rendezvous proxy for this. Get it here or google for it 🙂 Download and mount the .dmg file and run the application contained in it. You should end up with a new icon in the taskbar.

homeaudio4

Click on it, select Preferences… and then Add Host.
homeaudio5

Fill in your home IP address and port 3689, type a dummy host label and a descriptive Service Name, and select Service Type as shown.

Step 9:Test on remote network
You’re all set! Fire up iTunes on your laptop while lying on a sunny beach far away, using the WiFi network of the local cocktail bar, and listen to your favourite Slayer tracks while your Ubuntu server is streaming from the comfort of your home 😉

    Leave a reply

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>