I'm a big fan of SlimDevices' (now Logitech) Squeezebox products. See an overview of my whole house audio system. As I now use my Media PC in my main audio listening area, I wanted to replace my older squeezebox classic with the same functionality on my Media PC. While I love squeezebox products, I like even better that there is one less box in my TV stand. +1 for my Media PC v.s. device clutter.
Fortunately, this is pretty easy to do and it works great.
If you already use Squeezeboxes, all you need is some software running on your Media PC called SqueezeSlave. Download it and extract it into a folder on your Media PC. SqueezeSlave is essentially a software version of a Squeezebox and connects to your SqueezeCenter audio server just like any other Squeezebox product.
Setting up Squeezeslave is pretty simple, I'll go through the steps so you can have it too.
Step #1: Select your audio output
Media PCs have multiple audio output options. This makes them extremely flexible for a variety of applications. Why would you want to use multiple outputs?
Well, in my case I want to listen (and control) music without having my TV on. Since my media PC drives my TV through a single HDMI connection, when my TV is off you can guess what happens to the sound. Therefore, when listening to music, I need to use a different audio output. With my Media PC I have several choices. Here is a quick view of the back:
If I wanted, I could use a Coax (non-optical) S/PDIF instead, however with my motherboard I'd need an optional bracket to do this. Here is an example of one SPDIF RCA Out Plate Cable Bracket.
NOTE: SqueezeSlave (unlike the other software Squeezebox emulators), supports using alternate audio output devices. This is very important otherwise we could just use SoftSqueeze or SqueezePlay. These other players default to using the "current" audio device (which in my case would be my HDMI).
To force SqueezeSlave to use a specific audio out, you need to find out how it "numbers" the audio devices. All you need to do is run squeezeslave with the -L option in a command window:
Step #2: Create a simple batch file to run SqueezeSlave
You can run SqueezeSlave by itself as a command. However, since SqueezeSlave takes some arguments you might want a batch file to make things easier. Here is my batch file (copy it and save it as sqslave.bat). Watch out for the long squeezeslave line, it wraps around.
echo "Launching SqueezeSlave"
echo "Warning: SqueezeSlave exited..."
echo "Sleeping for 10 seconds"
rem sleep 10
ping 127.0.0.1 -n 11 >NUL
The batch file is pretty simple, but you will need to edit a few things:
- Change the -oN to the device that you want, listed by the -L command previously. NOTE: Be sure to use the same binary when you run -L and when you run the server for real. The numbering for the output devices may be different between regular, ASIO, and WASAPI. I made that mistake!
- If you like, change the -mXX... option to whatever virtual MAC address you want to be assigned to your player. This should be unique and unless you have multiple squeezeslave players, you won't need to change this.
- Be sure to update the script with the full path to your SqueezeSlave binary. I use WASAPI, as it supposedly enables a lossless audio stream. If you want to use the ASIO version (also for lossless streams) you will need a driver like ASIO4ALL installed. I've also tried the default version of SqueezeSlave and it works fine too.
- Update the IP address or hostname of your squeezebox server. This can be your Media PC itself, if that happens to be where your run your server. In my case, I use a separate computer (my desktop).
The -D option enables a text interface that emulates a squeezebox display. This is kind of nice and allows you to control SqueezeSlave with simple keyboard commands (see below). This is optional, of course.
The --retry option and batch file loop insures that if there is a problem, SqueezeSlave will keep trying or restart. I've found this handy (see below).
If you do want to mess with WASAPI, make sure that your audio device supports exclusive mode and the 44.1Khz sample rate (or else you will get an error). You can check this under Audio Properties in Windows 7 as shown below:
Step #3: Automatically start Squeezeslave on boot
Unfortunately, Sqeezeslave is just a program without any wrapper to run it as a service. What we need is something to make sure it is running every time the Media PC boots. This is easy to do and another great reason to use EventGhost (see my post on EventGhost).
All you need to do is add an "action" to the AutoStart folder in EventGhost which launches the batchfile above. This should run when EventGhost (and your computer) restarts:
Note: If you exit EventGhost for some reason and restart it (sadly easy to do), you will get two SqueezeSlaves running. Obviously this is bad, and you will notice right away that your music will stream for only a few seconds and restart. Just kill the extra SqueezeSlave and things should resume normally. No harm done.
Here is what the command window looks like when running SqueezeSlave:
Not very exciting, huh? Well, since the TV will be off, having a bare bones UI is perfect. However, even this simple UI is useful.
When the window has focus, you can use the keyboard to control SqueezeSlave. Try pressing the spacebar to start/stop the music, arrows to navigate, +/- for volume, etc.. Run "SqueezeSlave --help" to see the full list of keys supported.
If you use the same remote setup as I do, you can program a button to raise the SqueezeSlave window. Then the play/pause buttons on the remote will work! This is handy for when the phone rings and you need to put the music on hold for a minute.
Step #4: What if things go wrong?
Early versions of SqueezeSlave would often crash on me. This doesn't seem to be a problem anymore thankfully.
However, I wrote a little batch file to automatically kill SqueezeSlave. Since the batch file would restart it, I only had to wait 10 seconds for the SqueezeSlave to start up again. To make this easy to restart, I even bound the batch file to the "Clear" button my remote using EventGhost. All I needed to do is press this button when it got stuck. Here is the batch file in case anyone finds this useful:
echo "Killing SqueezeSlave"
taskkill /f /im squeezeslave*
taskkill /f /im squeezeslave*
Step #5: Sit back and enjoy the music!
Finally, here is a quick video showing me controlling SqueezeSlave on my Media PC through a web interface. I'm doing this with the TV on, but obviously I can do this from anywhere in the house, or with my iPhone.
BTW: I'm currently enjoying Johnny Cash's Unearthed (5CD) as I write this - truly timeless music)