Site icon Graves On SOHO Technology

How To: DIY Music Server Using FreeNAS, SlimNAS and an H-P T5700

Originally published July 21, 2008 at www.smallnetbuilder.com

By: Michael Graves

Date: July 21, 2008

From my first exposure to Slim Device’s original SliMP3 back in 2003 I was taken with the idea of streaming music throughout my house. The designers approach to this task I found very interesting. They literally give away an open source media streaming software intended for use on a file server. Then run their business by selling a dedicated hardware device to interface the music stream to a traditional stereo system.

SliMP3 has over the years through several generations of hardware. They presently offer three different devices;

One of the nicer things about the Squeezebox is that several can be set to play the same music in sync, or set to play entirely different playlists. This can be handy, addressing the needs of both the common dinner party and a multi-faceted Halloween haunted house. Around my home we have accumulated three of the classic Squeezeboxes, and are on-plan to purchase two more.

All Slim Devices products source their music streams from the same open source server software. This software, written in Perl, was once known as “Slim Server” but from the release of v7.0 has been renamed “SqueezeCenter.” Slim Devices provides releases for Windows, Macintosh and Linux hosts.

They also offer a release built specifically for the Infrant ReadyNAS. The idea that the server was embedded on a NAS device seems truly ideal. Voluminous RAID storage to serve & protect the music just makes sense. It certainly makes more sense than my recent situation, which was keeping a Pentium4 2.8 GHz PC running 24/7 just to serve music. In contrast, the NAS approach consumes less power, generates less heat, less noise, and takes less space.

There was only one problem. ReadyNAS would not have been my personal choice of NAS. I prefer a less expensive, more DIY approach. To that end I have long used FreeNAS around my home office. FreeNAS is open source based on BSD and takes advantage of the GUI framework developed for the m0n0wall router project.

Happily, others share my opinion of FreeNAS. Early in 2007 Michael Herger ported the SqueezeCenter software to create an installable plug-in for FreeNAS.

Hardware Platform

The SqueezeCenter software will run adequately on just about any PC. FreeNAS also has trivially light hardware requirements. My choice of a hardware platform stems from something that I had conveniently at hand…a box of recycled H-P T5700 thin clients.

H-T T5700 Thin Client

Thin clients are nice little boxes for embedded projects. The T5700s I have feature a 1 GHz Transmeta CPU, 256 MB RAM, several USB 1.1 ports, ethernet, VGA & audio capability. At first glance they seem more than adequate for hosting SqueezeCenter, given suitable storage arrangements. They are also completely fanless, dead silent, and consume very little power.

H-P T 5700 thin client with the side removed

The T5700s come with an internal flash disk-on-module (DOM) on a 44-pin IDE connector. Thus the obvious choice for a storage strategy is to replace the flash module with a laptop style 2.5″ IDE hard drive.

The most appropriate deal I could find was a 250 GB, 5400 RPM Western Digital disk for $99. My music library is over 400 GB but I decided that I could keep a significant portion of the library on offline storage. Thus I only needed about 200 GB available for music.

While commercial NAS often feature RAID storage for my purposes I decided that this wasn’t necessary. As well as the original CDs I have all my music backed up onto portable hard drives so I feel that I’m adequately protected. Fault tolerance is simply not a requirement for my dedicated music NAS, so one 2.5″ disk was all I needed.

FreeNAS could easily be configured to support RAID 0, 1 or 5 given suitable storage media. Fitting multiple disks into the T5700 chassis might be a challenge. I’m reasonably certain that I could fit three drives into the expansion case, but mounting them sensibly might be tricky, as would be finding a 40-pin IDE cable with connectors for multiple drives.

H-P T5700 Expansion Case (left) vs Standard Side Cover (right)

The T5700 chassis is small. It’s possible to mount a laptop disk in the standard case, but I happened to have one of the optional expansion kits on-hand. These are intended to allow the addition of a PCI card, but also provide enough space for a couple of small disks. The metal portion of the expansion kit is perforated to provide extra cooling to the PCI card, or in my case the hard drive.

