Servers

Serving Music with mt-dappd

In his quest to have the simplest means to share music across a network, Jack Wallen discovers mt-daapd and finds that sharing music with family (and friends) can actually be a fairly painless experience.

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.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

1 comments
brian.mills
brian.mills

I didn't find mt-daapd to be difficult to set up. Once I installed it from apt, it was as simple as pointing a web browser at http://server:3689 and entering the default password (mt-daapd I believe) and configured it using the web interface. Playlists were a lot easier to set up through there as well. I've never had to have banshee running on my server to get another system running banshee to stream music from my server. It worked just fine with streaming music when I was using it. The only problem I ever had with mt-daapd was DRM'd songs purchased from iTunes would cause banshee to refuse to play anything until I closed and re-opened it. Now I'm looking for a command-line tool I could use to play music from the mt-daapd database for use with an FM transmitter so I can stream music to anywhere in and around my house, not just the computers on the LAN.

Editor's Picks