Streaming iTunes from Ubuntu

by Niel M. Bornstein

As part of my home network rejiggering, I wanted to start serving my music files from my desktop machine. In part, this is to save space on my iBook, and in part, it's just because I can.

I started by googling for a precise howto for my system. While this didn't turn up anything for Ubuntu, it did point me to mt-daapd, the multithreaded DAAP server. DAAP is Apple's Digital Audio Access Protocol, which is what iTunes uses to share music. mt-daapd also requires Howl, a cross-platform implementation of the Zeroconf standard (which Apple calls Rendezvous).

To set up my server, I first installed howl:

sudo apt-get install howl-utils libhowl-dev libhowl0

Unfortunately, there's no deb for mt-daapd in the Ubuntu universe. So I had to download the deb from SourceForge and install it like so:

sudo dpkg -i mt-daapd_0.2.0_sid_i386.deb

I created a directory /var/media/music for my music files, and copied some MP3s there for testing. Then I edited /etc/mt-daapd.conf to tell mt-daapd where to find music files, as well as some other details. Then I took a deep breath and started mt-daapd with its script:

sudo /etc/init.d/daap start

The admin web page (on http://localhost:3689 by default) came right up and showed me that mt-daapd was running, and had scanned four MP3 files.

For extra bonus points, I added mt-daapd to the runlevel startup scripts, so it will start every time the machine starts up:

sudo update-rc.d daap defaults

I fired up the iTunes player on my iBook and connected to the server. There it was! However, double-clicking on a song didn't do anything.

The mt-daapd log showed a variety of errors. After scanning the mt-daapd forums without finding an exact remedy, I decided to ditch the deb and installed the latest source tarball (version 0.2.1-pre2) instead. This required installing a few more dependencies (like libgdbm-dev and libid3tag0-dev), but all of them were available in the Ubuntu universe. I configured it to install in /usr/local, so as not to conflict with the version from the deb.

To make sure that the right version of mt-daapd starts up, I edited /etc/init.d/daap, changing the DAEMON variable to point to /usr/local/sbin/mt-daapd.

That one worked. I packaged up all the music files ripped on my iBook and copied them over to my Ubuntu box. Et voila! Now I had music streaming across my home network.

But I still can't play all my music files locally on the server, where the nice Harmon Kardon speakers are plugged in, because many of them are encoded as AAC. XMMS, my music player of choice on Linux, doesn't seem to handle AAC encoding.

Next step: finding and installing an MP4 codec for XMMS. I'll leave that for a future weblog.

Are you streaming iTunes on Linux?


2004-12-23 15:12:23
mt-daapd vs daapd, and a DAAP tailing concept
I've used both daapd and mt-daapd over the last year to stream the majority of my music from a Linux server to various Macs. daapd is a bit more broken-up (you have to compile a patched httpd, for example) and a bit more primitive, but I've found it's a lot faster at sending the library to iTunes.

However, I've generally been happier with mt-daapd, despite the speed of connection; recent versions support the compilation tag (TCMP, I believe) in ID3v2.3, which is supported really nicely in iTunes itself, and its logging, playlist and configuration support all seem more mature.

One idea that I never did get around to- and given the changes in my network setup now I've moved, I'm unlikely to- is the concept of tracking the DAAP server log and playing the same song on the Linux box as well. That would give you the ability to use the iTunes interface to pick songs, while also using your better speakers to listen to them. (You'd have to be careful if you get multiple DAAP sessions, and there's the problem of the Mac making noise at the same time, but I'm sure these can all be worked around). Anyway, it's a nice idea to think about, perhaps.

I await the results of your search for AAC playback with interest.

2004-12-23 18:55:40
It works for me
I just installed it on my box running Debian sarge and I'm able to connect to it and play music from my powerbook.
2005-03-13 08:06:05
And what about reading itunes streamed music on Linux
I would like to read some music streamed by my Powerbook itunes, on a PC working ubuntu...

Is there a way to do it?

Do you know it exists a linux software that can be client of itunes stremed media?

Thanks for your help.

MLP (michel at levy-provencat dot net)

2005-07-23 14:33:55
AAC playback

Transcode Home Page:

Guide to ripping and encodeing under linux:

Monitor These lists for changes to the CVS sources of XVID

Unoffical Debian APT sources I use (with apt-pinning testing/unstable)

# Video Packages like transcode, mplayer, xvid
deb testing main

# Video Packages like transcode, mplayer, xvid
deb unstable main

##RAREWARES AAC/MP4 (faad2, faac, aac/mp4 playback plugins)
deb ./

##RAREWARES MAIN (lame, lame-ha, lamip, cue2toc, shntool)
deb ./
deb ./

# mkvtoolnix
deb ./

those are some media sources to add to your sources.list for debian sid. I don't know how that works w\ unbuntu but last i checked unbuntu already had the packages they just needed to be installed. xmms should then work with it.
question i am on debian sid, what are the sources you used to get howl and mt-daapd. are they part of the standard or did you find them somewhere else? thanks

2005-12-14 09:00:58
aac with xmma
sudo apt-get install xmms xmms-aac