Mt-daapd

Introduction
This document explains how to install mt-daapd / Firefly to create an "iTunes Server" using a Gentoo system. This is a fairly simple procedure that does not require a sound card or any specific software.

Prerequisites

 * A working Gentoo installation
 * iTunes compatible music player (both Windows and Linux work); that is a music player capable of daap. For a (complete) list see.
 * Functional network subsystem (tcp/ip) connected to local lan

Installing the Software
In order to install a recent version, you should ensure that the portage tree has been synced recently.

Before installing, you will need specify the vorbis use-flag to install the package as a part of the overall mt-daapd build. This is a necessary step since the mt-daapd package requires it and the dependency is currently broken in the e-build:

Now emerge the mt-daapd package:

The e-build will install six or so dependencies. It takes about 2 minutes on a decent system.

Once the installer finishes, you have successfully installed the basics. Next, let configure it and make it run.

Configuring the service
First make a copy of the existing example configuration found as :

This gives you the very basic rudimentary configuration. For the most part this is enough to get you started. There are, however, some basic changes you can make:

Almost ready to go. One last thing to do is to configure your online playlists.

DNS Responders
So there are plenty of howtos on the web that say you need a DNS responder. Many use AVAHI for this purpose, and you still can. As I do not have any other services that I wish to advertise through avahi, I use a combination of howl (the internal responder) and mDNSResponderPosix

You can simply emerge net-misc/mDNSResponder then add it to mt-daapd init.d script under dependencies:

Configuring the Playlists
The playlist system in this server is quite powerful. You can use logic and specify, based on some predefined criteria which mp3s to categorize under which name. Unfortunately the playlists are not recursive, which means, you can only really go one level deep.

Here is a little sample of mine:

Starting the service
Ensure that the music directory actually exists and has some files in it! If the directory does not exist, the service will fail to start.

Watch it fire up. Once complete, go over to your iTunes player and look for a shared music server namerd "Heavy Metal Forever". Once you click on it, you will see your songs!

If you wish, you can also add the service to your running configuration to auto-start every time you boot up:

You will see the following output: output

I have set up my server, but sometimes it simply crashes, or doesn't list any songs
There are actually a number of reasons for that. Mostly, the fact is that the latest version of this software, 0.2.4.1 is actually from 2006, and thus, quite old. It has been known to have had issues on 64-bit system running later kernels.

Your only alternative at this point is to grab an SVN version of this (no e-build) and hand-bomb it into the system (cleanly overwrite the existing binaries).

Here is the process for doing this.

1. Emerge sqlite and make sure it is installed. You want to make sure the latest stable version of v3 is running

2. Grab the latest SVN build of mt-daapd / (or Firefly as its now known) from here Firefly SVN Archive Build 1696

3. Untar the files

4. Enter the directory and Configure the build

The prefix needs to be there to ensure that the binary gets written to the same file as your existing mt-daapd binary.

5. Run make

6. Once the build is done (and hopefully with no errors) you need to append "db_type sqlite3" into your /etc/mt-daapd.conf file. Your file should look like this:

7. Now start your server as per normal using /etc/init.d/mt-daapd

Now if you happen to go to the Web GUI under http://home:3689/index.html - you will see Firefly instead of mt-daapd!

Seems that the server freezes when I try to start it
Its possible that the songs database is corrupted. Clear it out, kill the process and use the init.d script to restart.

Just run the following command: rm -Rf /var/cache/mt-daapd/