Installing and Using SlimRIO

I’ve previously talked about the SlimRIO project, but I finally got around to actually getting it properly setup and installed in the playroom downstairs.  I figure I should give back to the community and write up a short How-To article.

I run a Linux based music server, but SlimRIO will also work if you wanted to use Windows to serve up music.  I will focus on Linux issues here, more specifically Ubuntu (Debian) configuration.  There will also be some amount of hand waving that occurs, I’m going to assume you can figure out some of the details yourself.  The SlimRIO website does cover Linux installation and configuration.  I’m actually using SlimServer still as I haven’t upgraded to SqueezeCenter yet.

The first hurdle you might stumble on is getting the DHCP server to offer up an IP address.  This will vary depending on your setup, but in my case my DHCP server is handled by my Linksys WRTGL router running DD-WRT.  If you’ve got a compatible router, I strongly recommend considering using DD-WRT.  Under the Adminstration->Services tab you can define a list of static leases that map MAC addresses to names and IPs.  It’s really nice to talk to all of the devices on the home network by name – instead of trying to remember the IP address.  [ok, so this probably wasn't terribly helpful but there are lots of how-to documents on Linux DHCP servers]

Initially just run the Python based SSDP server.  I found that on Linux the auto-detection of the host machines IP address didn’t work, so to be safe I recommend passing the numeric IP address (ie: 192.168.1.12) of your NFS file server.  Later I’ll talk about using the C version and growing an /etc/init.d script for Debian based systems.

The next tricky part will be getting an NFS server configured.  This is where the name (or IP) address you’ve assigned to the RIO will matter.  I ended up using WireShark to sniff traffic to determine what was going wrong, it may be something you want to consider available to help diagnose problems.  When the device boots it first gets an IP, the DHCP server tells the RIO what its hostname will be.  The SSDP “response” tells it where the NFS server lives.  The boot firmware then tries to mount via NFS the /tftpboot/<rio hostname> directory to get the rest of the firmware.  Jeff Mock hosts the original investigation into the RIO boot sequence.

Assuming all things are configured correctly, it will just work.  Of course you’ll have problems, but that’s where WireShark will be a life saver in pointing out what you did wrong.  Another good place to look is the system logs on your Linux machine.

Now let’s make it slick and build an init.d script to start the SSDP server.  This was the first time I had created one of these, so my solution may be naive – and I know that I took the long road to the solution I ended up with.  The Debian policy manual covers init.d scripts in section 9.3, I initially found 9.3.5 that talked about the provided skeleton implementation.  I then hacked this up to build my own init.d script for SSDP.  The man page for the start-stop-daemon was very helpful in doing this.

Most of the implementation should be obvious as it is primarily directly from the skeleton.  The only real work is in the start function:

#
#    Function that starts the daemon/service.
#
d_start() {
start-stop-daemon –start –quiet –pidfile $PIDFILE \
–exec $DAEMON –background –make-pidfile \
– 192.168.1.12 \
|| echo -n ” already running”
}

I’ve added the –background flag as the C version of SSDP is not a daemon and would never return control to the calling program.  The –make-pidfile instructs the start-stop-daemon to manage the pidfile for us instead of assuming the ssdp program will do so.  The final — followed by the IP address of the NFS server is an argument to be passed to the ssdp executable.  This script was installed as /etc/init.d/ssdp and now works as expected providing start, stop and restart.

The ssdp program was compiled from the C source available from the SlimRIO site. I installed it in /usr/local/bin and used chown to assign it to the slimserver user and group, then chmod +s to run the program setuid as a nod towards security (this causes it to run as the slimserver user).

Have the SSDP server automatically started at boot time is trivial.  I originally found an article on how to do it in Ubuntu, but it was also in the Debian policy manual had I read it more carefully. (sometimes search engines make you stupid)

The SlimRIO firmware emulates a SliMP3 device which isn’t capable of some of the fancy (now standard) screen savers and visualizers, this isn’t a big deal for me.  Also, in my setup it seemed that my MP3s were stored in a higher bitrate than it could easily handle without pauses. This is easily solved through a simple configuration in Slimserver under Player Settings->Audio – you can configure the bitrate limiting (default is no limit) which causes the music to be re-encoded on the fly, I found 128kbps to work fine.

As always, I get a kick out of “hacking” consumer electronics.  Its is also nice to take something that was gathering dust and put it to good use.

5 Responses to “Installing and Using SlimRIO”

  1. Roo Says:

    Robin the author of SlimRIO pointed out that there is now a version slimrio-0.7b that configures madplay to halve the sampling rate. This trades off some high frequency response but avoids MP3 artifacts.

  2. Raymond Day Says:

    I just got a 2nd Rio. I can’t get it to work with SqueezeCenter but my other one works super. I looked on here and did install the ssdp set it to start up at boot and started it but it don’t do any thing that I can tell.

    Is there any place that says hot to set up 2 Rio players?

    -Raymond Day

  3. Raymond Day Says:

    I got it working with my 2 RIO’s! I am very happy it works now. Been playing songs with it and my Slimp3 and other RIO still works too.

    It was hard to get it working but I did. It be hard to say how I did it. I am happy it works.

    I got the 2nd one off ebay for about $10 and $10 shipping! Way better then $300 for the Slimp3 play. But the display on them is a lot better. Can play over 128kbps on them too.

    -Raymond Day

  4. Roo Says:

    Raymond didn’t mention what problems he encountered – but getting this to work with a 2nd RIO should be pretty easy, it just requires a bit of persistence.

    You need to give each of the players a unique IP address. The Rio’s boot protocol will look in the NFS mount in the directory /tftpboot/RIOADDRESS/ where RIOADDRESS is the IP (or name if your DHCP server maps to names as mine does) of the Rio that is booting.

    I’ll admit that the Rio boot sequence is tricky to figure out. Refer to http://empeg.org.uk/slimrio/linux.html for reasonably good instructions, and if you’re still stuck – read Jeff Mock’s site linked in the original article above, and crack out wireshark and sniff some packets.

    Beyond that – Slimserver (SqueezeCenter) is design to handle multiple players, so that is trivial. As for the 128Kbps limit – if you read the SlimRIO pages carefully you’ll note that slimrio-0.7b-root.tar uses a kludge to the madplay library to handle higher bit rate MP3s.

  5. jmilk Says:

    C’mon guys, getting the second one working isn’t a big deal. Just follow the instructions for #1 and adjust the ip address. I’ve had three Rios gathering dust until I found the slimRio write-up, and now all three are working just fine.

    Steps, in short, are –
    1. Have a DHCP server on your LAN. I have the usual WRT54G/GS running tomato firmware (excellent).
    2. Plug in a Rio, boot it.
    3. Go to your router’s “devices” page and assign it a static IP. Note that IP.
    4. Powercycle the Rio. That is, pull the plug, then plug it back in. Confirm it took the static ip.
    5. Repeat 2, 3, 4 for each Rio.
    6. Create /tftpboot/ for the Rio #1.
    7. cp -r /tftpboot/ /tftpboot/ for each additional Rio.
    8. create /etc/exports entries for /tftpboot/… for all Rios. I did one each. Just making one entry for /tftpboot/ should work as well.
    9. Run your favorite flavor of ssdp and boot the Rios… everything works!

    In my case, I got everything working on my fileserver, but then moved it to my mythtv backend, as that’s running the slimserver as well.

    Enjoy!

Leave a Reply