Difference between revisions of "Firefly Openlink"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(Startup Script)
Line 263: Line 263:
(this should be started before the mt-daapd instances)
(this should be started before the mt-daapd instances)
[[User:Bauldrick|Bauldrick]] 13:05, 21 December 2006 (EST)
[[User:Bauldrick|Bauldrick]] 13:05, 21 December 2006 (EST)

Revision as of 16:11, 5 February 2007

Ff logo sm.gif


  1. Lots of good music
  2. Something to play lots of your good music on - Like a Roku Soundbridge
  3. Or iTunes on your pc

Installation - Build From Source


Development Tools

  1. Install the Precompiled C development environment, running on the LS
  2. Get the source tarballs and compile


cd .. 
wget http://umn.dl.sourceforge.net/sourceforge/mad/libid3tag-0.15.1b.tar.gz
tar -xvzf libid3tag-0.15.1b.tar.gz
cd libid3tag-0.15.1b
./configure --prefix=/usr/local
make install


cd .. 
wget http://www.sqlite.org/sqlite-2.8.17.tar.gz
tar -xvzf sqlite-2.8.17.tar.gz
cd sqlite-2.8.17
./configure --prefix=/usr/local
make install


Ogg Lib
cd /tmp
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar -xvzf libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure --prefix=/usr/local
make install
Vorbis Lib
cd .. 
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar -xvzf libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure --prefix=/usr/local
make install

These libraries need to be registered with the linker. This can be done by creating a file called ld.so.conf in /etc as follows;

if you don't already have nano you can follow the instructions on the nano page to either get the static binaries for your LS or compile it yourself

nano /etc/ld.so.conf

edit the file to add the line;


save and exit. Then type

ldconfig -v

verify that the ogg and vorbis libs are listed.

cd .. 
wget http://kent.dl.sourceforge.net/sourceforge/flac/flac-1.1.2.tar.gz
tar -xvzf flac-1.1.2.tar.gz
cd flac-1.1.2
./configure --prefix=/usr/local
make install

The flac libs also need to be registered, so;

ldconfig -v


cd .. (get back to /tmp directory)
wget http://www.porchdogsoft.com/download/howl-1.0.0.tar.gz
tar -xvzf howl-1.0.0.tar.gz
cd howl-1.0.0
./configure --prefix=/usr/local
make install

The howl libs need to be registered, so (assuming you've added the line to /etc/ld.so.conf as above);

ldconfig -v

Get and Compile Firefly

You will need to check out [the nightlies] and change the address below to the latest version

cd /tmp
wget http://nightlies.mt-daapd.org/dl.php?FILE=mt-daapd-svn-1463.tar.gz

Untar and enter folder (replace with whatever latest version is)

tar -zxvf mt-daapd-svn-1463.tar.gz
cd mt-daapd-svn-1463 

Either - (assuming flac, ogg and howl built)

./configure --prefix=/usr/local --enable-browse --enable-query --enable-mdns --enable-howl 
--with-howl-includes=/usr/local/include/howl --with-id3tag=/usr/local --sysconfdir=/etc --enable-sqlite --enable-flac    


./configure --prefix=/usr/local --enable-browse --enable-query --enable-mdns --with-id3tag=/usr/local --sysconfdir=/etc 
make install
mkdir /etc/mt-daapd
cp contrib/mt-daapd.* /etc/mt-daapd/
cd /etc/mt-daapd/

nano mt-daapd.conf 

You probably need at least to change the location of the music files to /mnt/hda

(allow any user to write to mt-daapd.conf to allow web interface to modify it)

chmod o=rw mt-daapd.conf 

Startup Script

Create a startup script;

nano /etc/init.d/firefly

Add all this:

#! /bin/sh
set -e

# /etc/init.d/firefly: start and stop the DAAP daemon


test -x $DAEMON || exit 0 

case "$1" in
   if ! grep -q /usr/local/lib /etc/ld.so.conf; then
     echo /usr/local/lib >> /etc/ld.so.conf

   echo -n "Starting DAAP daemon: firefly"
   if pidof $DAEMON >/dev/null 2>&1; then
     echo " apparently already running."
   exit 0
   if [ ! -s "$DAAPD_CONFIG_FILE" ]; then
     echo " missing or empty config file $DAAPD_CONFIG_FILE"
     exit 1
   start-stop-daemon --start --quiet --background \
   echo "."
   echo -n "Stopping DAAP daemon: firefly"
   killall $DAEMON >/dev/null 2>&1
   echo "."

   set +e
   echo -n "Restarting DAAP daemon: firefly"
   killall $DAEMON >/dev/null 2>&1
   sleep 2
   if ! start-stop-daemon --start --quiet --background \
     echo "start failed?"
   echo "."

   echo "Usage: /etc/init.d/firefly {start|stop|restart}"
   exit 1

exit 0

Mark the file as executable;

chmod a+x /etc/init.d/firefly

Create a symbolic link to this file in the startup dir;

cd /etc/rc2.d && ln -s /etc/init.d/firefly S20firefly
cd /etc/rc6.d && ln -s /etc/init.d/firefly K20firefly
cd /etc/rc0.d && ln -s /etc/init.d/firefly K20firefly

Run it

Should be able to start it up now


or better still use the start/stop script

/etc/init.d/firefly start

This errors because it looks for mt-daapd.conf in /usr/local/etc/mt-daapd.conf ??

I've just linked to it

mkdir /usr/local/etc
ln -s /etc/mt-daapd/mt-daapd.conf  /usr/local/etc/mt-daapd.conf

Try it now

/etc/init.d/firefly start

Issue top and you should see mt-daapd at the top of the list -


Once that dissapears (it has finished checking your music library) you should be able to see it via the web interface


You can put whatever you like as user but the passwd is mt-daapd

That should show you something like this


Run over to your Roku Soundbridge and check if its working - then fire up iTunes on your pc and see all your files

To add multiple instances

Create new subdirectories under /usr/local/var/cache/mt-daapd which correspond to the databases required. eg.

mkdir /usr/local/var/cache/mt-daapd/albums/

Set appropriate permissions

chown nobody:nogroup /usr/local/var/cache/mt-daapd/albums
chmod u+w /usr/local/var/cache/mt-daapd/albums

Create a new startup mt-daapd.conf with the appropriate path to the database dir (eg mt-daapd.albums.conf)

Modify the starup script to start mt-daapd using this conf file;

/usr/local/sbin/mt-daapd -c /usr/local/etc/mt-daapd.albums.conf

The startup script must also start Howl (mDNSResponder)


(this should be started before the mt-daapd instances)


Bauldrick 13:05, 21 December 2006 (EST)