Setup Firefly to serve iTunes

FireFly LogoThis guide will help you setup Firefly Media Server to serve iTunes. This server based program, previously known as “mt-daapd” shares your media collection to iTunes. DAAP stands for Digital Audio Access Protocol and is developed by Apple to share media across a local network.

I have done the installation on Debian Lenny, but Firefly (still called mt-daapd on the Debian repository!) is even available on Windows. In order to publish the firefly shared library on the network I have used Avahi, which is a free implementation of Zeroconf including mDNS/DNS-SD.

1. Install the needed packages including dependencies

# apt-get install mt-daapd avahi-daemon

2. Setup Avahi by creating /etc/avahi/services/mt-daapd.service

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>

<name replace-wildcards="yes">%h</name>

<service>
<type>_daap._tcp</type>
<port>3689</port>
<txt-record>txtvers=1 iTShVersion=131073 Version=196610</txt-record>
</service>

<service>
<type>_rsp._tcp</type>
<port>3689</port>
<txt-record>txtvers=1 iTShVersion=131073 Version=196610</txt-record>
</service>

</service-group>

3. Restart the Avahi daemon

# /etc/init.d/avahi-daemon restart

4. Edit /etc/mt-daapd.conf. The following variables where important to me:

# $Id: mt-daapd.conf.templ 1660 2007-09-12 13:08:04Z rpedde $
#
# This is the mt-daapd config file.

<...>

#
# admin_pw (required)
#
# This is the password to the administrative pages
#

admin_pw = mt-daapd

<...>

#
# mp3_dir (required)
#
# Location of the mp3 files to share. Note that because the
# files are stored in the database by inode, these must be
# in the same physical filesystem.
#

mp3_dir = /path/to/music

#
# servername (required)
#
# This is both the name of the server as advertised
# via rendezvous, and the name of the database
# exported via DAAP. Also know as "What shows up in iTunes".
#

servername = Firefly %v on %h

<...>

5. Restart mt-daapd

# /etc/init.d/mt-daapd restart

The first time you start mt-daapd it will do a full scan to update the mt-daapd database. Watch the /var/log/daemon.log file to see when it’s ready.

May 4 09:54:25 sinners mt-daapd[16843]: Firefly Version svn-1696: Starting with debuglevel 2
May 4 09:54:25 sinners mt-daapd[16843]: Plugin loaded: daap/svn-1696
May 4 09:54:25 sinners mt-daapd[16843]: Plugin loaded: ssc-ffmpeg/svn-1696
May 4 09:54:25 sinners mt-daapd[16843]: Plugin loaded: rsp/svn-1696
May 4 09:54:25 sinners mt-daapd[16843]: Starting rendezvous daemon
May 4 09:54:25 sinners mt-daapd[16843]: Client running
May 4 09:54:25 sinners mt-daapd[16843]: Starting signal handler
May 4 09:54:25 sinners mt-daapd[16845]: Initializing database
May 4 09:54:25 sinners mt-daapd[16845]: Full reload...
May 4 09:54:25 sinners mt-daapd[16845]: Starting mp3 scan
May 4 09:54:27 sinners mt-daapd[16845]: Starting playlist scan
May 4 09:54:27 sinners mt-daapd[16845]: Updating playlists
May 4 09:54:27 sinners mt-daapd[16845]: Scanned 10 songs in 1 seconds
May 4 09:54:27 sinners mt-daapd[16845]: Starting web server from /usr/share/mt-daapd/admin-root on port 3689
May 4 09:54:27 sinners mt-daapd[16845]: Registering rendezvous names
May 4 09:54:27 sinners mt-daapd[16845]: Serving 10 songs. Startup complete in 2 seconds

Now you should be able to connect to the mt-daapd admin webinterface at http://yourservername:3689.

6. You’re done!
Fire up iTunes and you’ll see the just created Firefly library become available under Shared. You can also use this service with Rhythmbox Music Player, XMMS with the DAAP plugin, or any other DAAP compatible music player.

[ad name=”Google Adsense Banner”]

7 thoughts to “Setup Firefly to serve iTunes”

  1. The thing which isn’t clear to me is mt-daapd has its own mDNS responder, right? So why do we have to install avahi? On Arch GNU/Linux if I start mt-daapd via the rc scripts without avahi started, it complains. But when I start avahi first, I get two entries in iTunes over the LAN.

    If I start mt-daapd manually with `mt-daapd -m` to disable the built-in mDNS responder, I only get one. I suppose I could edit mt-daapd’s init script, but it just seems funny…

    Anyways, I’ve been using mt-daapd for years. Love it.

    Alan

  2. Hi,
    Good work on the explanation!
    Just have question regarding the “mt-daapd.service” file…
    Why do you create this file and what feature does it add to your installation?
    Thanks in advance for your answer.
    Cheers,
    JC

  3. Hi JC, you’ll need the ‘mt-daapd.service’ file to configure Avahi, so that Avahi knows what services to publish on the network. In this case mt-daapd (Firefly).

  4. Alan :

    If I start mt-daapd manually with `mt-daapd -m` to disable the built-in mDNS responder, I only get one. I suppose I could edit mt-daapd’s init script, but it just seems funny…
    Anyways, I’ve been using mt-daapd for years. Love it.
    Alan

    I found if i stopped mt-daapd daemon I could still use the library in itunes (but could not connect to the web server).

    To alter the init script to run as mt-daapd -m edit /etc/init.d/mt-daapd and add the line DAEMON_OPTS=-m
    just after the line that reads DESC=mt-daapd

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.