In the last year I wrote an article about using Samba to share music within a network. That system always does work well but it always requires importing and too much manual intervention for some users. Recently I came across a toy for the iPhone called Simplify Media that basically allows you to see your entire music collection on your iPhone – no size limitations. But that wasn’t enough. I wanted to be able to use my Linux box to serve up tunes all over my network. So I did some looking and discovered mt-daapd. Although not simple to set up, it is simple on the end-user side of things which makes it very much worth getting up and running (especially when one of the end users is a 14-year-old – need I say more?).

Okay so let’s get right to it.

My server installation is on Ubuntu 7.10 (A bit outdated, but waiting for the Mandriva migration) with the following machines waiting for a serving of songs:

  • Mandriva desktop
  • Mandriva laptop
  • OS X desktop
  • Windows XP desktop

The installation was quite simple: Open up Synaptic, do a search for mt-daapd, check to install, click Apply. You will also need sqlite3 if you want to serve up mp3 files. Done and done. Now, getting the server up and running was the tricky part.

The first thing to do is the edit the /etc/mt-daapd.conf file. In this file you will need to add your media directory, an admin password, a user password (should you want to enable this), and a few other simple options. The next step is to create an mt-daapd.playlist file. In this file you will add expressions for playlists. Say you want to only serve up recently added songs. For this you could add the following:

“new this month” { Date after 4 weeks ago }

into the file.

The server can be started two ways (both with the help of sudo): /etc/init.d/mt-daapd start or mt-daapd start. The problem with either of these methods is that it will start but, should it fail, you will never know it (until you try to see a song or two on another machine.) So the best way (at first) to start the server is to issue the command sudo mt-daapd -f. By adding the -f switch you will see the output as the command attempts to run. What I saw was that it couldn’t insert a single song. I checked the log file which didn’t give me much information at all. So I looked at permissions. I remembered reading that mt-daapd was really picky about permissions and that it tended to like only 777 permissions (which I think is a bit sloppy). So I made sure all of my music was given 777 permissions and started mt-daapd again. Same problem.

It took me a while to figure out the problem was the permissions of the songs3.db file in the /var/cache/mt-daapd/ directory. After giving this file 777 permissions mt-daapd was able to run a successful scan and insert all of my media into the database.

Now every machine can see the server library (although if anyone on the network uses Banshee the server will have to have Banshee running as well – this I will tackle later) without having to do any importing.

I have to say this is one of the nicest network music sharing systems I have come across. And although it took me a while to get up and running, it was certainly worth the hassle.