NSLU2-Linux
view · edit · print · history

This doc is outdated, use SlimServer instead.

Not totally outdated as the ipkg for Slimserver has not been updated since 6.5.1 and the makefile has not been added to Optware.

Installing Slimserver on the NSLU2

Of course, you've already installed Unslung. (I'm running 4.20, but more recent versions should work fine)

Enable telnet

 http://IP-address-of-your-slug/Management/telnet.cgi

First I installed dropbear (UseDropBearForRemoteAccess) so I could use ssh to access my slug.

 # ipkg update
 # ipkg install dropbear
 # reboot

You'll need Perl to run SlimServer (BuildPerlOnYourNSLU2Box) - don't worry, perl is now pre-built, so this is easy:

 # ipkg update
 # ipkg install unslung-feeds
 # ipkg update
 # ipkg install perl

Go download SlimServer Perl source code (I used v6.0.2)

 http://www.slimdevices.com/su_downloads.html

Installing Slimserver is as easy as using tar xzvf Slimserver_v6.0.2.tar.gz

I decided mine should live in /usr/local with data in /etc/slim-data

 # cd /usr/local
 # tar xzvf /root/Slimserver_v6.0.2.tar.gz
 # cd /etc
 # mkdir slim-data

Slim server needed the following Perl modules: DBD::SQLite XML::Parser HTML::Parser Compress::Zlib. However, the slimserver code provides a way to get those missing packages, but you need a C compiiler and a few other things. So the next step was to install the native tools, (NativelyCompileUnslungPackages).

This is simply:

 # ipkg install unslung-devel

You'll also need the which command, as well as expat (if which complains about missing "libz.so", run "ipkg install zlib" ):

 # ipkg install which
 # ipkg install expat

Now edit the file /usr/local/SlimServer_v6.0.2/Bin/build-perl-modules.pl to add some options to the XML Parser, this is because expat is installed in a non-standard location on the slug. (you need to add the XML Parser section)

my %packageOptions = (

    'Template-Toolkit-2.13' => {

        'Makefile.PL' => join(' ', qw(
            TT_DOCS=n
            TT_SPLASH=n
            TT_THEME=n
            TT_EXAMPLES=n
            TT_EXAMPLES=n
            TT_EXTRAS=n
            TT_QUIET=y
            TT_ACCEPT=y
            TT_DBI=n
            TT_LATEX=n
        )),
    },

    'DBD-SQLite-1.08' => {

        'env' => [qw(DBI-1.46/blib/lib: DBI-1.46/blib/arch)],
    },

    'XML-Parser-2.34' => {
        'Makefile.PL' => join(' ', qw(
            EXPATLIBPATH=/opt/lib
            EXPATINCPATH=/opt/include
        )),
    },

);

Now run the SlimServer script to get the missing modules

 # /usr/local/SlimServer_v6.0.2/Bin/build-perl-modules.pl

Now, give it a try..

 # cd /usr/local/SlimServer_v6.0.2
 # ./slimserver.pl --daemon --prefsfile /etc/slim-data/slimserver.pref --cachedir /etc/slim-data

A few of these steps will take a while to complete, be patient. Starting the server can be pretty slow, but it will start.

To check out the server: http://IP-address-of-your-slug:9000

I don't yet have a squeezebox, but softsqueeze seems to work with this. I do have some pauses, but I strongly suspect that this is related to the softsqueeze player and not the server. Windows media player seems to work well with slimserver, just follow the directions for remote streaming.


Ole adds: Works like a charm (note that browsing, searching etc. has been reported to be slow. If you are like me, and buy the NSLU to be a dedicated SlimServer, then you might want to take that into consideration). At the moment I do not have any unmanagable speed issues.


Fritz adds: This worked well for me with one exception. build-perl-modules.pl errored out because it could not find make. Once I added /opt/bin to my path everything worked well. Enter into the shell the following:

 # PATH=$PATH:/opt/bin
 # export PATH
 # /usr/local/SlimServer_v6.1.1/Bin/build-perl-modules.pl

Luke confirms: I had to do this step too for v6.2.2, to deal with the following error:

 # which: No such file or directory