The expansion chassis also makes possible a second storage strategy. You could add a PCI card with USB 2.0 interfaces, then use externally attached drives. They might be 3.5″ desktop drives in a USB housing or 2.5″ drives in bus-powered USB cases

Be aware that the T5700 will not boot to a drive attached to a USB port on a PCI card. It will boot to the on-board USB ports, but these are USB 1.1 so not especially fast.

Installing the Disk

I started by opening up the T5700 and removing the flash module. Then I connected the 44-pin IDE cable to the motherboard.

Closeup of the IDE cable connecting to the T5700 motherboard, note the red lead indicating pin 1

Be careful to note the location of pin 1 on the header and the red stripe on the ribbon cable. Unlike larger IDE connectors the laptop-sized header is not keyed so the cable can be connected in reverse, with possibly tragic consequences.

The hard disk is mounted by simply taking advantage of the holes in the metal portion of the expansion chassis. The mounting hole in the drive are not on the same spacing as the holes in the chassis so just simply rotate the drive a little until two of it mounting holes meet two holes in the sheet metal. Two screws are adequate to mount the drive. If you feel it needs to be more secure you could always lash the drive into place with nylon wire ties.

T5700 expansion side showing HD mounted by 2 screws

If you’re not using the T5700 expansion chassis then the drive will still fit, but you’ll need to be careful to locate it so that it doesn’t interfere with any of the heat sinks or connectors on the T5700 motherboard when the case is closed.

New models in the H-P thin client range have faster CPUs and larger internal heatsinks. This makes mounting the drive a little trickier, but it can still be made to fit nicely into the standard chassis.

Since the normal chassis side is a solid sheet of metal you can simply drill four holes to mount the drive in the desired location.

Rear view of the T5700 with the expansion side added

When using the expansion chassis you need to install a filler blank in the back where the PCI card would normally reside. This will keep the system from accumulating dust internally.

T5700 with and without the expansion chassis, note the vertical orientation

It’s also worth mentioning that H-P does not intend the T5700 to run while sitting horizontally. They provide the little stand for a reason…cooling. The basic chassis is designed to cool properly when oriented vertically. The extra perforations in the expansion chassis reduce cooling issues to a degree, but I still prefer to stand the unit vertically.

Installing FreeNAS

For the initial software installation we need to work directly on the T5700. That means connecting a VGA and keyboard to the system. Since it doesn’t have a PS/2 type keyboard connector I used a USB attached keyboard.

To start the process of building the software load you’ll need to download the live CD ISO version of FreeNAS. At the time of my installation this was v 0.686.4 (stable). The live CD is used when you want to boot the software from CD, and it stores its configuration files on a floppy disk or USB key. If you’re using a traditional PC as the host platform you can run FreeNAS in this manner without ever truly installing it to a hard drive.

For our purposes we want to take advantage of a menu option that allows you to install FreeNAS to some other media (disk or flash) present on the host platform. This is the easiest way to install FreeNAS to the disk in the T5700. What is needed is a small boot partition (30 MB) for FreeNAS, then the rest of the disk (232 GB once formatted) as a separate partition for the SqueezeCenter software and music library.

To boot to the CD I used a portable external CD drive in a USB housing. My T5700s are set to boot to their USB port if not other media is present. You may need to set the BIOS in your device to boot to USB attached device.

FreeNAS boot menu

Start by selecting the option to install FreeNAS to the internal hard drive. On the following menu select the option to establish separate partitions for FreeNAS and other data. Once the install process is complete disconnect the external CD drive and reboot. Once rebooted we can address other core system setups.

Since the T5700 has only one network interface it doesn’t need to be assigned. You can set the device to DHCP if desired, or change the IP address to something suitable for your network. From this point you can complete the configuration using the web based GUI.

