Firefly Openlink

From NAS-Central Buffalo - The Linkstation Wiki

(Difference between revisions)
Jump to: navigation, search
(sqlite)
 
(33 intermediate revisions not shown)
Line 1: Line 1:
-
!!! TAKEN FROM risimmons POST ON ROKU FORUMS !!!
+
[[Image:Ff_logo_sm.gif ]]
 +
{{Articles|Mediaserver}}
 +
== Requirements ==
 +
# Lots of good music
 +
# Something to play lots of your good music on - Like a Roku Soundbridge
 +
# Or iTunes on your pc
 +
#* [[DevelopmentToolsInstallation | Development Tools]]
 +
#* [http://www.underbit.com/products/mad/ libid3tag]
 +
#* [[w:SQLlite|SQLlite]]
-
Going to 'wiki it up' later
 
 +
== Installation - Build From Source==
 +
===Dependancies===
 +
====Development Tools====
 +
# Install the [[Precompiled C development environment, running on the LS]]
 +
# Get the source tarballs and compile
-
Install Dev Tools;
+
==== libid3tag ====
-
http://linkstationwiki.net/index.php?title=DevelopmentToolsInstallation
+
-
cd /tmp (changed from tmp)
+
cd ..
-
wget http://downloads.linkstationwiki.net/development_tools/<flavour>-tools-2_1.tgz
+
<nowiki>wget http://umn.dl.sourceforge.net/sourceforge/mad/libid3tag-0.15.1b.tar.gz</nowiki>
-
mkdir devtools
+
tar -xvzf libid3tag-0.15.1b.tar.gz
-
cd devtools
+
cd libid3tag-0.15.1b
-
tar xzvf ../<flavour>-tools-2_1.tgz
+
./configure --prefix=/usr/local
-
./install.sh
+
make install
-
Install libid3tag
+
==== sqlite ====
-
http://linkstationwiki.net/index.php?title=Articles/Macintosh
+
-
cd .. (get back to /tmp directory)
+
cd ..  
-
wget http://umn.dl.sourceforge.net/sourceforge/mad/libid3tag-0.15.1b.tar.gz
+
<nowiki>wget http://www.sqlite.org/sqlite-3.6.1.tar.gz</nowiki>
-
tar -xvzf libid3tag-0.15.1b.tar.gz
+
tar -xvzf sqlite-3.6.1.tar.gz
-
cd libid3tag-0.15.1b
+
cd sqlite-3.6.1
-
./configure --prefix=/usr/local
+
./configure --prefix=/usr/local
-
make install
+
make install
-
Install sqlite
+
==== OPTIONAL ====
-
cd .. (get back to /tmp directory)
+
===== Ogg Lib =====
-
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
+
 +
cd /tmp
 +
<nowiki>wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz</nowiki>
 +
tar -xvzf libogg-1.1.3.tar.gz
 +
cd libogg-1.1.3
 +
./configure --prefix=/usr/local
 +
make install
-
[OPTIONAL - FLAC / OGG VORBIS TRANSCODE]
+
===== Vorbis Lib =====
-
Install Ogg lib
+
-
cd .. (get back to /tmp directory)
+
cd ..  
-
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
+
<nowiki>wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz</nowiki>
-
tar -xvzf libogg-1.1.3.tar.gz
+
tar -xvzf libvorbis-1.1.2.tar.gz
-
cd libogg-1.1.3
+
cd libvorbis-1.1.2
-
./configure --prefix=/usr/local
+
./configure --prefix=/usr/local
-
make install
+
make install
-
 
+
-
Install Vorbis Lib
+
-
 
