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. I found Slim’s approach very interesting; literally giving away an open source media streaming software intended for use on a file server. They then made money by selling a dedicated hardware device to interface the music stream to a traditional stereo system.
Figure 1: Slim Devices Squeezebox
Slim Devices is now part of Logitech and offers three different devices:
- Squeezebox Classic – the 3rd generation of the original SliMP3 with a simple remote control and large vacuum fluorescent display (Figure 1)
- Squeezebox Duet – a variant on the Squeezebox with that trades the fluorescent display for a more elaborate remote control with a color LCD status display
- Transporter – a beautiful, seriously high-end streaming music interface for those who suffer audiophile tendencies
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. At my house, 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 Netgear (formerly Infrant) ReadyNAS.
Figure 2: The SqueezeCenter Web GUI
The idea to embed the server on a NAS seems 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 Pentium 4 2.8 GHz PC running 24/7 just to serve music. In contrast, the NAS approach consumes less power, generates less heat and 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.
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 HP T5700 thin clients (Figure 3) that I had saved from being recycled a few years ago. You can usually find these on e-Bay, or by Googling around a bit.
Figure 3: HP 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 and VGA video and audio ports. At first glance, they seem more than adequate for hosting SqueezeCenter, given the addition of suitable storage. They are also completely fanless, dead silent, and consume very little power (Figure 4).
Figure 4: HP 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. So the obvious choice for a storage strategy was to replace the flash module with a laptop style 2.5″ IDE hard drive.
The best deal I could find was a 250 GB, 5400 RPM Western Digital drive 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. So I needed only about 200 GB available for music.
While commercial NASes often feature RAID storage, I decided that this wasn’t necessary for my purposes. I have all my music backed up onto portable hard drives and the original CDs as well, 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 can easily be configured to support RAID 0, 1 or 5 given suitable storage media. But 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 44-pin IDE cable with connectors for multiple drives.
Figure 5: T5700 expansion chassis (left) vs regular side (right)
The T5700 chassis is small, but it is possible to mount a laptop disk in the standard case. However, I happened to have one of the optional expansion kits on-hand (Figure 5). 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 for the PCI card, or in my case, a hard drive.
The expansion chassis also makes possible a second storage strategy: adding a PCI card with USB 2.0 interfaces connected to external USB 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 and not especially fast.
I started by opening up the T5700 and removing the flash module. I then connected the 44-pin IDE cable to the motherboard (Figure 6).
Figure 6: HP T5700, cover open with 2.5″ IDE drive installed
Be careful to note the location of pin 1 on the header and the red stripe on the ribbon cable (Figure 7). Unlike larger IDE connectors, the laptop-sized header is not keyed, so the cable can be connected in reverse, with possibly tragic consequences.
Figure 7: Closeup of the IDE cable connecting to the T5700 motherboard
The hard drive is mounted by simply taking advantage of the holes in the metal portion of the expansion chassis. The mounting holes in the drive are not on the same spacing as the holes in the chassis. So just rotate the drive until two of it mounting holes line up with two holes in the sheet metal (Figure 8). 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 cable ties.
Figure 8: 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 HP thin client family 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. However, the normal chassis side is a solid sheet of metal, so you can simply drill four holes to mount the drive in the desired location.
Figure 9: 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 (Figure 9). This will keep the system from accumulating dust internally.
Figure 10: T5700 with and without the expansion chassis
It’s also worth mentioning that HP 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.
We need to work directly on the T5700 for the initial software installation. That means connecting a VGA display and keyboard to the system. Since the T5700 doesn’t have a PS/2 type keyboard connector, I used a USB 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 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 (Figure 11).
Figure 11: FreeNAS boot menu
Start by selecting the option to install FreeNAS to the internal hard drive. Then 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 configuration of other core elements.
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 as a dedicated music server. If you wish to investigate these further, please read the excellent documentation provided at the FreeNAS web site. You can also check out Brandon Teska’s review.
Configuring The Disk
Once FreeNAS is running, you need to configure it to use the remainder of the hard drive space as a share point. Connect to the web interface by pointing a browser at the system’s IP address. The default web login is admin with a password of freenas. Once logged in (Figure 12), you may elect to change this login & password for security purposes.
Figure 12: FreeNAS basic status display
Start by going to the Disk Management menu and add the disk to the system (Figure 13).
Figure 13: Disk Management menu
Only one drive will be offered (ad0) as available for use. Edit that drive and check that the lower setting for Preformatted file system should be set for UFS with soft updates. (Figure 14). Then select Save to store the configuration.
Figure 14: FreeNAS disk management process for adding the disk
Configuration – more
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 Disks > Mount Point from the left-hand menu bar and click on + to add a mount (Figure 15).
Figure 15: 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 (Figure 16).
Figure 16: Adding the mount point for the second partition
The next step is to create & enable a CIFS share so that we can put media on the drive. Select Services > CIFS/SMB from the FreeNAS menu. On the Settings tab enable CIFS/SMB sharing and select an authentication type (Figure 17). To get started, I allowed anonymous file sharing although user permissions can be established locally, or the server can integrate with a domain.
Figure 17: Enabling CIFS/SMB sharing
The last step is to add an SMB share point. On the CIFS/SMB menu, select the Shares tab, then click + to add a share (Figure 18).
Figure 18: Creating the CIFS/SMB share to hold the music
Give the share a 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 box and enter \\freenasipaddress to confirm that I can connect to the remote share. Figure 19 shows the result on my system.
Figure 19: Connected to the new share on FreeNAS from a Windows PC
Once the disk share is available you can download & install Michael Herger’s SlimNAS software. You’ll need several items:
- Michael Herger’s SlimNAS install script
- The SlimNAS release
- The Slim Devices Squeeze Center release for Linux (It’s important to use the “noCPAN” version ).
In the root of the CIFS share create a folder called “slimnas” and copy all three files into that folder.
Figure 20: SlimNAS Installables
Log into the FreeNAS web management GUI. From the FreeNAS menu select the System > Advanced option, which provides a means of entering a shell command. Enter the following shell command:
Then click on Execute (Figure 21).
Figure 21: About to run the SlimNAS installer
When the shell command has completed, the FreeNAS menu should return a status display as shown in Figure 22.
Figure 22: 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 (Figure 23).
Figure 23: SqueezeCenter listed in the Extensions menu
Select SqueezeCenter and you should see the screen shown in Figure 24.
Figure 24: 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 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 (Figure 25) 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.
Figure 25: FreeNAS process menu showing Perl running
Once the installation has completed successfully, the extensions menu will include a link to the SqueezeCentre web GUI (Figure 26). That address is always the name or IP address of the FreeNAS device, but with port 9000 specified in the URL. In my case http://192.168.10.60:9000/.
Figure 26: 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 subfolders for MP3s, FLACs, and playlists. These paths get loaded into the SqueezeCenter settings (Figure 27).
Figure 27: SqueezeCenter 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. Upon completion of the scan, you can start the music playing.
There is an optional SqueezeCenter setting that forces the server to transcode the streams on-the-fly 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 – Streaming
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 (Figure 28).
Figure 28: 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 (Figure 29).
Figure 29: 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 returned to normal operation. I then proceeded with further CPU and throughput tests, starting with listening to a song in FLAC format (Figure 30).
Figure 30: 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.
I next started an Internet Radio Stream, then added a FLAC stream (Figure 31). The heaviest CPU usage was once again encountered when interacting with the web interface.
Figure 31: CPU usage with one flac stream and one internet radio stream
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 (Figures 32 and 33).
Figure 32: CPU usage with two FLAC streams
Figure 33: Network traffic with two FLAC streams
Then finally, all three Squeezeboxes (Figures 34 and 35).
Figure 34: CPU usage with three FLAC streams
Figure 35: 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.
Performance – File Transfer
Since my server is also a SMB file server, I used iozone to get an idea of its file transfer performance. I used the same command line that we use for our NAS Chart tests, but only ran file sizes up to 512 MB. I used an HP8510p notebook (Intel Core 2 Duo 2.2 GHz, 2 GB RAM, Windows XP, SP3) to run iozone on and connected it and the T5700 via a 10/100 switch.
Figure 36 shows caching effects during write, with performance trending down to 3.5 MB/s for the higher filesizes. Read is a bit better, hanging in between 4.5 and 5 MB/s.
Figure 36: T5700 / FreeNAS iozone throughput
For comparison, Figures 37 and 38 show write and read performance of a few single-drive retail NASes: Western Digital My Book World Edition (WDG1NC5000); Buffalo Technology LinkStation EZ (LS-L500GL); and LaCie Ethernet Disk mini (300938U).
Figure 37: Selected single-drive retail NASes – iozone write throughput
Even though the comparison isn’t apples-to-apples because of the different iozone machines, you can see that the little T5700 w/ FreeNAS holds its own pretty well against the commercial alternatives.
Figure 38: Selected single-drive retail NASes – iozone read throughput
This project has been just full of advantages. The old P4 server has been repurposed and I don’t miss it a bit. The silent T5700 now resides in the same room where I do most of my more critical listening and is quiet as a mouse.
Migrating from a tower PC to an very low power platform allowed me add it to my UPS without worrying about the additional load since the system draws a very modest 14 watts. Drawing less power is great since it’s left running 24/7.
And finally, I saved a nice little box from going to the landfill. With its useful life extended, it will be serving up music around our house for years to come.