Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Use a Linux box as an iTunes music server UNIX
My wife and I are slowly running out of hard drive space on our iBooks. We both have huge music libraries (we ripped all our CDs). I decided I would try to setup my Linux server (which serves up files to our Macs via Samba) to also share music. Instead of just moving our files to the server and adding the songs to our library, I wanted to use the built-in iTunes sharing instead. Most of the files for doing this are available for Linux, but almost completely undocumented. Here is my walk through of how I got it working.

First let me state that this is not intended to do illegal music sharing across the internet; this setup is only intended to allow you to share your music with your family on the local network. I'm assuming you have setup a Linux server for Samba sharing or NFS. If you haven't, there are a number of how-to's and other resources on the web you can google.

You will need to download a few files to your Linux server first. Apple uses a protocol called daap to share music libraries. Rendezvous is also used to announce which services are available. You will need to download Apple's Rendezvous multicast DNS advertiser (free registration required) to make your Linux machine broadcast itself. You will then need to go to the daapd page and download all the appropriate files. I'm using Redhat 9 and everything compiled just fine on my computer. There is a sample configuration file included with the daapd server source code that you can edit and copy to /etc/daapd.conf.

Once everything is compiled, create a music folder on your Samba server and copy some music to it. Next you will need to run the multicast DNS advertiser from Apple with the following line as root user:
  mDNSProxyResponderPosix 10.0.1.201 squeal "Music Jukebox" _daap._tcp. 3689 &
10.0.1.201 is the IP address of your server and "Music Jukebox" is the name you will advertise to iTunes. Once that is running, you can edit the /etc/daapd.conf file to match your needs with directory, server name, and share name. Start the daapd daemon by typing this as root:
  daapd &
Once that is complete, you can open iTunes and it should pop up as a shared music library. This software is all in very early development so it doesn't do things like handle Album covers or updates to the library. It has some bugs still, but you can help the developers at the daapd page.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[209,281 views]  

Use a Linux box as an iTunes music server | 89 comments | Create New Account
Click here to return to the 'Use a Linux box as an iTunes music server' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Why?
Authored by: escowles on Mon, Jul 28 2003 at 10:53AM PDT
I've got to ask why you would want to do this. If you can share the files via AppleShare, Samba or NFS, why not just add them to your library? It lets you add/delete files, add album cover info, etc. If the share isn't mounted, double-clicking on a song in iTunes will mount the disk for you. What could be simpler?

I've had lots of problems with NFS (crashes reliably after playing mp3s for a few hours) and a few problems with AppleShare (netatalk doesn't support long filenames very well, at least as of 1.6). But I've been using Samba for a few weeks now, and it works like a charm. Other than feeling a little weird using Samba to network between to Unix machines (OSX and Linux), I don't have any complaints.

-Esme

