Monday, May 26, 2008

Remote music in a Linux desktop

I hate having to mount a Samba share in my laptop to access the music on the desktop machine at home. Why a Samba share you ask? Well, I haven't yet converted the rest of my family to The Linux Desktop, so there's still Windows running on the machine with the big hard drive and all the music.

In fact, I don't really care about having to mount a share to listen to music. The problem is that half of the times I forget about mounting it before opening Amarok [1], and half of those times I'm not even at home so I couldn't have mounted it anyways. Therefore, when I open Amarok at that point (either because I forget or because I want to listen to other music, such as Internet radio), it mistakenly assumes that my Collection is missing. Then, when I launch it back home with the share mounted, it has to update it.

Clearly, the problem is that Amarok's Collection was not thought as something temporary, that could be present or absent while the program is running. It's true that Amarok detects if the folders comprising the collection change, so that when you add things to your media folders they get almost instantaneously added to the collection. However, that's not enough when all your music can be present or absent at any given time while the program's running.

The solution turns out to be extremely cool. iTunes users are probably thinking "but I can access other iTunes in my home network and stream music from one iTunes to another". Well my friend, that's exactly what we are going to do. iTunes uses a protocol called DAAP that together with Apple's Bonjour (a set of tools to autodiscover services in the local network) allows iTunes in differente machines on the same network to discover themselves (using Bonjour) and stream music (using DAAP).

Since the machine where I have my music is a Windows machine, I will have to use a Windows DAAP server. The one I found most convenient was Firefly. There's also Tangerine, but it crashed when I tested it (and it requires the .Net Framework).

The instalation of Firefly is pretty straightforward, except for the fact that it requires Apple's Bonjour for Windows, so you have to install that first. Firefly allows you to select a name for your DAAP server, and the folder you want to share.

Back in Amarok, DAAP shares are added as Devices. A good Zeroconf setup in your Linux machine should supposedly discover those shares, but if they don't come up, you will have to add them manually. That's Settings from the toolbar, Configure Amarok... from the menu, Media Devices from the left column, Add Device... in that window.


We want to use the Music Sharing plugin. The name only identifies the share, it's not necesary for it to be the same as the name configured in Firefly.

After this, you should be able to add a DAAP server to Amarok:


You need to enter the server's IP:


Firefly's default port is 9999. I can now have all my music in my laptop without worrying about mounting shares:


Cool!

[1] We will have a post about Linux media players soon.

No comments: