Saturday, October 16, 2010

Music in the Theater

Now that I have a nice home theater with a wonderful sound system, I like to use it for more than just watching movies. I don't have an extensive music collection: about 375 discs containing around 3400 tracks. But I really like what I have, and I find this music most enjoyable when it is being reproduced as accurately as possible. It is nice to be able to listen to a symphonic performance and feel as if I was there. It's great to listen to a jazz recording and be able to aurally place each instrument and voice. And of course I like the driving bass I hear from my collection of rock music.

When I listen to music at my desk, in the family room, or when I am out and about I'm not very concerned about the quality of the reproduction. The environment just isn't well suited to fine-tuned listening. So I've been content with mp3 recordings played either on an iPod or through my computer. But once I had the theater finished I knew I would want something better. Ultimately I would like the music to sound exactly the same as if I was playing it directly from the CD. This requires two things: bit-perfect playback and gapless playback.

It might surprise you to learn that the mp3 format does not provide either one of these characteristics. Its "lossy" compression means playback isn't bit-perfect, and limitations in the format require padding at either end of the track which can leave an audible gap between tracks. The lossy compression may only be noticeable in an environment designed for "fine" listening, but the playback gaps are very noticeable on recordings of live performances or any recording where sound or music is continuous across several tracks. Some may not care but hearing these gaps really annoys me.

Fortunately there are encoding formats other than mp3. I chose to use FLAC (Free Lossless Audio Code) which uses a lossless compression and provides for gapless playback. This required re-ripping all my discs, but it was worth the effort and didn't take nearly as long as I had thought.

So with the format chosen I had to find the right tools for ripping and for playback. Since an iPod won't play FLAC files I also had to provide for conversion of my collection from FLAC in to mp3. I have a PC running Windows which provides all the automation for the theater. With a 500GB disk and plenty of spare cpu cycles it was an easy choice for my music server. But in order to make the music accessible elsewhere I also copy the files over to the house file server, a PC running Linux with 500 GB of mirrored storage.

Discs are ripped on the music server using Exact Audio Copy (EAC). EAC uses multiple techniques to ensure an error-free read.

Audio files are played back on the music server using Media Monkey. I can't say enough good things about Media Monkey, but I will say as many as I can in a separate post.

Audio files are copied over to the file server using a utility called rsync. This is a tool borrowed from Unix and ported to Windows as part of the project cygwin.

The file server contains both FLAC and mp3 copies of every track. Conversion from FLAC to mp3 is done with a script written in Ruby which runs a FLAC decoder and an mp3 encoder called "lame" for each file.

The end result is two copies of my FLAC files: one on the music server and one on the file server's mirrored storage. The data is very well protected. I also have a separate mp3 copy of my collection for use on iPods and other devices that can't play FLAC.

The music server is connected to my theater's sound system using the on-board sound card. Unfortunately a lot happens to the music between Media Monkey and the sound card's output. So for now I still don't have bit-perfect playback. I have a device on order that will fix this problem by providing digital output that I can feed directly in to my receiver. More on that when I get it working in my theater.

No comments: