This fourth part of my complete guide to digital audio covers modding SqueezeCenter so that I get the most quality out of my CDs.
One of the things that I really like about Logitech's SqueezeCenter is that it supports my favorite format right out the box. I'm talking about Cue Sheets with FLAC audio.
However, I have two minor problems. Since I store my audio CDs as perfect rips (without any modification), I have effectively (and intentionally) deferred the issue of handling pre-emphasis as well as HDCD decoding. Good high-end DACs usually handle these (when paired with a CD transport), but squeezeboxes don't behave like a CD transport. HDCD will work with a Squeezebox & DAC, but the preemphasis flag is always lost. I don't use a DAC anymore, so I wanted a solution for both issues.
Since there have been bug (enhancement requests) covering these features forever, I got tired of waiting for someone else to do this. There are already programs that handle these conversions (hdcd.exe and Sox), all that remained to be done was to plug them into SqueezeCenter's audio processing pipeline. Fortunately, the software architect(s) and SlimDevices/Logitech made this pretty easy to do. I'll show you how to install this mod so you too can have HDCD/Preemphasis decoding.
First, here is what the mod can do:
- Processes audio data on-the-fly
- Supports HDCD in either individual tracks or Cue Sheets (FLAC or MAC)
- Applies De-emphasis (for Pre-emphasis in Cue Sheets)
- Deemphasis is applied at 24-bit resolution
- Should work with all Squeezeboxes (haven't tested the Transporter)
- Softsqueeze/SqueezeSlave also work, but are limited to 16-bit
- Supports transcoding down to MP3 (bit rate limited)
(You may have these installed, if you have followed my posts)
- Make sure convwrapper.pl and hdcd.exe are in your Audiotools folder. Note the path to this folder, you will need it in a minute.
- Stop SqueezeCenter (right click on the Windows icon in the task tray)
- Move custom-convert.conf to your SqueezeCenter server directory. This should be "C:\Program Files\Squeezebox\server". However, the path may be slightly different based on the version you are running. To be certain, make sure it is the same directory that contains the file "convert.conf".
- Using your favorite text editor (I like pspad), edit custom-convert.conf. Replace every instance of "c:\local\gdir\Audiotools\convwrapper.pl" with your path. Save your changes.
- Re-Start SqueezeCenter
Now, how do you know it is working?
Whenever you play music that (might) contain either HDCD or has preemphasis applied, the script "convwrapper.pl" will run. You can see this as an extra "perl" process running in Windows' task manager.
If the track in question has HDCD, you will also see an "hdcd" process. However, this program doesn't stick around forever so it is best to check the task manager when the track first starts. Likewise, when you are playing a track with preemphasis, you will see an extra "sox" process running. Other than that, you can let your ears be the judge.
This modification is easy to undo, so you can perform some experiments yourself.
For the curious, how this mod works (skip this if you like):
First of all, let me say up front that I'm no expert on the internals of SqueezeCenter. I've done a few mods, and I only know what I've been able to reverse engineer or read on their forums. If there is detailed documentation about this, I'm not aware of where it is. Any pointers would be appreciated
First, let's look at custom-convert.conf
This file contains SqueezeCenter rules for overriding the transcoding (format conversion). If SqueezeCenter needs to translate a FLAC to MP3, it follows the rules in "convert.conf" and "custom-convert.conf". Here is an example line from this file (for FLAC to FLAC transcoding):
- flc flc transcode *
Note: Cue Sheets are always transcoded (squeezeboxes can play FLAC files natively, but not cue sheets with FLAC files). Therefore, this FLAC-FLAC rule applies specifically whenever we play a cue/flac file on a squeezebox.
Each of the rules in custom-convert.conf represents different cases of transcoding that could involve HDCD or Preemphasis. Feel free to add, modify, or delete these lines as you like.
One more thing. While I added support for Monkey's Audio, it really doesn't work very well with Cue Sheets. Monkey's Audio's command line decoder doesn't support seeking, so it won't allow you to skip tracks. This makes Monkey's audio a pretty poor choice when using Cue Sheets in general. I'm sure this could be fixed, but I prefer FLAC anyway.
Next, let's talk about convwrapper.pl:
This script expects to read uncompressed audio from its' input. Normally, it would also write the audio to it's output. Since the pipeline usually ends in sox, the script takes advantage of this by simply passing an extra command to sox to do the deemphasis. This is why there is a missing "|" after convwrapper.pl's arguments. The last sox process is actually launched by convwrapper.pl.
Convwrapper.pl tests it's input audio to see if it has HDCD. If it does it will apply hdcd decoding prior to writing it's output. Likewise, if the input is a cuesheet, convwrapper.pl will look for the string "FLAGS PRE" and will make sure deemphasis is applied.
- thread from SlimDevices' forum covering on-the-fly decoding
- Older thread started about HDCD decoding
- SqueezeCenter Enhancement request for HDCD decoding
- SqueezeCenter Enhancement request (closed) for Preemphasis handling with cue sheets