Stream music to client via DAAP

Now that I have a NAS at home, I plan to place stuff that takes up a lot of space that doesn’t get used so often on there. However, with that comes the issue of file access. Since my NAS is linux based – ubuntu server edition to be exact – I can access files via ssh, sftp, ftp, sshfs (map the drive), samba, etc. I should probably write a blog post about sshfs and samba soon.

However, what if I want to listen to music in my music player, say itunes on Mac/Windows or rhythmbox (or amarok, bashee, etc) on Linux? The good thing about itunes and these bloated music players are that they have a database of all your music files, so finding the song is fairly quick (type in artist name or song title). Double clicking the files on the mounted drive is no problem, but having this “search and play” capabilities is quite useful. Luckily, there are many solutions to this, one of which is the DAAP method. Read here for an overview.

Game plan is as follow:

  1. Set up music server on NAS.
  2. Be able to access the songs in itunes or the likes on remote servers in the same network.
  3. Be able to access the songs in itunes or the likes on remote servers when on a different network, say at school (or at work).

The first point is fairly easy on Ubuntu: install Firefly Music Server (formerly known as mt-daapd). Following these instructions, I did

 <pre class="src src-sh">sudo apt-get install mt-daapd

sudo apt-get install libid3tag0 sudo apt-get install avahi-utils ## needed for remote access sudo adduser media su media mkdir /home/media/music exit

Place music in /home/media/music or create a symlink to the music folder.

 <pre class="src src-sh">sudo /etc/init.d/mt-daapd start

sudo update-rc.d mt-daapd defaults

Now, from that computer, go to http://ip.address:3689 (username and password is mt-daapd). On this site, we can set up the configuration. Set username/password, password to listen, and music folder. Then scan the files. (Might have to do sudo /etc/init.d/mt-daapd start).

From here, computers on the network should be able to see the music server in itunes or rhythmbox (point 2) and play music (after entering music password). NOTE: I initially thought that you had to “Open Audio Stream…” or the likes on the music players, but that is for internet radio or something; DAAP servers will broadcast the music server to the network.

To do point 3, the first thing to do is set up port forwarding on the router (3689 to 3689 on the music server). The remaining part is a bit tricky. First, you have to do ssh tunneling so that the remote music server appears to be on the same network as your computer/laptop. Then we have to forward the “broadcast” from the DAAP server (the server that itunes sees, for example).

For a Linux client, instructions can be found here and here:

 <pre class="src src-sh">ssh my@daap.server.no-ip.org -N -f -L local.ip:6689:localhost:3689

avahi-publish-address -v -H “name of your host”.local -s “My daap share” _daap._tcp. 6689 & ## find name of host from echo $HOSTNAME

Now, itunes or other clients on the remote server should see “My daap share” on the Shared list. NOTE: currently, Linux players such as rhythmbox and banshee can’t play music this way. I’m sure a fix should be coming soon. If a mac is also on the same network as this current linux client, it will see the shared daap server and connect and play music.

For a Mac client, instructions can be found here:

 <pre class="src src-sh">dns-sd -P <span style="color: #ffa07a;">"Home iTunes"</span> _daap._tcp local 3689 localhost 127.0.0.1 <span style="color: #ffa07a;">"Arbitrary text record"</span> &amp;

ssh -C -N -f -L 3689:localhost:3689 myusername@blahblahblah.dyndns.org

Itunes should be able to see the remote daap server.

For a Windows machine, I’m sure one would have to rely on RendezvousProxy, following these instructions. I will test this out soon (setting this up for my girlfriend).

About Vinh Nguyen

Statistician

8 comments

  1. Hi, ive been trying for ages to find information on how to configure the remote access, im a linux noob using freenas, how would I change the instructions you have given to work on a freenas firefly installation?

    1. I installed some of the packages using apt, ubuntu/debian’s package manager (“apt-get” lines). Don’t know what your distro uses, but you can install them from source for sure; just read the README file in the source for each package.

  2. Hi, ive been trying for ages to find information on how to configure the remote access, im a linux noob using freenas, how would I change the instructions you have given to work on a freenas firefly installation? Thanks

  3. Pingback: denisdert
  4. Thank you for posting this!

    Using the 11.04 beta, I installed firefly Version svn-1696 via synaptic package manager. And it just worked (over a linux to linux home network)!

    Well mainly – currently triaging:

    – why did firefly not index all of my music. — And current banshee appears to be choking on reeding the stream – rhythmbox appears to be working fine.

    And Have not tried to access off-site yet. WiIl keep your post bookmarked in event I need to tunnel in order to open on firewall.

  5. successfully set up my firefly running of ubuntu server, is it possible to access it outside my home network perhaps using a Macbook iTunes as a client? thanks

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>