Jan adds: For unslung 6.8 you should also add /opt/armeb/bin to your path:

 # PATH=$PATH:/opt/armeb/bin

Otherwhise the build-perl-modules.pl fails when calling gcc... Error message is Building.. armv5b-softfloat-linux-gcc: No such file or directory make: *** [Zlib.o] Error 127 Couldn't find a valid dynamic library for Compress-Zlib-1.33.tar.gz - something is wrong. Exiting!


Works in Openslug 2.5, as the perl ipk's now seem to run correctly:

 # ipkg install perl perl-modules

However, you will need to copy typemap and xsubpp from a perl source tree to the local perl library folders (they're missing for some reason):

 # wget http://ftp.funet.fi/pub/CPAN/src/perl-5.8.7.tar.gz
 # tar -xzvf perl-5.8.7.tar.gz
 # cp perl-5.8.7/lib/ExtUtils/typemap /usr/lib/perl5/5.8.7/ExtUtils/typemap
 # cp perl-5.8.7/lib/ExtUtils/xsubpp /usr/lib/perl5/5.8.7/ExtUtils/xsubpp

Then install gcc and friends:

 # ipkg install gcc gcc-symlinks binutils make libc6-dev coreutils libexpat-dev

Finally extract slimserver and compile modules:

 # wget http://www.slimdevices.com/downloads/SlimServer_v6.1.1/SlimServer_v6.1.1.tar.gz
 # cd /usr/local
 # tar -xzvf /root/SlimServer_v6.1.1.tar.gz
 # /usr/local/SlimServer_v6.1.1/Bin/build-perl-modules.pl

Note: you *will* require a decent amount of swap to run the Slimserver and even then it will be a little slow (e.g. don't try and play your entire music collection at once)


Steinar adds: SlimServer runs fine without swap on a 64MB slug. It takes about a minute to start on a 266MHz slug, 64MB, no swap, OpenSlug 2.7. File scanning, however, still takes a very, very long time (it may take hours) if the music collection is big (10,000+ tracks). Once started, SlimServer runs fast enough, except when trying to play huge playlists (it may then need a few minutes to get started). My SlimServer has a load around 60% while serving two synchronised Squeezeboxes. Memory usage is about 37MB. The web pages load a bit slowly, but are still perfectly useable.


Paul Webster adds: SlimServer 6.2.0 seems to work as well. Following same procedure (clearly .. changing the version number in the directory names) - with the modification suggested by Fritz to get "make" into the path before building. It is busy scanning at the moment. But looking forward to see if interactive performance is improved because one of the claims for 6.2 is that it speeds up some of the database accesses.


Marc Pelzer adds: "SlimServer_v6.2.1" needs the C caching application "ccache" to build the Compress-Zlib-1.33.tar.gz. You can get it from here: http://ccache.samba.org/ It compiles fine on my slug after installing all necessary dev tools (ipkg install gcc gcc-symlinks make binutils libc6-dev coreutils libexpat-dev)


Chris Kantarjiev adds: This worked just fine on Unslung5.5b with "SlimServer_v6.2.1". Except ... I wanted to run it as user slimserver instead of root. When I do that, SQLite? complains that it can't create a temporary table, even though I think I got all the permissions right. It would be good to fix this. Running fine on a 266MHz Slug, 64MB, process size is about 38M with 6600 tunes. To make WMA files work (especially for Internet radio), you'll want to load ffmpeg and lame with ipkg - note that some of the libraries you need end up in /opt/lib.


H. Lima adds: After several unsuccessful trials to use mt-daapd server and wmamp (wmam11b itunes client) I switched to Slimserver and wrote a slimp3 client for the wma11b (available here and it has been working very well for days already. If you own a wma11b you should check it out!


Could someone please turn slimserver into a complete ipkg package or maybe just offer the missing pieces. That way most of us can avoid having to install a native toolchain and compile the stuff ourselves.

Anyway I couldn't wait and I installed the crosstool-native packages + make on unslung-3.18. This works great too! I have slimserver 6.2.1 running now as user slimserver. For that, make sure the user slimserver has approriate entries in /etc/passwd and also check that /var/tmp has permissions drwxrwxrwt.


Wibbleman adds: ......IT DOES WORK - AND ITS NOT TOO COMPLICATED!!...... .......- Slug 5.5/Slim6.2.1 (Mar 2006)...... I put off loading Slimserver for a while, cause it looked far too complex for me, but I just followed the main instructions at the top of this page and it all worked, dont think I had to do anything special/undocumented. Note that on an de-underclocked SLUG it still took maybe 20mins for the build to run, and maybe 2-3 mins for slimserver to start, but it all works. Web is slow, but works. Ive only tested on a 6 file library, and interent radio, but works fine. I am away next week so maybe I will point the SLUG at my 15,000 track MP3? collection and see if its finished by the weekend!

(Update - Even scanning a small 40 song library takes ages, 10-20mins? and uses 95% CPU - what on earth is the code doing in there??. I have also installed TwonkyMedia? Server on the same box, so the same music collection can feed into SLIMP3? and Netgear MP101? players, and noted;

  SLIM SERVER V6.2.1.......feeding SLIMP3?.............30-60% CPU continuously  
  TWONKY V3.1..............feeding Netgear MP101?......a blip of 50% CPU say for 1 second every 40 seconds ? - avg <2% CPU

(The Twonky server seems to index the 40 track MP3? collection about 100x faster too!)

UPDATE II.. Ok, Slimserver is now running MUCH better. There was an "httpd" process that kept appearing, consuming up to 90% CPU, that was causing the problem. I assumed this was the slim server web interface, but not sure it was. If I "kill -9" the process then everything speeds up to an acceptable level, similar to what other users are reporting. I also added extra swap space, but for some reason I dont think that was the main reason its speeded up. Yes, it is now acceptable and usable - with the performance before it was just not usable. The 30-60% CPU utilisation of slimserver.pl (as detailed above) is the same, but its usuable. [One remaining problem, a couple of times the slimserver has hung for about 5-9 minutes at the end of a track, then continues on without problem - not investigated this yet]


(Comment: I run SlimServer 6.2.0 on a turbo-slug, Unslung 5.5, lotsa swapspace. My collection amounts to about 12000 mp3, scanning them all and building the database (16M big) takes about 6 hours. It's OK AFAIK, it happens at night while I'm catching some Z's. Remains to see how fast/slow the rescanning is. My SqueezeBox? works just fine with the server, with a few exceptions. Browsing is smooth enough, but *asking* for a particular bunch of information takes a little while. For example, when I do "Browse genre" there's a slight delay in the box before it responds - obviously this is because the slug can't perform the query fast enough. Once the information has been queried, browsing it is fine. The streaming works just fine, occasionally (like once every 3-4 hours) there's a short pause in the stream, in between tunes. All in all it's acceptable, but I suspect that a collection with over 20 000 mp3's could prove to be too much.)


flipflip adds: I successfully installed SlimServer 6.2.1 on a Synology Diskstation 101j (Firmware 2.0.1 - 3.0281).
Update Apr 17 06: This is now documented and available for download here: [http://oinkzwurgl.org/software/slimserver]


dan adds: those of you who have ogg vorbis files in your collection will need a couple extra steps... first, install the ivorbis-tools ipkg, then find the convert.conf file in your slimserver dir and swap all the ogg stanzas using sox (which doesn't support using tremor yet) for the ones using oggdec (also, something is afoot with the oggdec -R option where it wants an argument, but doesn't seem to care what the arg is, hence the "x" below). Then, you'll notice running oggdec and lame at the same time chokes the poor slug. I couldn't figure out how to get the ogg-to-wav section to be the only one, so I had to modify the ogg-to-mp3 one to look like this:

ogg mp3 * *

        [oggdec] --raw x -Q -o - $FILE$

So now my oggs and mp3s are both happily playing (under SlimServer 6.2.2). I second the SQL-slowness comment above - took a quick look and it seems like there's potential to speed up the couple crucial queries, especially if you don't use moodmagic and might be willing to have it not remember where in the browse lists you last were. Haven't poked into it too deeply yet though.


flipflip adds: Users of a DS101j? NAS might want to try my easy way of installing SlimServer using the firmware upgrade function of the DS. Yes, that's right, there's no need to enable telnet or poke around in a shell to make it running. Check my homepage at [http://oinkzwrugl.org/software/ssods/] and the threads in the slimdevices forum at [http://forums.slimdevices.com/showthread.php?p=110216#post110216] (English) and [http://forums.slimdevices.com/showthread.php?p=110220#post110220] (Deutsch) for further details. Regards, flipflip


ajcooper adds: I've installed Slimserver with no problems, however there are two things missing. One, when I restart by NSLU2 I have to telnet in and manually restart the slimserver, can this be automated? Also, alot of my collection is AAC format (unprotected) - can I install a decoder or do I have to change everything over to MP3??


headworx adds: works like a charm, I added autostart for Slimserver - the details are on my blog: [http://techbulletins.blogspot.com/2006/08/slimserver-embedded.html]


excubey adds: I did it a little differently from headworx, adding a simple start script in the /opt/etc/init.d directory . I called S100slim (could be anything), and added these lines using vi:

(pound symbol)!/bin/sh
/slim

Once you do that, be sure to chmod +x S100slim to make it executable. You can see we are calling another script called "slim" For me, it looks like this: (modelled on nslu2-linux's slimserver install instructions), I store it in the root dir

cd /usr/local/SlimServer_v6.3.0
./slimserver.pl --daemon --prefsfile /etc/slim-data/slimserver.pref --cachedir /etc/slim-data

That's it!


something changed. Several people (including me) have problems to install (make) slimserver. Have a look at the folloeing links: http://forums.slimdevices.com/showthread.php?t=27162 http://forums.slimdevices.com/showthread.php?t=26723

Any ideas what happened?

Nigel adds: SlimServer_6.2.1 was working fine with Unslung 5.5Beta. I upgraded using ipkg for about the first time in six months. The result is a missing libexpat.so.0 as the replacement expat package has moved on to libexpat.so.1. While SlimServer _v6.2.1 and _v6.3.1 both rebuilt/built OK and run, neither play some internet radios URLs?. They fetch and even bring up the spectrum display just before starting the audio but then drop back. The problem is SlimServer side as SlimServer on a PC works fine. Using libexpat.so.1 causes Apache to crash so it looks as if the two versions of libexpat are not binary compatible. Thus a 'crude fix' using a symlink does not work either. 'Googling' shows the problem of Apache and libexpat Suse 10.0. If you have a working SlimServer on Unslung5.5Beta stay away from ipkg upgrade at the moment. I forced expat back to Libexpat.so.0 but that does not work either. It looks like packages have become incompatible. Hoping it will get fixed soon as it beyond my ability to tackle.


I found a pre-compiled tar-ball (http://homepage.eircom.net/~altondsl/slim/SlimServer_v6.3.1arm.tar.gz) of SlimServer 6.3.1 on OpenFSG Forums (http://www.openfsg.com/forum/viewtopic.php?p=9964#9964) that works on Unslung 5.8Beta. Just unpack it and run it, don't try to compile.

Many thanks to Bryan who made the tar-ball. Now I can enjoy my music again!


Next to BPA's precompiled SlimServer_v6.3.1 it is also not very difficult to install version 6.5.1 (do not install 6.5.0 since 6.5.1 has less bugs and give much less troubles, I even thinks it uses less resources).

Installing version 6.5.1 it quite simular as the version described above.

Before you start create a new user which will run SlimServer, it cannot be root. Most people use "slim", you can create it wit the web interface of the slug.

Before unpacking the tarball install MySQL with:

 # dpkg install mysql

After the succesfull installation remove the MySQL diversion script (or symbolic link) in /opt/etc/init.s/Sxxmysqld

Next change the path in:

 # export PATH=$PATH/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/armeb/bin:/opt/bin:/opt/sbin:/opt/bin:/opt/bin:/opt/armeb/bin:/opt/libexec:/opt/sbin:/opt/libexec

Make the user "slim" owner of your music directory, /usr/local/slimserver and /etc/sim-data I've made it myself simple by using:

 # chown -R slim /etc/slim-data
 # chown -R slim /usr/local/slimserver
 # chown -R slim /<your music directory>

Now you can run "build-perl-modules.pl",possibly you run into troubles with Compress-Zlib-1.41. This can be resolved by going to the directory where Compress-Zlib-1.41 and run the following commands:

 # perl Makefile.PL
 # make
 # make install

Atfer this you can run "build-perl-modules.pl" again. Now it should complete without critical errors.

When it is finished go to the directory /usr/local/slimserver/MySQL and change the file "my.tt". Put a # for the line "inno_db_fast_shutdown=1".

If everything goes as planned you can start with (being is the installation directory):

 # ./slimserver.pl --daemon --user slim --prefsfile /etc/slim-data/slimserver.pref --cachedir /etc/slim-data --cliport 0 --pidfile /usr/local/slimserver/slimserver.pid --logfile /usr/local/slimserver/log/slimserver.log

The log file is usefull trouble shooting. Be sure making the log-directory with:

 # mkdir /usr/local/slimserver/log

For trouble shooting you can use:

 # ./slimserver.pl --user slim --prefsfile /etc/slim-data/slimserver.pref --cachedir /etc/slim-data --d_server --d_scan

Step by step you can see what the SlimServer is doing and see where the problems arise. You can stop the SlimServer with ^c.

Using the webinterface is sluggish.

The procedure I descibed above worked for me serveral times, I've put it together reading several topics on the slimdevices forum. It does not work for releases below version 6.5.0.


I did not get far :

  1. /usr/local/SlimServer_v6.5.1/Bin/build-perl-modules.pl

Can't locate File/Which.pm in @INC (@INC contains: /usr/local/slimserver/CPAN CP AN /opt/lib/perl5/5.8.8/armv5b-linux /opt/lib/perl5/5.8.8 /opt/lib/perl5/site_pe rl/5.8.8/armv5b-linux /opt/lib/perl5/site_perl/5.8.8 /opt/lib/perl5/site_perl .)

 at /usr/local/SlimServer_v6.5.1/Bin/build-perl-modules.pl line 20.

BEGIN failed--compilation aborted at /usr/local/SlimServer_v6.5.1/Bin/build-perl -modules.pl line 20.

it had to be /usr/local/slimserver ... so I had to rename 'mv /usr/local/SlimServer_v6.5.1 /usr/local/slimserver'

and PATH=$PATH:/opt/armeb/bin export PATH

then it ran but .....

Downloading DBD-mysql-3.0002.tar.gz to: /public Uncompressing.. Configuring.. PERL5LIB?=/public/DBI-1.50/blib/lib:/public/DBI-1.50/blib/arch /usr/bin/perl Make file.PL Can't exec "mysql_config": No such file or directory at Makefile.PL line 76. Can't exec "mysql_config": No such file or directory at Makefile.PL line 454. Can't exec "mysql_config": No such file or directory at Makefile.PL line 454. Can't exec "mysql_config": No such file or directory at Makefile.PL line 454. Can't exec "mysql_config": No such file or directory at Makefile.PL line 454. Can't exec "mysql_config": No such file or directory at Makefile.PL line 454. Can't exec "mysql_config": No such file or directory at Makefile.PL line 454. Failed to determine directory of mysql.h. Use

  perl Makefile.PL --cflags=-I<dir>

This is just all too painful


6.5.4

Don't know if anyone is still reading this page, but I've got 6.5.4 working on a Turbo slug using the original instructions combined with those above concerning 6.5.1.

I also made some tweaks to my.tt using info from here. Don't know if it's had an effect, but if it has, it's not detrimental.

I trimmed down other things on the Slug such as UPnP? and Maxtor one-touch. Removing unneeded slimserver plug-ins also reduced the memory footprint. Running a total of approx 78MB.

It was all complied natively, so I'm hoping that means it's ARM optimised, but I really don't know enough about this stuff to say for definite.

Knowing my luck, bpa will do an IPKG for 6.5.4 now. I tried myself, but got stuck trying to get a Perl make script running in the optware make file. Hey-ho.

view · edit · print · history · Last edited by Gary.
Based on work by Gary and Henrik.
Originally by Henrik.
Page last modified on October 05, 2007, at 09:27 PM