2008

2007

2006

2005

2004

3rd party iTunes jukebox

▁ oct 31 2005

Did you ever sit and spend time copying music from your one computer to your Mac so you could listen to it there instead? Did you ever wish there was an easier way of sharing this music? There is. It’s called [“Bonjour”:http://www.apple.com/macosx/features/bonjour/], and it’s another piece of quality software from Apple, albeit proprietary (open source, though). I’ve written this guide to help you install and setup your linux machine to continously scan a folder recursively, pick up MP3, AAC and other musicformats and expose those over the network to any iTunes (OSX or Windows) and have those available for streaming on-demand. Sort of like an advanced multithreaded jukebox.

First we’ll look at what software is required, and then the inner workings of this. I was actually going to write this software on my own since I think it’s a great idea, but it turns out, someone already has. 2 years ago. This is where [“daapd”:http://www.deleet.de/projekte/daap/daapd/] comes in. It’s written by Alexander Oberdörster. It simply does what we want it to do. It stays out of your way, scans a folder recursively for musicfiles, and streams these to the subnet via Bonjour (read: mDNS) to the subnet and iTunes will simply pick up on it. It uses something called mDNSResponder for this, which is part of both the “Apple Bonjour source”:http://developer.apple.com/darwin/projects/bonjour/ and [“howl”:http://www.porchdogsoft.com/products/howl/]. Indeed mans new best friend. Follow the instructions on daapd’s site to compile and install this, with just a few minor modifications (at least on my part); I want to use libhowl to broadcast on mDNS, not Apple’s mDNSResponder. daapd supports this natively in the source. This means that daapd will announce itself on the network rather than using other software for it. Open up makefile'' in the daapd distribution, and changeENABLE_HOWL = 0” to a “1”. make && make install.

Now, you want to set up the configuration of daapd. Mine looks like this:

Port            3689
ServerName      iTunes
DBName          Aida Jukebox
Password        
Root            /storage/music
Cache           /home/jespern/.daapd-cache
Timescan        2
Rescan          1


Notice that I have not defined a password. This is because iTunes does not support this, so leave it blank.

Before you run daapd, you must run the mDNSResponder from howl. Then you simply just start daapd;

[aida/jespern] ~ > daapd -c daapd.conf 
scanning /storage/music for audio files...  done
distributeUpdates


Cool. What happens on my Mac? !http://printf.dk/img/itunes.png(Exactly what should happen)! Exactly what should happen. I’m happy.

← Previous: White Oslo  //  Next: Upgrading the firmware on the SE W800

comments

Vetle, 3 years, 1 month ago:

Now we just need a Bonjour plugin in Amarok…

Espen, 3 years, 1 month ago:

Does it report the songs played via bonjour to services like last.fm?

Jesper, 3 years, 1 month ago:

Surely if you install a suitable plugin for your player (exists for iTunes, e.g.), I doubt that the frontend would care whether your sources are local or DAAP. In short: Yes. :-)

Johs, 2 years, 12 months ago:

Hiya. I wouldn’t say it works perfectly well, because… Well, it doesn’t. First of all, iTunes will crash when you’re about 2 minutes into a song (both Windows and OS X). On my computer, anyway. I’m wondering if that may be a Howl problem? And there is no support for m4a tags, which really sucks! And of course, iTunes doesn’t support playlist with remote files. All in all, I’m pretty disappointed, because this could have been really cool.

Jesper, 2 years, 12 months ago:

Johs, Yeah, I experience the same kind of problems. I’ve considered using the mDNSResponder made by Apple, opensourced on both *nix and windows. I’ve blamed it on iTunes so far though. The protocol seems pretty easy (http-based or something). Might be a bug in iTunes. Ah well. :)

Fredrik, 2 years, 11 months ago:

I’ve also experienced this kind of problem. With daapd -v you can monitor the ongoing daapd process and view what’s happening when iTunes crashes/disconnects. I’m pretty sure this is caused by the automatic rescan with a default interval. During the rescan my box (OpenBSD 3.8, 256MB RAM, 700mHz Celeron, 320GB 7200rpm 8MB) doesn’t seem to be able to send any information to my listening computer. I guess this is caused by cpu usage during the rescan. So if anyone know how to turn off the auto rescan in daapd I’d be really happy to know. I’ve tried many variants of “Rescan”, “Rescan 0”, “Rescan 10”, … Rescan only seem to set the interval between the rescans.

Fredrik, 2 years, 11 months ago:

I’ve also experienced this kind of problem. With daapd -v you can monitor the ongoing daapd process and view what’s happening when iTunes crashes/disconnects. I’m pretty sure this is caused by the automatic rescan with a default interval. During the rescan my box (OpenBSD 3.8, 256MB RAM, 700mHz Celeron, 320GB 7200rpm 8MB) doesn’t seem to be able to send any information to my listening computer. I guess this is caused by cpu usage during the rescan. So if anyone know how to turn off the auto rescan in daapd I’d be really happy to know. I’ve tried many variants of “Rescan”, “Rescan 0”, “Rescan 10”, … Rescan only seem to set the interval between the rescans.

Fredrik, 2 years, 11 months ago:

sorry for double posting

Fredrik, 2 years, 11 months ago:

Hi again! I’ve found a simple solution for me atleast. I contacted a guy with appearently the same problem as me, and I soon recieved the answer. Just delete all m3u-files. Maybe it feels bad to do that, but iTunes doesn’t crash and the rescan makes nothing bad except eating some cpu for a while. Thanks to Joe! Good luck to you other guys. /Fredrik

Johs, 2 years, 11 months ago:

Hiya again! I’ve been spending hours on this (not continually ;)), and finally I’ve got it working! My problem was that it worked out first time, with the crashes, and I looked and tried out new methods, and at the time I read your post, I couldn’t get daapd running. Anyhoo, after recompiling everything quite a few times, it finally worked - god knows why. It crashed as usually, so I deleted the playlists I had, an voila! I’ve been listening the last 30 minutes, without one single crash. Indeed very pleasing! (Short version: Thanks Frederick.)

powered by