There are quite a number of configuration possibilities in FreeNAS, many of which are beyond the scope of its application in a dedicated music server. If you wish to investigate these further please read the excellent documentation provided at the projects web site.

Configuring The Disk

Once FreeNAS is running you need to configure it to use the remainder of the hard drive space, making it accessible as a share point. Connect to the web interface by pointing a browser at the systems IP address. The default web login is “admin” with a password of “freenas.” Once logged in you may elect to change this login & password for security purposes.

FreeNAS basic status display

Start by going to the Disk Management menu and add the disk to the system.

The Disk Management menu, where the drive is added to the system

Only one drive will be offered (ad0) as available for use. The lower setting for “preformatted file system” should be set for “UFS with soft updates.” Then select [Save] to store the configuration.

FreeNAS disk management process for adding the disk

The second partition of the drive was already formatted during the base install process so we can skip the formatting step and proceed to establish a mount point. Select [Mount Point] from the menu and [+] to add a mount.

The Mount Point Menu showing the second partition mounted

The mount desired is /dev/ad0s2. Specify the second partition. The file system type is UFS. I simply called the mount “freenas”.

Adding the mount point for the second partition

The next step to Create & enable a CIFS share so that we can put media on the drive. Select [CIFS/SMB] from the FreeNAS menu. On the settings tab enable CIFS/SMB sharing and select an authentication type. To get started I allowed anonymous file sharing although user permissions can be established locally, or the server can integrate with a domain.

Enabling CIFS/SMB sharing

We complete the configuration of FreeNAS by adding an SMB share point. On the CIFS/SMB menu select the Shares tab, then select [+] to add a share.

Creating the CIFS/SMB share to hold the music

Give the share a sensible name and select the path offered, which is the previously established mount point. [Save] the settings.

At this point you should be able to connect to the NAS from another system. In Windows XP I typically use the Start/Run dialogue and enter freenas.ip.address.here to confirm that I can connect to the remote share. Here’s the result on my system.

Connected to the new share on FreeNAS from a Windows PC

Installing SlimNAS

Once the disk share is available you can download & install Michael Herger’s SlimNAS software. You’ll need several items:

In the root of the CIFS share create a folder called “slimnas” and copy all three files into that folder.

SlimNAS Installables

Log into the FreeNAS web management GUI. From the FreeNAS menu select the Advanced option. This gives you a means of entering a shell command. Enter the following shell command.

/bin/sh /mnt/YourShareHere/slimnas/slimnas-install.sh

Then click on [Execute]

About to run the SlimNAS installer

When the shell command has completed the FreeNAS menu should return a status display as follows:

Report after the install script runs sucessfully

You have just successfully installed the SqueezeCenter software to the disk, but it’s not yet tied into FreeNAS or set to run as a service on boot.

You’ll note that a new “Extensions” menu option has been added to the FreeNAS menus, and SqueezeCenter is listed as the only extension.

SqueezeCenter listed in the Extensions menu

Select SqueezeCenter and you should see the following result:

SlimNAS ready to be installed to FreeNAS

Check the tick box to [Enable] the SlimNAS software. Then in the install section select the SqueezeCenter release and click on [Save] to perform the installation.

The install process can take a a couple of minutes during which time the system may appear to be stopped. This is normal. While the installer runs you can navigate to the [Process] menu and see if the installation is proceeding. If it is running successfully you’ll see a reference to Perl on the list of running processes.

FreeNAS process menu showing Perl running

Once the installation is completed successfully the extensions menu will include a link to the SqueezeCentre web GUI. That address is always the name or IP address of the FreeNAS device, but with port 9000 specified in the URL. In my case

SqueezeCenter installed and running on FreeNAS

It’s worth noting that when the T5700 is rebooted it will take some time for the SqueezeCenter and associated services to restart. First the OS boots, then the file sharing mechanisms and finally the streaming server. It’s not uncommon for it to take 2-3 minutes before the music can resume playing after a reboot.

Configuring Squeeze Center

