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](http://www.linux.com/archive/feed/53199) 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](http://www.zaphu.com/2008/04/29/ubuntu-guide-configure-a-firefly-mt-daapd-streaming-media-server-for-itunes-and-front-row/) instructions, I did

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.

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](http://forum.fireflymediaserver.org/viewtopic.php?f=2&t=10024&p=23667&hilit=tunnel&sid=44bde1e425d9281c71b5a81da5f84976#p23667) and [here](http://nozell.com/blog/2006/11/29/access-a-remote-daap-share-by-tunneling-over-ssh-ubuntuedgy/):

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](http://blog.iharder.net/2009/09/28/itunes-stream-itunes-over-ssh/):

dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost 127.0.0.1 "Arbitrary text record" &
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](http://wiki.fireflymediaserver.org/RemoteAccess) instructions. I will test this out soon (setting this up for my girlfriend).

8 Comments

  • Bernard
    October 3, 2010 - 1:25 am | Permalink

    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?

    • October 3, 2010 - 11:16 am | Permalink

      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.

  • Bernard
    October 3, 2010 - 1:26 am | Permalink

    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

  • Pingback: denisdert

  • April 24, 2011 - 2:29 am | Permalink

    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.

  • April 24, 2011 - 6:25 am | Permalink

    Hi -

    Wanted to report back on my first issue:

    1. Firefly did not index all of my music.

    as http://forums.roku.com/viewtopic.php?f=18&t=11538 suggested, all of my files were not world readable. So:

    chmod -R 755 Music

    and then have firefly rescan and that fixed that issue!

  • hovno
    May 4, 2011 - 3:42 am | Permalink

    It’s better to use forked-daapd & setup a VPN with openvpn

  • tdatu
    May 15, 2011 - 10:34 am | Permalink

    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 *

    *

    Use Markdown Syntax for markup.

    Surround blocks of code with [plain] and [/plain]. For syntax highlighting of specific languages, use the appropriate "brush alias" from this list. For example, surround php code with [php] and [/php].

    LaTeX code can be surrounded by "backslash left parenthesis" and "backslash right parenthesis" or "backslash left square bracket" and "backslash right square bracket".