[ Reply to This | # ]
Why?
Authored by: sweetsdream on Mon, Jul 28 2003 at 12:38PM PDT
I didn't know iTunes would auto mount a SMB share, I'll give it a try. I did this mainly to see if I could and I was suprised how easy it was.

I also have freinds that come over and access my Airport network. Setting up samba on Linux for many users or guest users is very insecure.

---
Cheers,

Sweetsdream

[ Reply to This | # ]
Why?
Authored by: zojas on Mon, Jul 28 2003 at 1:31PM PDT
I want to be able to plug my ibook into my tv and splash the itunes visualization stuff on the screen while the music plays through my big stereo (also plugged into the ibook). I have 20gb worth of mp3s (all from my cds). I don't have that much space on my ibook's drive.

when I'm away from home, I don't want to see a bunch of songs in my itunes library I can't play.

[ Reply to This | # ]
Why?
Authored by: tcurtin on Tue, Aug 26 2003 at 6:00PM PDT
Once again....
<ax grinding>if iTunes supported smart lists based on *file location* this wouldn't be a problem. Just make a smartlist for local files when you're on the road, and a smartlist for your server, your ipod... Allows all kinds of other organizational options as well. Apple... listening?
</ax grinding>

---
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, Historical Review of Pe

[ Reply to This | # ]
Why?
Authored by: brainsik on Wed, Oct 22 2003 at 5:55AM PDT
Comments like these remind me of the true reason I rather be using free software.

[ Reply to This | # ]
Why?
Authored by: GaelicWizard on Thu, Jul 31 2003 at 1:40AM PDT
The daap protocol is especially designed to stream music. Using any other standard file sharing method would be much less efficient.

---
Pell

[ Reply to This | # ]
Why?
Authored by: imagine on Thu, Apr 15 2004 at 5:43PM PDT
I agree. daap'ing your own music is dumb. I tried it a few months ago. It's dumb because the music is not in your library so you can't do any fun stuff like ratings and smart playlists.

Run NFS on the Linux machine and use the iTunes Library Manager script to switch between your Network-library when at home and your laptop's library when traveling.

I come home, hit Cmd-K and double click my Mp3 share. Good to go. I even use mDNS on the Linux machine so I can use a Rendezvous name for the NFS share. With Panther I don't have to necessarily worry about unmounting the share. When I'm out of my home, it times out and lets you autodisconnect the dead share after 30 seconds or whatever.

[ Reply to This | # ]
Why?
Authored by: boostdave on Sun, Sep 5 2004 at 1:04PM PDT
Unfortunately my wife's iBook had some problems reading files over a wireless Samba connection without glitching (I realize NFS is supposed to be better, but I have to serve to windows machines too and it looks like I'm having a hard time getting NFS going anyway).

It seems, from what I've been reading, like there are some real limitations with the DAAP approach, like for example that you can't sync parts of your library to an iPod attached to a client machine being served these files.

If I keep the files on a shared disk it seems to me that I'm going to be losing the buffering capability that would help smooth out network bandwidth issues, right? Also, IIUC there's some facility for "pushing" library index updates from the server to clients -- is that right? I guess I'd lose that, too.

Or does it make sense to use both approaches in tandem so that I can sync an iPod, too? I'm a little vague on iTunes' library management capabilities; I don't know if this can be done sanely.


[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: rickg17 on Mon, Jul 28 2003 at 2:25PM PDT
can you sync a portion of this to an iPod?

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: sweetsdream on Mon, Jul 28 2003 at 3:06PM PDT
No. It's the same as listening to someone else's Music Library. We didn't move music from our computers that we sync with our iPods.

---
Cheers,

Sweetsdream

[ Reply to This | # ]
Probably violates the DMCA
Authored by: chrisgagne on Mon, Jul 28 2003 at 2:54PM PDT
Just a friendly reminder that this hack probably violates the DMCA since it allows more than one person to listen to a particular song at once and bypasses licensing restrictions. Of course I wouldn't take that seriously, but its interesting to see what the RIAA has done to our legal system.

[ Reply to This | # ]
Probably violates the DMCA
Authored by: foo12 on Mon, Jul 28 2003 at 2:59PM PDT
First, the DMCA is not pertinent.

Further, it's personal use in one's home. The same effect -- two people listening to the same song -- could be achieved by cranking up the volume.

[ Reply to This | # ]
Probably violates the DMCA
Authored by: io on Tue, Jul 29 2003 at 5:27PM PDT
daapd only shares MP3 files. we don't circumvent anything! licenses and restrictions are only present in AAC files from the iTMS and these are not played.

io

[ Reply to This | # ]
Probably violates the DMCA
Authored by: salvo on Mon, May 3 2004 at 5:33AM PDT

daapd is an alternative Server which supports the sharing of AAC files too.
There is preliminary support for encoded (iTMS) AACs… the normal restrictions apply, only 5 devices etc.

IANAL, but I don't see why the DCMA would come into conflict with this concept. It doesn't let you share unlicenced music in any way which iTunes doesn't, it just lets you share the music from a Linux Box, rather than a Mac or Windows Box running iTunes.



[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: cerbero on Mon, Jul 28 2003 at 3:02PM PDT
I get this error when trying to start daapd:

daapd: error while loading shared libraries: libid3tag.so.0: cannot open shared object file: No such file or directory

I have installed libid3tag without problems though, so I don't know what's going on. Anyone have any idea?

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: wiley on Mon, Jul 28 2003 at 3:08PM PDT
Try adding /usr/local/lib to /etc/ld.so.conf and then running ldconfig.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: sweetsdream on Mon, Jul 28 2003 at 3:12PM PDT
I had the same problem. You need to load the libraries for ID3. To do this you will need to edit your /etc/ld.so.conf file and add /usr/local/lib. Once you save the file type ldconfig at the prompt.

---
Cheers,

Sweetsdream

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: edarkarchon on Mon, Jul 28 2003 at 7:25PM PDT
or reinstall libid3 with the configure option --prefix=/usr

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: chincotaco on Mon, Jul 28 2003 at 10:01PM PDT
I set this up on my G4 server, and it works wonderfully. The only problem is that the program doesn't scan the directory recursively.

I'd really hate to have to give up my iTunes-organized music folder, but if that's what it takes to run this, oh well.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: semios on Mon, Jul 28 2003 at 11:14PM PDT
Maybe you could do something like this:

flat_dir=all_mp3s
for file in $(find . -name "*.mpg"); do
     ln -s $file $flat_dir/$(basename $file)
done

Well, if it'll work with symbolic links then that should do it.

[ Reply to This | # ]

Use a Linux box as an iTunes music server
Authored by: sweetsdream on Tue, Jul 29 2003 at 1:09AM PDT
I am using an Intel Linux box and it scans the directories recursively. You should send a note to the developer because it sounds like it might be a PPC problem.

---
Cheers,

Sweetsdream

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: pglock on Tue, Oct 21 2003 at 3:02PM PDT
I had a similar problem. It turned out that daapd didn't like a space in one of the directory names, escaping with a '\' didn't help. When I renamed the directory everything worked ok.

---
Too lazy to think of an original signoff...

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: io on Tue, Jul 29 2003 at 5:23PM PDT
that's strange. it should scan the directory recursively, even on a PPC machine. the only limitation is, that files or folders beginning with a . are ignored. could you please try to examine this problem further and write a report to the daapd developers? thank you!

io

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: wiley on Wed, Jul 30 2003 at 7:10PM PDT
I had the same problem when I had the directory set in daapd.conf as /local/Music. I changed it to /local/Music/iTunes/iTunes Music and it started working. I guess if it doesn't find any mp3s in the first couple of levels it gives up.

[ Reply to This | # ]
how did you configure daap on osx?
Authored by: nick on Tue, Oct 21 2003 at 3:37PM PDT
i couldn't figure out, how to configure daap wich directory to share on osx. could s.o. please help me with that.

to prevent questions: i don't want to loginto my server and start iTunes.

[ Reply to This | # ]
how did you configure daap on osx?
Authored by: nick on Tue, Oct 21 2003 at 3:52PM PDT
i couldn't figure out, how to configure daap wich directory to share on osx. could s.o. please help me with that.

to prevent questions: i don't want to loginto my server and start iTunes.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: inTheKnow on Tue, Jul 29 2003 at 1:07AM PDT
This works like a charm. Well thought out and nicely written.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: wiley on Tue, Jul 29 2003 at 2:17PM PDT
What version of iTunes are you using? I can't seem to get it working and was wondering if this is broken in 4.0.1.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: sweetsdream on Tue, Jul 29 2003 at 3:38PM PDT
I am using 4.01 on two iBooks and it is working great. I did find on problem with multiple IP addresses not working. Do You see the server in your library?

---
Cheers,

Sweetsdream

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: cerbero on Tue, Jul 29 2003 at 12:01PM PDT
Thanks! Running ldconfig did the trick.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: cerbero on Tue, Jul 29 2003 at 12:07PM PDT
Oh crap, replied in the wrong place :p

Oh well, anyway. iTunes doesn't seem to pick up on the Rendezvous broadcast.. Any way I can check it? Or can I open the daap share manually?

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: sweetsdream on Tue, Jul 29 2003 at 3:43PM PDT
Are you runnig the Apple mDNSProxyResponderPosix with the correct arguments? The port number should be the most important part (3689) you also need the squeal and your hostname in quotes.

---
Cheers,

Sweetsdream

[ Reply to This | # ]
Use a WINDOWS box as an iTunes music server?
Authored by: pyrohotdog on Tue, Jul 29 2003 at 3:57PM PDT
I see that in the Rendezvous folder, that it can be used on Windows. My PC upstairs has 80GB, would it be possible to convert this hint to Windows, and use it as the server instead?

---
~>=AaRoN

[ Reply to This | # ]
Use a WINDOWS box as an iTunes music server?
Authored by: io on Tue, Jul 29 2003 at 5:12PM PDT
the probleme is not rendezvous, it's daapd. it uses a library to become a webserver and it is not that easy to port this to windows. maybe cygwin can get you there.

io

[ Reply to This | # ]
Use a WINDOWS box as an iTunes music server?
Authored by: Appleman on Mon, Nov 10 2003 at 8:12AM PST
If you are going to run it on Windows, why not just install iTunes and turn on sharing?

[ Reply to This | # ]
ERROR
Authored by: sweetsdream on Tue, Jul 29 2003 at 4:01PM PDT

Sorry, some of you may have found this problem already. The line to start Rendezvous service is actullay this:

mDNSProxyResponderPosix 10.0.1.201 squeal "Music Jukebox" _daap._tcp. 3689 &

This will allow the service to show up in iTunes.

---
Cheers,

Sweetsdream

[ Reply to This | # ]

ERROR
Authored by: wiley on Wed, Jul 30 2003 at 7:03PM PDT
Thanks. It's working now. Very cool.

I wish you could see the album artwork and that iTunes kept up with the last time you played a song.

[ Reply to This | # ]
ERROR
Authored by: lukken on Tue, Aug 26 2003 at 1:03AM PDT
This is the same as listed previously. Is it correct. I am not getting anything in my iTunes list once I run this.

[ Reply to This | # ]
Jukebox is visible, but never loads songlist?
Authored by: jac_green on Sat, Aug 2 2003 at 4:06PM PDT
The jukebox shows up fine in iTunes, but when it's clicked, the shared music never loads. (Barber pole just spins, then eventually iTunes just gives up and displays the most recent playlist). Is there a maximum number of songs that can be shared or something? Thanks for figuring this out, I've wanted to do this for ages.

[ Reply to This | # ]
Jukebox is visible, but never loads songlist?
Authored by: jac_green on Sat, Aug 2 2003 at 4:25PM PDT
skip it, i did something stupid. (used the wrong ip address in the mDNSProxyResponder command.) i hate when that happens.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: zojas on Thu, Aug 7 2003 at 10:31PM PDT
Got this working, it's quite cool.

the mp3z don't have to be on a samba or nfs share, right? daapd streams the data out, so the files can live in a plain old directory?

[ Reply to This | # ]
Problem with make daad
Authored by: JcJensen on Sun, Aug 24 2003 at 7:00PM PDT
Hi,

i have a problem with make of daad

i type in " make"

the result is:

[...]
dboutput.h:106: request for member `clear' in `out', which is of non-aggregate type `int'
dboutput.h:107: request for member `size' in `this->Dictionary<Song>::map', which is of non-aggregate type `int'
dboutput.h:108: request for member `begin' in `this->Dictionary<Song>::map', which is of non-aggregate type `int'
dboutput.h:108: request for member `end' in `this->Dictionary<Song>::map', which is of non-aggregate type `int'
dboutput.h:109: invalid type argument of `unary *'
dboutput.h: In member function `T* Dictionary<T>::find(...) const [with T = Container]':
types.h:292: instantiated from here
dboutput.h:114: `id' undeclared (first use this function)
dboutput.h:115: invalid type argument of `unary *'
dboutput.h:115: request for member `end' in `this->Dictionary<Container>::map', which is of non-aggregate type `int'
make: *** [daapd.o] Fehler 1


anybody know what to do ?

thx jens

[ Reply to This | # ]
Problem with make daad
Authored by: Shawn Parr on Mon, Oct 6 2003 at 5:20PM PDT
Make sure you install daaplib, not the libdaap. I made this same mistake, they are both linked to from the daapd page.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: lukken on Tue, Aug 26 2003 at 1:36AM PDT
I am unsure what needs to be in the daapd.conf. Where do I enter the directory, server name and share name? I have compiled everything, but don't think that it is configured right.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: scottwat79 on Fri, Oct 17 2003 at 12:09AM PDT
I am wondering if you can use this on OSX as well, particularly OSX server. If so what would you do about the mDNSresponder? And would you have to download the daap program? or would this all built in. Basically my set up now is that I have one large drived computer load up and auto login a user and auto run itunes to set up a share. This is a headless system in the closet out of the way and I use my iBook to access it. But I was looking at getting an xServe and didnt want it to autologin just share out a music directory and be able to do all the other stuff (SMB shares, AFP shares, Authentication, etc) anyone tried this kind of setup?

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: io on Sat, Oct 18 2003 at 11:28PM PDT
sure you can! daapd has been developed on an os x box. it has only later been made sure that it works on other platforms.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: alberjo on Wed, Oct 22 2003 at 1:36PM PDT
Works like a charm... almost.

daapd seg faults when pulling mp3s off a local ntfs filesystem.
no problems with other fs.

before any major time investment, anyone know this to be a lost cause or simple fix.

thank you for your time,

-unix guy surrounded by apple lovers

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: alberjo on Thu, Oct 23 2003 at 1:19PM PDT
hmm....

daapd appears to work with ntfs under 2.6.x kernels, but not 2.4.20-20.9 or 2.4.22. I think a rewrite of ntfs started in 2.5, so maybe this functionality is only available from there on up. Just a guess though.

anyways, sorry to bother you all.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: Lemuel on Wed, Oct 22 2003 at 4:03PM PDT
I don't get it working.
It compiles just fine (at least no errors).
My computer is named lacci and has the IP 192.168.0.1
I run Rendezvous with

./mDNSProxyResponderPosix 192.168.0.1 squeal "lacci" _daap._tcp. 3689

and get

Made Service Records for lacci._daap._tcp.local.
Service lacci._daap._tcp.local. now registered and active

On the daapd site I chose to use the default values (with a config file it didn't work either). This gives me

/home/lemuel/src/iTunes/daapd-0.2.1c/daapd
scanning . for mp3s... done.

But by room neighbour with iTunes on his Windows box does not see me there.
I ran both commands as root.
daapd is running, I cannot start it twice.
How can I look if the Rendezvous part is working?

What's wrong?

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: bluehz on Wed, Oct 22 2003 at 6:49PM PDT
Sounds like you might have a firewall issue - or your neighbor does. Make sure you have the port 3689 open.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: tjipke on Sat, Nov 15 2003 at 9:17AM PST
That's funny, I'm using a Linux box as a server, but on my windows machine I can see the shared music but not on my OSX machine. They are on the sam swicht and have no firewalls.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: zarqman on Sun, Nov 16 2003 at 5:22PM PST
you're positive that the built in firewall in os x is turned off? that'd be the most likely point for a problem.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: tjipke on Mon, Nov 17 2003 at 7:23AM PST
I'm sure my firewall is off. Strange thing is that I tried it on an other linux box and that one I can see from my windows and OSX machines.

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: bluehz on Wed, Oct 22 2003 at 11:07PM PDT
I have this up and running fine - but it seems only able to accept one client at time. Does anyone know if this is true or not? Documentation of daapd is little to none.

[ Reply to This | # ]
Automated start, stop script for daap on Red Hat
Authored by: migurski on Thu, Oct 30 2003 at 1:29PM PST

The following script can be used to start and stop daap service automatically. When placed in /etc/init.d/ (Red Hat), it becomes a service that can be started up at boot time. Modify $musicdir to suit your local configuration.


#!/bin/sh
# chkconfig: 5 99 1
# description: in Soviet Russia, music listens to YOU

musicdir=/usr/local/share/apache/htdocs/music

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
export PATH

mode=$1    # start or stop

case "$mode" in
  'start')
    echo "Starting iTunes music service"

    mDNSProxyResponderPosix 192.168.1.1 squeal "Studio Music" _daap._tcp 3689 &
    sleep 5
    daapd -C $musicdir/daapd.cache $musicdir &
    sleep 5

    ;;

  'stop')
    echo "Stopping iTunes music service"

    for PROG in daapd mDNSProxyResponderPosix; do
        for PID in `ps -C $PROG -o pid`; do
            if [ $PID != 'PID' ]; then
                kill -15 $PID;
                sleep 2;
            fi;
        done;
    done;
    ;;

  'restart')
    $0 stop
    $0 start
    ;;

  'status')
    for PID in `ps -C daapd -o pid`; do
        if [ $PID != 'PID' ]; then
            PID1=$PID;
        fi;
    done;
    for PID in `ps -C mDNSProxyResponderPosix -o pid`; do
        if [ $PID != 'PID' ]; then
            PID2=$PID;
        fi;
    done;
    echo "daap (pids ${PID1}, ${PID2}) is running...";
    ;;

  *)
    # usage
    echo "usage: $0 start|stop|restart"
    exit 1
    ;;
esac


[ Reply to This | # ]
Automated start, stop script for daap on Red Hat
Authored by: nyamuk on Thu, Nov 20 2003 at 5:52PM PST
Thank you for posting your initscript. Im having problems with the following :

    daapd -C $musicdir/daapd.cache $musicdir &
Will not work with the arguments "-C musicdir/daapd.cache $musicdir &" The service shows up on clients but there are no songs. But will work with :

daapd &
My script posted below:

#!/bin/sh
# chkconfig: 5 99 1
# description: in Soviet Russia, music listens to YOU

musicdir=/var/itunz

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
export PATH

mode=$1    # start or stop

case "$mode" in
  'start')
    echo "Starting iTunes music service"

    mDNSProxyResponderPosix 192.168.1.1 squeal "Studio Music" _daap._tcp 3689 &
    sleep 5
    daapd  &
    sleep 5

    ;;

  'stop')
    echo "Stopping iTunz music service"

    for PROG in daapd mDNSProxyResponderPosix; do
        for PID in `ps -C $PROG -o pid`; do
            if [ $PID != 'PID' ]; then
                kill -15 $PID;
                sleep 2;
            fi;
        done;
    done;
    ;;

  'restart')
    $0 stop
    $0 start
    ;;

  'status')
    for PID in `ps -C daapd -o pid`; do
        if [ $PID != 'PID' ]; then
            PID1=$PID;
        fi;
    done;
    for PID in `ps -C mDNSProxyResponderPosix -o pid`; do
        if [ $PID != 'PID' ]; then
            PID2=$PID;
        fi;
    done;
    echo "daap (pids ${PID1}, ${PID2}) is running...";
    ;;

  *)
    # usage
    echo "usage: $0 start|stop|restart"
    exit 1
    ;;
esac


[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: alien8d on Sat, Nov 1 2003 at 8:27PM PST
I've got all of the components compiled and running on RedHat Linux 8.0. seems to work pretty nicely, and I can even access it from 2 machines simultaneously (although since installing i've pretty much just used one of my machines)

what i've noticed is that after awhile (seemingly randomly or if i put the machine to sleep and then wake it up) the responder either stops broadcasting the daapd share or something else is broken.

when this happens, a netstat -an shows a connection from the client machine on port 3689 as ESTABLISHED (although it really isn't)

so far the only way to get iTunes to see the share again is to restart the mDNSProxyResponder.

has anyone else experienced this? any suggestions?

thanks

a8

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: iLoveiTunes on Mon, Dec 13 2004 at 5:18PM PST
I've got the same issue... daapd service fully available in iTunes, but disappears after a while. Any idea meanwhile to get around this?

thanks
Sven

[ Reply to This | # ]
Compiling mDNSResponder on Redhat 7
Authored by: tjipke on Tue, Nov 4 2003 at 5:15PM PST
I want to try touse my Redhat 7 Machine for this, but I can't get mDNSResponder compiled on it. (I'm not a very experienced user.) Are there other people that had succes on RedHat7?

This is what I get when I run make os=linux from the mDNSPosix directory:

if test ! -d objects ; then mkdir objects ; fi
if test ! -d build ; then mkdir build ; fi
cc -c -g -I../mDNSCore -I. -DMDNS_DEBUGMSGS=2 -DNOT_HAVE_SA_LEN -W -Wall ../mDNSCore/mDNS.c -o objects/mDNS.c.o
../mDNSCore/mDNS.c: In function `mDNS_RegisterInterface':
../mDNSCore/mDNS.c:6405: parse error before `*'
../mDNSCore/mDNS.c:6407: `q' undeclared (first use in this function)
../mDNSCore/mDNS.c:6407: (Each undeclared identifier is reported only once
../mDNSCore/mDNS.c:6407: for each function it appears in.)
../mDNSCore/mDNS.c:6418: `rr' undeclared (first use in this function)
make: *** [objects/mDNS.c.o] Error 1

thx,

Tjipke

[ Reply to This | # ]
Same problem with debian
Authored by: prohtex on Sun, Nov 30 2003 at 7:25PM PST
I am having the same problem compiling mDNSResponder on debian linux, does anybody have a fix?

[ Reply to This | # ]
Same problem with debian
Authored by: king_arthur on Tue, Dec 16 2003 at 5:55PM PST
I am also running Debian on my linux box and, if this can cheer you up, after two evenings spent compiling and setting-up the daapd part of the server now I am stuck with the same identical problem as you...
mDNS doesn't compile and give me same error.

Did you make any progress on it?

I guess daapd is useless without the responder or is possible to connect iTunes anyway? if yes how?

[ Reply to This | # ]
Compiling mDNSResponder on Redhat 7
Authored by: king_arthur on Tue, Dec 16 2003 at 6:21PM PST
Hi Tjipke,

have made any progress on this problem?

Are you using the daap server now?

[ Reply to This | # ]
ID3 tags on AAC?
Authored by: nitropowered on Sun, Nov 9 2003 at 10:24PM PST
So I have everything running great except the ID3 tags for my AAC encoded files do not show. They do however for MP3s. I also verified if the tags were stripped by copying the file back into my iTunes library and the tags are still there. I encoded my AAC files using iTunes 4.0.1 using standard settings. Is it just the libid3tag does not support AAC?

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: arcterex on Tue, Nov 11 2003 at 1:13PM PST
I had a silly problem I figured I'd share here in case anyone else gets it. I was having a hell of a time compiling libhttpd-persistant on my gentoo linux box, with all sorts of c++ parsing errors when ever I tried to compile it. Turns out I forgot that the command gcc is not the same as g++. The makefile for libhttpd somehow mis-understood this and inserted the wrong command in the makefile. Changed it from gcc to g++ and it all worked. Just waiting for daapd to finish scanning my mp3s before I can confirm it all worked, but all the files are compiled and running now!

[ Reply to This | # ]
Thank You!
Authored by: RafeDawg on Sun, Dec 28 2003 at 4:37PM PST
I too use gentoo, and had the exact same problem. Thank you so much for posting!

[ Reply to This | # ]
Errors Compiling
Authored by: jakobie on Fri, Nov 14 2003 at 8:51PM PST
All right, I did all of this

daaplib
libhttpd
libid3tab
zlib

When I "make" daapd I get an error

[jakobie:jakobie/Desktop/daapd-0.2.1c] jakobie# make
g++ -Wall -Wno-multichar -I. -c daapd.cc
In file included from daapd.cc:24:
types.h:35:20: id3tag.h: No such file or directory
In file included from daapd.cc:24:
types.h:357: `id3_tag' was not declared in this scope
types.h:357: `tag' was not declared in this scope
types.h:357: parse error before `char'
make: *** [daapd.o] Error 1

Any ideas?

[ Reply to This | # ]
Errors Compiling
Authored by: kodiaksystems on Sun, Nov 16 2003 at 4:13PM PST
i had the same on suse 7.1 ... seems i had an old version of libid3
- i just uninstalled the package, and grab the latest version and was ok... if youve installed the latest version.. .then perhaps you need to uninstall the old version

[ Reply to This | # ]
Anyone done this on a FreeBSD server?
Authored by: surfsofa on Mon, Nov 17 2003 at 12:21PM PST
I'm trying to get this up and running on my FreeBSD server, so far without success. Two questions to anyone else who's done this :

1) How did you compile mDNSproxyresponder? I'm having problems with the makefile - any tips?

2) I've tried using mdnsd which appears to do the same job, but no joy with that either. Have you had tried and succeeded with this?

TIA for any pointers :)

[ Reply to This | # ]
Anyone done this on a FreeBSD server?
Authored by: sandro on Mon, Nov 17 2003 at 3:18PM PST
Near the top in the section on OS's and add the following lines to your Makefile:

ifeq ($(os),freebsd)
CFLAGS_OS = -DHAVE_SOCKADDR_SA_LEN -DHAVE_DAEMON -DHAVE_SOCKLEN_T
else
.
[section on osx & cantbuild]
.
endif

[ Reply to This | # ]
Use a OSX box as an iTunes music server
Authored by: JonnyG on Thu, Nov 20 2003 at 6:20PM PST
So can you do this running OSX 2 or 3? I'm running Jag server on an older box with tons of drive space. Right now, I have it set to automatically log in and launch iTunes so that the whole library is available. However, I can't add new music remotely with out VNC or something similar, and I don't want to do that. I would much rather have this running with no user logged into the GUI. More processor time for the server functions, instead of a GUI that no one is using.

If this is possible, how would new music be added to the lists? I know how to add it to the drive remotely, but would it have to be added to the broadcasted playlists manually through SSH? I'm ok with that. I have SSH running on the server anyway. I just don't want to run VNC or Timbuktu.

THoughts?

[ Reply to This | # ]
Use a OSX box as an iTunes music server
Authored by: beepotato on Sun, Feb 1 2004 at 10:44AM PST

"However, I can't add new music remotely with out VNC or something similar, and I don't want to do that."

To add a music file to your playlist through SSH, you can do it with Applescript (after you put the file on the server disk):

  osascript -e 'tell application "iTunes" to
    add ("/UNIX/path/to/your/file.mp3" as POSIX file) to playlist "Playlist name"'

(all that in one line, which was broken here for readability)

Note that the "to playlist..." part is optional. Without it, the file just gets added to your library.



[ Reply to This | # ]
Use a OSX box as an iTunes music server
Authored by: Velociped on Sat, Feb 28 2004 at 10:55PM PST

The previous respondent does not seem to have answered the question(s) which you have posed.

So can you do this running OSX 2 or 3?

Yes; the software compiles without issue under both of the mentioned releases of OS X. Provided you have installed the three required dependencies beforehand, everything will work quite well.

... how would new music be added to the lists?

The method I use is as follows:

My daapd daemon is running on an old, headless 8600 running 10.2.8. I rip my disks on my iBook and then transfer the directories containing the encoded MP3s (the daapd daemon is only able to serve MP3s — not AAC or other format files) into the desired position within the directory tree. Then, restart the daapd process; no need to kill the mDNSProxyResponder. (I have written a StartupItem for the daapd service which contains a restart branch. So, I simply issue the restart command through the SystemStarter. The same result can be obtained by killing the process and restarting the daemon.) Voila, the new tracks are now available throughout the subnet.

... would it have to be added to the broadcasted playlists manually through SSH?

Well, the current release of the daapd daemon does not support playlists — only the master "Library" is published. Thus you would still be required to make use of the GUI and iTunes if you wanted to create and publish specialized playlists.

The alternate mt-daapd project, mentioned in another thread, does support the creation and publication of playlists. However, I have not used this and cannot comment on the procedure.

I just don't want to run VNC or Timbuktu.

As I mentioned above, if you can live without playlists (or are willing to compile and install mt-daapd), then it is possible to maintain (add, subtract, etc.) tracks and albums within your music database remotely and entirely from the command line.



[ Reply to This | # ]
Use a OSX box as an iTunes music server
Authored by: bluehz on Sun, Feb 29 2004 at 12:18AM PST
I second that vote for mt-daapd. Couple of pluses over daapd:

* multithreaded
* supports static and smart playlists
* self-contained - much fewer dependencies
* Supports most ID3v1 and v2 tags
* Runs as a daemon (no need to keep iTunes open as the server)

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: amnesiac on Mon, Dec 8 2003 at 2:31PM PST
Hi,

this works great for me, except that daapd quits with an 'out of memory' message after about 3 hours of random playing.
My linux server has 384 MB RAM and shares about 13000 songs.

Does anyone experience the same?

bye,
André

[ Reply to This | # ]
daapd will not compile for me.
Authored by: jackal on Mon, Jan 12 2004 at 10:18PM PST
I installed all the libs no problem. make and make install-ed each one of them with no problem.

Then I when to compile daapd and here's the error I'm getting:
[root@jackal daapd-0.2.1d]# make
c++ -Wall -Wno-multichar -L. -L/usr/local/lib -o daapd daapd.o db.o dboutput.o songcache.o parsemp3.o -ldaaplib -lhttpd-persistent -lid3tag -lz
/usr/local/lib/libhttpd-persistent.a(api.o): In function `httpdReadRequest(httpd *)':
/media/tmp/libs/libhttpd-1.3-persistent-f/src/api.c:367: undefined reference to `__ctype_b'
/media/tmp/libs/libhttpd-1.3-persistent-f/src/api.c:475: undefined reference to `__ctype_b'
/usr/local/lib/libhttpd-persistent.a(api.o): In function `httpdOutput(httpd *, char *)':
/media/tmp/libs/libhttpd-1.3-persistent-f/src/api.c:933: undefined reference to `__ctype_b'
collect2: ld returned 1 exit status
make: *** [daapd] Error 1



[ Reply to This | # ]
Anyone using this with Mandrake 9.1/tmdns?
Authored by: frido:mac on Mon, Jan 19 2004 at 6:19AM PST
Hello!

I installed and compiled daapd and the required libs on an old G3/266 running Mandrake Linux 9.1.
There already is a "tmdns" service running and I input the servicename "daap" and the portnumber (3689) into /etc/tmdns.services.
But the Library never shows up in iTunes on my Mac.
Do I absolutely need the mDNSRepsonder from Apple? (or is the servicename or something wrong?)

Bye, Frido

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: adjei on Thu, Jan 22 2004 at 9:11AM PST
I have successfully set this up on my local lan and everything is is working fine. I would like to be able to acess the server from work and play my library. Has anyone figured out whether this is possible?

[ Reply to This | # ]
Use a Linux box as an iTunes music server (remotely)
Authored by: mikew on Sun, Feb 1 2004 at 6:30AM PST
I used the following quick hack using SSH. First compile mDNSResponderPosix on your local machine. That is the machine on which you run iTunes. I used the Posix version since that compiled cleanly and I had no joy with the MacOSX version. Next start the ProxyResponder
mDNSProxyResponderPosix 127.0.0.1 MusicServer "Home MusicLib" _daap._tcp 3689 &
and then setup a ssh connection to the server with port 3689 forwarded to the server.
ssh -L 3689:127.0.0.1:3689 MusicServer 
and if daapd is running on the MusicServer you should see your remote library in iTunes.

Note that running mDNSProxyResponder on the local machine seems to break other local Rendezvous browsing. I haven't figured out what exactly happens.

[ Reply to This | # ]

Use a Linux box as an iTunes music server
Authored by: rocketdyke on Mon, Nov 29 2004 at 3:31PM PST
I would highly recommend using slimserver for remote broadcast. All you have to do is open up port 9000 on your home firewall.

http://www.slimdevices.com

It is different from iTunes sharing, however, as it is a streaming server. You have full control of what it plays through a web interface. They have a redHat RPM, but things had to be tweaked a bit to get it to run on SuSE 9.1

[ Reply to This | # ]
another package: mt-daapd
Authored by: purecanesugar on Sat, Feb 7 2004 at 4:59PM PST

I just found mt-daapd, a multi-threaded daapd for GNU/Linux. I am running Debian and I just installed the mt-daapd .deb package and its dependecies, pointed it to my mp3 collection, and voila! I can play all of my mp3s in iTunes. Its very well done.

Plus its got an admin/status web page. There are also RedHat and Fedora .rpms

http://mt-daapd.sourceforge.net/



[ Reply to This | # ]
Error with ID3 Tags
Authored by: onezero on Sat, Feb 14 2004 at 4:13PM PST
I install the daapd and it work fine by default with some files.

But i got a big problem with most of my files. The error-massege is:

/usr/local/bin/daapd: relocation error: /usr/local/bin/daapd: undefined symbol: id3_frame_field

The daapd stoped and can't start with this problem

Does some one know this problem and can helb me out?

[ Reply to This | # ]
Error with ID3 Tags
Authored by: macsebi on Mon, May 10 2004 at 6:34AM PDT
got the same problem here.... don#t really know what to do.. anyone any idea?
That doesn't happen with an empty directory or just certain music-files in my music-dir. But I don't know which file is responsible, yet....

---
Bye,
MacSebi

[ Reply to This | # ]
mDNSProxyResponderPosix not seen by new iTunes
Authored by: deanholmes on Wed, Mar 3 2004 at 7:33AM PST
I got this to work on Suse linux 9.0 with one issue

Unless iTunes is running when the mDNSProxyResponderPosix command is ran. Then they do not see it. Its like it only anounces itself once when started.
If I quite out of iTunes and then start iTunes again i do not see the daapd server. I have to kill mDNSProxyResponderPosix and then run the start command again.

Any Ideas

[ Reply to This | # ]
AAC Support (not ITMS music)
Authored by: legacyb4 on Sun, Mar 7 2004 at 5:56PM PST
So was the consensus that this *does* support streamed AAC files that are generated by iTunes (not the Store)?

Thanks.

[ Reply to This | # ]
AAC Support (not ITMS music)
Authored by: Shawn Parr on Wed, Mar 31 2004 at 10:00PM PST
Yes, I have used this with RedHat with AAC files, although meta tags are not supported, so you only see the file name, no id3 info.

[ Reply to This | # ]
AAC Support (not ITMS music)
Authored by: mattm on Wed, Sep 28 2005 at 4:14PM PDT
install mpeg4ip to get this support

[ Reply to This | # ]
making howl / mDNSResponder work on FreeBSD
Authored by: stripedgreen on Mon, Apr 12 2004 at 1:33PM PDT

this rc-script does the trick on FreeBSD:

 

#!/bin/sh

# mDNSResponder
MDNS_RESPONDER_EXEC='/usr/local/bin/mDNSResponder'
MDNS_RESPONDER_CMDLINE='-i fxp0'
MDNS_RESPONDER_LOGFILE='/var/log/mDNSResponder.log'
MDNS_RESPONDER_PIDFILE='/var/run/mDNSResponder.pid'

# mDNSPublish
MDNS_PUBLISH_EXEC='/usr/local/bin/mDNSPublish'
MDNS_PUBLISH_CMDLINE='myMusic _daap_.tcp 3689'
MDNS_PUBLISH_PIDFILE='/var/run/mDNSResponder.pid'


case "$1" in
        start)
                if [ -x "${MDNS_RESPONDER_EXEC}" ]; then
                        ${MDNS_RESPONDER_EXEC} ${MDNS_RESPONDER_CMDLINE} >> ${MDNS_RESPONDER_LOGFILE} 2>&1 && echo -n ' mDNS
Responder'

                        if [ -x "${MDNS_PUBLISH_EXEC}" ]; then
                                ${MDNS_PUBLISH_EXEC} ${MDNS_PUBLISH_CMDLINE} >> ${MDNS_RESPONDER_LOGFILE} 2>&1 &
                                echo -n ' mDNSPublish'
                        fi
                fi
                ;;
        stop)
                killall mDNSResponder 2>/dev/null
                if [ $? -ne 0 ] ; then
                        echo 'mDNSResponder not started'
                fi
                killall mDNSPublish 2>/dev/null
                if [ $? -ne 0 ] ; then
                        echo 'mDNSPublish not started'
                fi
                ;;
        restart)
                $0 stop
                sleep 2
                $0 start
                ;;
        *)
                echo ""
                echo "Usage: `basename $0` { start | stop | restart }"
                echo ""
                exit 64
                ;;
esac


[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: pataslak on Thu, Apr 15 2004 at 7:45AM PDT
I don't get it working. :( on my Mandrake 9.2 server

It compiles just fine (at least no errors).
My computer is named bilbo and has the IP 192.168.1.1
I run Rendezvous with

./mDNSProxyResponderPosix 192.168.1.1 squeal "Music" _daap._tcp. 3689

and get

Made Service Records for Music._daap._tcp.local.
Service lacci._daap._tcp.local. now registered and active

On the daapd site I chose to use the default values (with a config file it didn't work either). This gives me

daapd
scanning . for mp3s... done.

But any of my windows machine with iTunes cannot see the share.
I ran both commands as root.
daapd is running, I cannot start it twice.
How can I look if the Rendezvous part is working?

My itunes is 4.2.0.72
all my machine is on the same lan

What's wrong?
any help ?
thanks

[ Reply to This | # ]
Use a Linux box as an iTunes music server
Authored by: macsebi on Thu, May 13 2004 at 8:06PM PDT
okay, I really don't know what exactly the problem was, but for me it worked to:

* select all titles in the iTunes-Library
* right-click: convert ID3-Tags to "NONE"
* right-click: convert ID3-Tags back to "2.4"
* update the "streaming directory" with those modified files

Tipp: running daapd in verbose mode (-v) gives you a hint of the broken files. But you might just as well update all files. can't hurt. ;)

Good Luck.

---
Bye,
MacSebi

[ Reply to This | # ]