HOWTO: configuring a music server

If that sounds like you, read on. The underlying protocol that makes iTunes work is the afore-mentioned daap, and most of your open source operating systems offer it in one form or another…. But to make it visible from your clients, you’ll need to advertise it using some implementation of multicast DNS, variously known as Rendezvous or ZeroConf. There are three versions in ports: Port: howl-0.9.4 Path: /usr/ports/net/howl Info: Zeroconf/Rendezvous implementation Maint: paul@aps.org B-deps: expat-1.95.7 gettext-0.13.1_1 gmake-3.80_2 libiconv-1.9.1_3 libtool-1.3.5_2 R-deps: Port: mDNSResponder-62_1 Path: /usr/ports/net/mDNSResponder Info: “Apple’s mDNSResponder” Maint: alfred@freebsd.org B-deps: expat-1.95.7 gettext-0.13.1_1 gmake-3.80_2 libiconv-1.9.1_3 R-deps: Port: mdnsd-0.7G Path: /usr/ports/dns/mdnsd Info: Advertise a service via Rendezvous Maint: daniel+mdnsd@pelleg.org B-deps: R-deps: The daapd port can run on top of an existing mDNS infrastructure that uses mDNSResponder or the components in net/howl…. [/usr/ports/net/howl]# mDNSResponder -h usage: mDNSResponder [options] Options: -h this help -v display version -d run in debug mode -i ifname run only on interface ifname -a addr run only on interface whose address is addr -f config_file load config_file nDNSResponder will only bind to one interface at this writing, so we’ll need to specify that. [/usr/ports/net/mDNSResponder]# mDNSResponder -a 192.168.2.1 (root@red.paulbeard.org)-(02:06 PM / Sun Jul 04) [/usr/ports/net/mDNSResponder]# ps auxwww | grep DNS root 87980 0.0 0.5 2280 1244 ??

This assumes:

* you’re using iTunes (or some other Digital Audio Access Protocol [daap] client).

* you’re comfortable with open source — compiling and installing packages from source.

* you want to be able to listen to your music library from a central server that might not be a Macintosh.

If that sounds like you, read on.

The underlying protocol that makes iTunes work is the afore-mentioned daap, and most of your open source operating systems offer it in one form or another. In FreeBSD, you’ll find it in the ports collection (audio/daapd).

But to make it visible from your clients, you’ll need to advertise it using some implementation of multicast DNS, variously known as Rendezvous or ZeroConf. There are three versions in ports:


Port: howl-0.9.4
Path: /usr/ports/net/howl
Info: Zeroconf/Rendezvous implementation
Maint: paul@aps.org
B-deps: expat-1.95.7 gettext-0.13.1_1 gmake-3.80_2 libiconv-1.9.1_3 libtool-1.3.5_2
R-deps:


Port: mDNSResponder-62_1
Path: /usr/ports/net/mDNSResponder
Info: "Apple's mDNSResponder"
Maint: alfred@freebsd.org
B-deps: expat-1.95.7 gettext-0.13.1_1 gmake-3.80_2 libiconv-1.9.1_3
R-deps:


Port: mdnsd-0.7G
Path: /usr/ports/dns/mdnsd
Info: Advertise a service via Rendezvous
Maint: daniel+mdnsd@pelleg.org
B-deps:
R-deps:

The daapd port can run on top of an existing mDNS infrastructure that uses mDNSResponder or the components in net/howl.

To use howl, install it with pkg_add or with make install. This gives you the binaries mDNSBrowse, mDNSPublish, and mDNSResponder. We’re only concerned with this last one.

[/usr/ports/net/howl]# mDNSResponder -h

usage: mDNSResponder [options]

Options:


-h this help
-v display version
-d run in debug mode
-i ifname run only on interface ifname
-a addr run only on interface whose address is addr
-f config_file load config_file

nDNSResponder will only bind to one interface at this writing, so we’ll need to specify that.

>[/usr/ports/net/mDNSResponder]# mDNSResponder -a 192.168.2.1

(root@red.paulbeard.org)-(02:06 PM / Sun Jul 04)

[/usr/ports/net/mDNSResponder]# ps auxwww | grep DNS
root 87980 0.0 0.5 2280 1244 ?? Ss 2:06PM 0:00.01 mDNSResponder -a 192.168.2.1

And here’s what Rendezvous Browser shows us.

network_before
[click for larger image]

Now we simply configure and install daapd. To configure it, you need to decide if you want to use howl or mDNSResponderPosix. And you need to select the mpeg4 library is you plan to listen to AAC files (if you have bought music from the iTunes Music Store, you’ll need this).

daapd_config
[click for larger image]

Make your choices and make install. You’ll need to create a daapd.conf file: here’s mine. Nothing fancy: the server and DB names can contains spaces and the specified paths must exist.

Port 3689

ServerName Celestial Jukebox

DBName Celestial Jukebox

Password

Root /opt/music/Music/iTunes

Cache /var/db/daapd.cache

Timescan 2

Rescan 30

Once that’s done, simply start daapd (/usr/local/etc/rc.d/daapd.sh start). Then see if it shows up.

network_after
[click for larger image]

Looks good.

celestial_jukebox
[click for larger image]

If you like this Rendezvous stuff, you can make even more services available: Rendezvous Browser gives some hints as to the syntax. For example, to publish a webserver for access by Safari or some other Rendezvous client, simply use this:

[/usr/ports/audio/daapd]# mDNSPublish red _http._tcp. 80

and you’ll see the reply:

red _http._tcp. 80

publish reply: Started

You can also publish resources for ssh, telnet, etc. Terminal is Rendezvous-enabled, so you can run this:

mDNSPublish red _ssh._tcp. 22

then choose File ->Connect to Server and see a dialog window like this.

connect_to_server
[click for larger image]

This tells you both what hosts are available for a given protocol and what protocols can be handled by this application (I never knew you could run sftp in Terminal: I’ve used it in an existing session, but not as a session unto itself).

Leave a Reply

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