Now that you have the NAS and the SqueezeCenter software running you can define where SqueezeCenter should look for music and playlists. I created a folder on the share called “music”, then inside that I created additional folders for MP3s, FLACs, and playlists. These paths get loaded into the SqueezeCenter settings.

SqueezeCenter File Path Settings

Next I copied some files to the NAS. In my case I copied about 180 GB to the drive, in a mix of flac and high-bitrate MP3 formats. As you might imagine this process takes some time. Once the files are on the system you can use the web interface to invoke a scan of the library. Once that task completed you can start the music playing.

There is an optional SqueezeCenter setting that forces the server to on-the-fly transcode the streams to MP3 at a user-defined bit rate. This is intended for use when streaming over a bandwidth limited wireless network. It’s not appropriate for most situations and so by default is disabled. This is optimal for the T5700 since transcoding presents increased CPU load.

Finally, Slim Devices periodically updates the SqueezeCenter software. When you run the software within FreeNAS you cannot simply install the update as you would on a normal PC. You must check Michael Herger’s web site to see if he has released a revision of SlimNAS supporting the upgrade you wish to load.

At the time of this writing I am running SqueezeCenter v7.01 on SlimNAS v1.01. SqueezeCenter v7.1 has been released but requires SlimNAS v1.1.

Performance Testing SlimNAS

It should be obvious that the little T5700 is not going to be as responsive as the P4-2.8 tower that it replaced. Interaction with the web GUI is not as snappy, but it’s good enough for my needs.

Since I have several Squeezeboxes I decided to do some simple throughput testing to ensure the 1 GHz CPU and one little 2.5″ disk would suffice when feeding various combinations of music streams from disk and internet sources. FreeNAS makes such testing very simple as it provides a dynamic graphic of both CPU usage and network traffic.

I started start by checking the baseline CPU usage when merely logged into the FreeNAS web interface and watching the CPU graph.

CPU usage while idle, caused by using web GUI

Before we can play any music we need to let the SqueezeCenter software scan the storage and build a database of the files it finds.

CPU usage at start of scanning music library

The highest CPU usage was displayed when the server was actively scanning the music library to build its database. This only needs to happen occasionally, after you’ve added some new content. The process of scanning my 40,000 songs took about 30 minutes (?) during which time the server was completely unresponsive, unable to play and even unable to offer its web GUI.

Once the database was built the server was much more rational. I proceeded with further CPU and throughput tests starting with listening to a song in flac format.

CPU usage with one flac file playing

The CPU use shown during the idle period reflects the load presented by the FreeNAS web GUI including the graphing utility. The CPU load spiked during interaction with the Squeeze Center web GUI. The music stream only consumed about 10% of CPU power.

CPU usage with one flac stream and one internet radio stream

This time the heaviest CPU usage was shown when interacting with the web interface. The internet radio stream consumed about 5% of CPU, and the flac file about 10%. By this measure users with a single Squeezebox would find the little T5700 more than adequate.

Next, I measured CPU usage and network traffic while streaming music to two Squeezeboxes. Then finally, all three Squeezeboxes.

CPU usage with two flac streams

Network traffic with two flac streams

CPU usage with three flac streams

Network traffic with three flac streams

In all cases the music played without interruption and during playback the Squeeze Center web interface remained functional.

I also tried playing three separate streams, that is, a different song on each system, as well as all three systems in sync. This did not seem to make any difference to either CPU usage or network throughput.

Conclusion

This project has been just full of advantages. Since completing this project the old P4 server has been repurposed and I don’t miss it a bit. Being silent the T5700 now resides in the same room where I do most of my more critical listening, without making an audible impression.

Migrating from a tower PC to an appliance-like platform allowed me add it to my UPS without worrying about overloading the UPS. The system draws a very modest 14 watts. Drawing less power is great since it’s left running 24/7.

Lastly, I saved a nice little box from going to the landfill. Its useful life is extended as it will be serving up music around our house for the next few years.

Exit mobile version