share mp3 with mt-daapd, avahi-daemon and iTunes

In this post how share mp3 with mt-daapd, avahi-daemon and iTunes.
I have an huge collection of MP3 on a USB external disk. So I decided to attach this to my WiFi Router Buffalo WZR-HP-AG300H with OpenWrt installed. I’m running iTunes on Mountain Lion OSX 10.8.2 iTunes is version iTunes 10.7 (21) 

#1 Server Side

you need to install :

  • mt-daap: implements daap protocol in order to share MP3 over network
  • avahi: avahi-daemon allows to publish services over network (the service is share MP3 with daap)
  • ndns: used by avahi (see Note 1)
  • d-bus: used by avahi

Please consider that this is just my experience with OpenWRT but I think notes could be useful for other environments.
 Note 1 : really I installed
  mdns-utils 214.3.2-4 Bonjour, also known as zero-configuration networking, enables
  mdnsd 214.3.2-4 Bonjour, also known as zero-configuration networking, enables
  mdnsresponder 214.3.2-4 Bonjour, also known as zero-configuration networking, enables
  olsrd-mod-mdns 0.6.3-3 MDNS/Zeroconf/Bonjour packet distribution

#1.a Install mt-daap

install mt-daap and be sure to start it with option -mmt-daapd -m )
In my case I had to change /etc/init.d/mt-daapadding OPTIONS=-m as below showed :

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50

BIN=mt-daapd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
OPTIONS=-m

start() {
 [ -f $DEFAULT ] && . $DEFAULT
 [ -d $RUN_D ] || mkdir -p $RUN_D
 $BIN $OPTIONS
}

stop() {
 [ -f $PID_F ] && kill -INT $(cat $PID_F)
}

#1.b install ndns

see Note 1 above
(no configuration)

#1.c install d-bus

(no configuration)

#1.d install avahi

you have to add this file :
/etc/avahi/services/mt-daap.service
with this content :

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">DAAP server on %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>

 !! Restart all.

Share mp3 with mt-daapd, avahi-daemon and iTunes.
Share mp3 with mt-daapd, avahi-daemon and iTunes.

#2 How to create playlist

https://busylog.net/daap-itunes-playlist/