+
-
cd .. (get back to /tmp directory)
+
-
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;
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;
-
vi /etc/ld.so.conf
+
{{Postit | [[nano]]| 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;
edit the file to add the line;
-
/usr/local/lib
+
 +
/usr/local/lib
save and exit. Then type
save and exit. Then type
-
ldconfig -v
+
ldconfig -v
verify that the ogg and vorbis libs are listed.
verify that the ogg and vorbis libs are listed.
-
Install flac
+
===== Flac =====
-
cd .. (get back to /tmp directory)
+
cd ..  
-
wget http://kent.dl.sourceforge.net/sourceforge/flac/flac-1.1.2.tar.gz
+
<nowiki>wget http://kent.dl.sourceforge.net/sourceforge/flac/flac-1.1.2.tar.gz</nowiki>
-
tar -xvzf flac-1.1.2.tar.gz
+
tar -xvzf flac-1.1.2.tar.gz
-
cd flac-1.1.2
+
cd flac-1.1.2
-
./configure --prefix=/usr/local
+
./configure --prefix=/usr/local
-
make install
+
make install
The flac libs also need to be registered, so;
The flac libs also need to be registered, so;
-
ldconfig -v
+
ldconfig -v
-
[END (OPTIONAL - FLAC / OGG VORBIS TRANSCODE)]
+
===== Howl =====
-
[OPTIONAL - HOWL INSTALL - REQUIRED FOR MULTIPLE INSTANCES]
+
REQUIRED FOR MULTIPLE INSTANCES
-
cd .. (get back to /tmp directory)
+
cd .. (get back to /tmp directory)
-
wget http://www.porchdogsoft.com/download/howl-1.0.0.tar.gz
+
<nowiki>wget http://www.porchdogsoft.com/download/howl-1.0.0.tar.gz</nowiki>
-
tar -xvzf howl-1.0.0.tar.gz
+
tar -xvzf howl-1.0.0.tar.gz
-
cd howl-1.0.0
+
cd howl-1.0.0
-
./configure --prefix=/usr/local
+
./configure --prefix=/usr/local
-
make install
+
make install
The howl libs need to be registered, so (assuming you've added the line to /etc/ld.so.conf as above);
The howl libs need to be registered, so (assuming you've added the line to /etc/ld.so.conf as above);
-
ldconfig -v
+
ldconfig -v
 +
=== Get and Compile [[Firefly]] ===
-
[END (OPTIONAL - HOWL INSTALL - REQUIRED FOR MULTIPLE INSTANCES)]
+
You will need to check out [[http://nightlies.mt-daapd.org/ the nightlies]] and change the address below to the latest version
 +
 +
cd /tmp
 +
<nowiki>wget http://nightlies.mt-daapd.org/dl.php?FILE=mt-daapd-svn-1463.tar.gz</nowiki>
 +
Untar and enter folder (replace with whatever latest version is)
 +
tar -zxvf mt-daapd-svn-1463.tar.gz
 +
cd mt-daapd-svn-1463
 +
-
Install firefly (for 1359 nightly - obviously check for the latest and alter accordingly...)
+
Either - (assuming flac, ogg and howl built)
-
cd .. (get back to /tmp directory)
+
./configure --prefix=/usr/local --enable-browse --enable-query --enable-mdns --enable-howl
-
wget http://nightlies.mt-daapd.org/dl.php?FILE=mt-daapd-svn-1359.tar.gz
+
--with-howl-includes=/usr/local/include/howl --with-id3tag=/usr/local --sysconfdir=/etc --enable-sqlite3 --enable-flac   
-
mv dl.php?FILE=mt-daapd-svn-1359.tar.gz mt-daapd-svn-1359.tar.gz
+
--enable-oggvorbis
-
tar -xvzf mt-daapd-svn-1359.tar.gz
+
-
cd mt-daapd-svn-1359
+
-
[EITHER (assuming flac, ogg and howl built)]
+
Or
-
./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 --enable-oggvorbis
+
-
[OR]
+
-
./configure --prefix=/usr/local --enable-browse --enable-query --enable-mdns --with-id3tag=/usr/local --sysconfdir=/etc --enable-sqlite
+
-
make install
+
./configure --prefix=/usr/local --enable-browse --enable-query --enable-mdns --with-id3tag=/usr/local --sysconfdir=/etc  
-
mkdir /usr/local/etc/mt-daapd
+
--enable-sqlite3
-
cp contrib/mt-daapd.* /usr/local/etc/mt-daapd/
+
-
cd /usr/local/etc/mt-daapd/
+
 +
make install
 +
mkdir /etc/mt-daapd
 +
cp contrib/mt-daapd.* /etc/mt-daapd/
 +
cd /etc/mt-daapd/
-
vi mt-daapd.conf (use vi editor to modify config file as/if required. Some help on vi; http://www.cs.colostate.edu/helpdocs/vi.html)
 
-
You probably need at least to change the location of the music files to /mnt/hda
 
-
chmod o=rw mt-daapd.conf (allow any user to write to mt-daapd.conf to allow web interface to modify it)
+
nano mt-daapd.conf  
-
Check it's works
+
You probably need to change the location of the music files for example to /mnt/media; the web_root location to /usr/local/share/mt-daapd/admin-root; the plugin directory to /usr/local/share/mt-daapd/plugins; the firefly database directory to for example /mnt/media; and the playlist directory to for example /etc/mt-daapd/mt-daapd.playlist. Check that all the directories you use actually exist on your installation. If you cannot access the Firefly web interface, check that the music file and web_root location exist, and remember Linux is case sensitive i.e. /mnt/media and /mnt/Media are different directories.
-
/usr/local/sbin/mt-daapd
+
(allow any user to write to mt-daapd.conf to allow web interface to modify it)
 +
chmod o=rw mt-daapd.conf
-
Wait a while then access;
+
== Startup Script ==
 +
Create a startup script;
 +
 +
nano /etc/init.d/firefly
-
http://<linkstation-ip>:3689
+
Add all this:
-
Username is nobody
+
#! /bin/sh
-
Password is mt-daapd
+
set -e
 +
 +
# /etc/init.d/firefly: start and stop the DAAP daemon
 +
 +
DAEMON=/usr/local/sbin/mt-daapd
 +
DAAPD_OPTS=""
 +
DAAPD_CONFIG_FILE=/etc/mt-daapd/mt-daapd.conf
 +
 +
test -x $DAEMON || exit 0
 +
 +
case "$1" in
 +
  start)
 +
    if ! grep -q /usr/local/lib /etc/ld.so.conf; then
 +
      echo /usr/local/lib >> /etc/ld.so.conf
 +
      ldconfig
 +
    fi
 +
 +
    echo -n "Starting DAAP daemon: firefly"
 +
    if pidof $DAEMON >/dev/null 2>&1; then
 +
      echo " apparently already running."
 +
    exit 0
 +
    fi
 +
    if [ ! -s "$DAAPD_CONFIG_FILE" ]; then
 +
      echo " missing or empty config file $DAAPD_CONFIG_FILE"
 +
      exit 1
 +
    fi
 +
    start-stop-daemon --start --quiet --background \
 +
      --exec $DAEMON -- -c "$DAAPD_CONFIG_FILE" $DAAPD_OPTS
 +
    echo "."
 +
    ;;
 +
  stop)
 +
    echo -n "Stopping DAAP daemon: firefly"
 +
    killall $DAEMON >/dev/null 2>&1
 +
    echo "."
 +
    ;;
 +
 +
  restart)
 +
    set +e
 +
    echo -n "Restarting DAAP daemon: firefly"
 +
    killall $DAEMON >/dev/null 2>&1
 +
    sleep 2
 +
    if ! start-stop-daemon --start --quiet --background \
 +
      --exec $DAEMON -- -c "$DAAPD_CONFIG_FILE" $DAAPD_OPTS
 +
    then
 +
      echo "start failed?"
 +
    fi
 +
    echo "."
 +
    ;;
 +
 +
  *)
 +
    echo "Usage: /etc/init.d/firefly {start|stop|restart}"
 +
    exit 1
 +
esac
 +
 +
exit 0
-
Unless you've modified it in mtdaapd.conf
 
-
Create a startup script;
+
Mark the file as executable;
-
(from http://wiki.mt-daapd.org/wiki/Quickstart_LinkStation)
+
chmod a+x /etc/init.d/firefly
-
cd /etc/init.d
+
Create a symbolic link to this file in the startup dir;
 +
 +
cd /etc/rc.d/rc2.d && ln -s /etc/init.d/firefly S20firefly
-
vi mt-daapd-startup
+
cd /etc/rc.d/rc6.d && ln -s /etc/init.d/firefly K20firefly
-
Enter the following lines (between the ****s)
+
cd /etc/rc.d/rc0.d && ln -s /etc/init.d/firefly K20firefly
-
************************************************************
+
== Run it ==
-
# !/bin/sh
+
Should be able to start it up now
-
# make sure our shared libraries are in the path.
+
/usr/local/sbin/mt-daapd
-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
+
or better still use the start/stop script
 +
/etc/init.d/firefly start
-
if [ -n "`pidof mt-daapd`" ] ; then
+
This errors because it looks for mt-daapd.conf in /usr/local/etc/mt-daapd.conf ??
-
killall mt-daapd 2>/dev/null
+
I've just linked to it
-
fi
+
mkdir /usr/local/etc
 +
ln -s /etc/mt-daapd/mt-daapd.conf  /usr/local/etc/mt-daapd.conf
-
/usr/local/sbin/mt-daapd -c /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 -
-
Mark the file as executable;
+
top
-
chmod +x mt-daapd-startup
+
-
Create a symbolic link to this file in the startup dir;
+
Once that dissapears (it has finished checking your music library) you should be able to see it via the web interface
-
ln -s mt-daapd-startup /etc/rc.d/rc2.d/S93mtdaapd
+
 
 +
<nowiki>http://<LINKSTATION-IP>:3689</nowiki>
 +
 
 +
You can put whatever you like as user but the passwd is mt-daapd
 +
 
 +
That should show you something like this
 +
 
 +
[[Image:Firefly.JPG]]
 +
 
 +
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 ==
-
[To add multiple instances];
+
Create new subdirectories under /usr/local/var/cache/mt-daapd which correspond to the databases required.
-
create new subdirectories under /usr/local/var/cache/mt-daapd which correspond to the databases required.
+
eg.
eg.
-
mkdir /usr/local/var/cache/mt-daapd/albums/
+
mkdir /usr/local/var/cache/mt-daapd/albums/
Set appropriate permissions
Set appropriate permissions
-
chown nobody:nogroup /usr/local/var/cache/mt-daapd/albums
+
chown nobody:nogroup /usr/local/var/cache/mt-daapd/albums
-
chmod u+w /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)
Create a new startup mt-daapd.conf with the appropriate path to the database dir (eg mt-daapd.albums.conf)
Line 182: Line 258:
Modify the starup script to start mt-daapd using this conf file;
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
+
/usr/local/sbin/mt-daapd -c /usr/local/etc/mt-daapd.albums.conf
The startup script must also start Howl (mDNSResponder)
The startup script must also start Howl (mDNSResponder)
-
/usr/local/bin/mDNSResponder
+
/usr/local/bin/mDNSResponder
(this should be started before the mt-daapd instances)
(this should be started before the mt-daapd instances)
 +
 +
==Troubleshooting==
 +
 +
[[User:Bauldrick|Bauldrick]] 13:05, 21 December 2006 (EST)

Latest revision as of 08:45, 24 August 2008

Image:Ff_logo_sm.gif

Contents

Requirements

  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

Dependancies

Development Tools

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

libid3tag

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

sqlite

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

OPTIONAL

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;

nano
Image:Bar.png
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;

/usr/local/lib

save and exit. Then type

ldconfig -v

verify that the ogg and vorbis libs are listed.

Flac
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
Howl

REQUIRED FOR MULTIPLE INSTANCES

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-sqlite3 --enable-flac    
--enable-oggvorbis

Or

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


nano mt-daapd.conf 

You probably need to change the location of the music files for example to /mnt/media; the web_root location to /usr/local/share/mt-daapd/admin-root; the plugin directory to /usr/local/share/mt-daapd/plugins; the firefly database directory to for example /mnt/media; and the playlist directory to for example /etc/mt-daapd/mt-daapd.playlist. Check that all the directories you use actually exist on your installation. If you cannot access the Firefly web interface, check that the music file and web_root location exist, and remember Linux is case sensitive i.e. /mnt/media and /mnt/Media are different directories.

(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

DAEMON=/usr/local/sbin/mt-daapd
DAAPD_OPTS=""
DAAPD_CONFIG_FILE=/etc/mt-daapd/mt-daapd.conf

test -x $DAEMON || exit 0 

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

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

 restart)
   set +e
   echo -n "Restarting DAAP daemon: firefly"
   killall $DAEMON >/dev/null 2>&1
   sleep 2
   if ! start-stop-daemon --start --quiet --background \
     --exec $DAEMON -- -c "$DAAPD_CONFIG_FILE" $DAAPD_OPTS
   then
     echo "start failed?"
   fi
   echo "."
   ;;

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

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/rc.d/rc2.d && ln -s /etc/init.d/firefly S20firefly
cd /etc/rc.d/rc6.d && ln -s /etc/init.d/firefly K20firefly
cd /etc/rc.d/rc0.d && ln -s /etc/init.d/firefly K20firefly

Run it

Should be able to start it up now

/usr/local/sbin/mt-daapd

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 -

top

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

http://<LINKSTATION-IP>:3689

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

That should show you something like this

Image:Firefly.JPG

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)

/usr/local/bin/mDNSResponder

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

Troubleshooting

Bauldrick 13:05, 21 December 2006 (EST)

Personal tools