Install mt-daapd

From WikiDLXTV
Jump to: navigation, search

mt-daapd is a multi-threaded DAAP server for Linux and other POSIX type systems. It allows a Linux box (like the WDTV gen1) to share audio files with iTunes users in the same network.

Before you start

Make sure that :

  • you have a WDTV gen1 that has WDLXTV installed
  • your WDTV gen1 is connected to your network (and has been assigned an IP address)
  • you (kinda) know what telnet/ssh is and how to use it

Downloading optware

In order to get the Mt-daapd server running on your wdtv, you first need to have optware installed. So :

  • first download from b-rad
  • extract the opt.bin from the zip file and place it in the root of your boot device (make sure the drive name of your boot device does not contain a space ! So if it's called 'USB stick' rename to USBstick.
  • cold boot the wdtv (so completely disconnect from power and reconnect) with boot device (that contains opt.bin) connected

For more details about optware, see b-rads tutorial here

Installing mt-daapd

  • connect to your wdtv via telnet/ssh.

You need the wdtv's IP address for this of course, so (1) check your router or (2) check the wdtv menu : settings, system, about

For more information about telnet/remote access, see : Telnet and ssh remote connections

Once you know the IP adress of your wdtv, connect to it with Telnet, Putty or another program. You'll get a screen like this :

wdtv login:

enter 'root' (without the quotes) and if asked for a password, just leave that empty and press enter.

Now you're connected to your wdtv and you should see something like this :

BusyBox v1.10.0 (2009-02-15 05:09:42 CST) built-in shell (msh)
Enter 'help' for a list of built-in commands.

  • First we'll do an update by giving this command :
# ipkg update
  • Now install mt-daapd with :
# ipkg install mt-daapd

The system will give some info back. Wait till you get the command prompt again. Don't pay too much attention to any error message that you might get. We'll get to that later.

  • Just to test things, create a folder somewhere and copy 1 of your mp3's to it ( 1 mp3 will make scanning the folder go really fast). I used this folder just to test if everything works OK. When you have things working the way you want it, you can remove the folder and point mt-daapd to the right location where you keep all your music.
  • You now have to edit the configuration file of mt-daapd. It's located overhere :

I used an FTP program to copy it to my desktop, edited it, saved it and then copied it back to it's original location. If you know how vi or nano works, that's much faster probably.

My edited mt-daapd.conf now looks like this (just for reference):

web_root	/opt/share/mt-daapd/admin-root
port		3689
admin_pw	mt-daapd
db_dir		/opt/var/mt-daapd
mp3_dir		/tmp/media/usb/USB1/4687-4AC5/mp3
servername	NSLU2 Music
runas	guest
playlist	/opt/etc/mt-daapd/mt-daapd.playlist
extensions .mp3,.m4a,.m4p
logfile /var/log/mt-daapd.log
rescan_interval 7200
always_scan 0

As you can see, it's much shorter than the original file. I removed all the commented lines (the ones that start with #) to keep the file nice and short.

This is an important line in the file :

mp3_dir		/tmp/media/usb/USB1/4687-4AC5/mp3

It points to the place where you keep your music. As you can see above, I created a testfolder called 'mp3' in the root of my usb stick. Change it so it points to your location. Always make sure you save your changes !

  • give the server permission to read your music files by :
# chmod o+r -R /path/to/your/mp3_dir
  • now restart the server with :
# /opt/etc/init.d/S60mt-daapd restart

Now it's time to open your iTunes. In the Source panel (left hand side) you should find a new blue entry titled 'NSLU2 Music' (the servername as specified in your config file). Click it and see if your music is available.

Start server

Every time your wdtv has been disconnected from power and you want the mt-daapd server to start, you have two options to start it :

  • Manually
# /opt/etc/init.d/S60mt-daapd
  • Automatically

Add the following line to the S00custom-options file :

echo '/opt/etc/init.d/S60mt-daapd start' >> /tmp/init.d/S99post-init

and save the S00custom-options file of course!

Connect to mt-daapd server

Connect to the admin web pages on port 3689 (example: When prompted enter any user name and the password mt-daapd.

If you want to use the Web Interface to modify the configuration you need to set permission. To do so (in a telnet session):

# chmod 447 /opt/etc/mt-daapd/mt-daapd.conf

After that restart the server with:

# /opt/etc/init.d/S60mt-daapd restart


  • In case you don't see the server pop up in iTunes, several things might be wrong. A good thing to start with is checking out the logfile, by :
# cat /var/log/mt-daapd.log

If it shows something like it did with me:

2011-04-03 10:28:27: Starting rendezvous daemon
2011-04-03 10:28:27: Error in drop_privs: Success
2011-04-03 10:28:27: Aborting

then my solution was simple. I just had to give the following command :

# adduser guest

and it popped up immediately in iTunes.

  • More troubleshooting tips can be found here in the troubleshooting section.