Sharing Music on the LAN

No, not on the lam. On the LAN. I have a fairly large collection of music. Years ago I used iTunes to rip the CD's to AAC format. Recently I've been using Amazon.com for more of my downloads so I have converted the library to high quality VBR mp3 files instead. I like being able to play the music no matter which system I am using, and the iTunes sharing works well for that. I wanted to centralize storage of the files, and setup sharing from one of my Fedora 13 systems so I went in search of a solution. There are several out there, but I think I hit on the simplest of them.

iTunes (and several other music playing apps like Rhythmbox) use the DAAP protocol for sharing music between systems. On fedora this can be provided by the mt-daapd package (check your distribution for it, I'll bet it is included). Setup was dead easy:

  • Install mt-daapd package
  • Open up port 3689 on your firewall (I edit /etc/sysconfig/iptables)
  • Edit /etc/mt-daapd.conf and point it to the top directory of your music storage, don't forget to change the admin password for the web interface
  • run chkconfig mtdaapd on; service mtdaapd start

You should now be able to connect to the share using Rhythmbox or similar DAAP supporting players. It is even nicer if your system announces itself. This can be accomplished by adding the following service definition to the avahi open source Bonjour daemon:

<?xml version="1.0" standalone=’no’?>
<!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</txt-record>
        <txt-record>iTSh Version=131073</txt-record>
        <txt-record>Version=196610</txt-record>
    </service>
</service-group>

Copy this into /etc/avahi/services/mt-daapd.service and run service avahi-daemon restart. Now your share should appear in applications like iTunes which use Bonjour to discover local DAAP services.

The last piece of this is downloading purchased mp3 files from Amazon. This is easily accomplished by installing the clamz package. After installing, visit http://www.amazon.com/gp/dmusic/after_download_manager_install.html, to activate the browser cookie. Then, when you purchase an mp3 or an mp3 album Fire Fox will prompt you to run clamz, which then downloads the files for you. Thanks to Dirk-Jan's page for info on setting up avahi, and to to Mauriat Miranda's page for help in setting up mp3 playback.