Monthly Archives: February 2009

Bit perfect audio with Linux and mpd

What is bit perfect sound?

Bit perfect sound is about sending the exact bits from a sound file to a digital to analog converter without re-sampling.  Think of it as dumping the bits directly from a (decoded) file to the digital output of your sound card.  In both Windows and Linux, this not the default behavior.  In many cases, all digital audio is re-sampled to 48KHz before being sent out the digital output or to the onboard DAC.  On Windows the culprit is KMixer and on Linux it’s ALSA’s dmix.

Why is this important?

To be honest, it isn’t unless you’re one of those people that is obsessive about getting the absolute best sound possible.

OK, I’m one of those people, what do I need?

I’ll describe the basics of what you need for a Linux based setup.   If you want information on doing this on Windows, go here:   http://www.mp3car.com/vbulletin/faq-emporium/88852-faq-what-bit-perfect.html

If you’re like me and you think in pictures, this is what we’re doing.

setup

Ok, here are the words.

Hardware

1.  A sound card capable of bit perfect output.

This is the trickiest part.  The good news is that most of the cards that are capable are cheap no-name brands.  If you have an Audigy or something like that, throw it out.   Also, I didn’t have any luck getting any of the Intel HDA or AC97 codec based cards to work.   These are common with onboard audio.  The most widely available bit perfect capable cards are VIA Envy24HT cards and Cmedia (CMI) 8738/8768 cards.

Check here for a list of CMI cards:  http://code.google.com/p/cmediadrivers/wiki/SupportedDevices

I personally use this one:  http://www.tigerdirect.ca/applications/SearchTools/item-details.asp?EdpNo=3180419&Sku=D15-9060 (Diablotek 7.1 Tremor Digital Optical Sound Card – $30.99 CAD). I’ve successfully used it for 96KHz/16bit audio.

If you want to check if your current card supports bit perfect sound, the best way I’ve found is to use the ‘speaker-test’ application that should come standard with alsa.     For example:

44.1KHz/16 bit:

speaker-test -c2 --device cards.pcm.iec958 --rate 44100 --format S16_LE

96KHz/24 bit:
speaker-test -c2 --device cards.pcm.iec958 --rate 96000 --format S24_LE

If you get the following message, it means that your hardware doesn’t support the bit or sampling rate.

Setting of hwparams failed: Invalid argument

2.  A good outboard Digital to Analog converter.

There are tonnes of good DACs.  Some are cheap, some are not.  If your preamp or receiver has digital inputs, you probably don’t even need one.

I personally use this DAC:  http://www.obadimports.com/catalog/item/4377355/4684274.htm

(“DAC In the Box” Super Pro – CS-4398 24-192khz, $79.99 CAD)

3.  A decent stereo system.

Specifically, you should buy an Arcam FMJ and ScanSpe… yah just kidding.  Get whatever you want.

Software

As shown in the picture above, I use mpd (Music Player Daemon).  It has a clients for every platform and works quite well if your music isn’t tagged consistently.

Only a slight modification to /etc/mpd.conf is required.

audio_output {
        type                    "alsa"
        name                    "SPDIF"
        device                  "cards.pcm.iec958"
}

Restart mpd and away you go!   One small warning about the configuration above.  Specifying the hardware device directly like this will shanghai the sound system and no other systems sounds will be heard while mpd is playing.   Other applications may even hang if they try and play sound.   Flash player is one example.

Veneering with paper-backed veneer and wood glue

I put this together based on using materials you can easily find in Canada.  I got everything at Home Depot except the veneer which I got from Lee Valley, however I’m sure I’ve seen Cedan veneer elsewhere.  This was my first veneering job ever and basically the first time I ever used a router, so you don’t have to be an expert woodworker to do this.

You can’t be in a hurry to do this either.  This process took a couple of days.  I’d highly recommend only doing one side at a time.  I did the bottom, sides, top, back and then the front in that order.  Ignore the driver, cup and port holes.  That gets done last.

Here is what you need:

  • Paper backed veneer (Lee Valley 41A05.24 – http://www.cedan.com)
  • Sponge brush
  • Elmer’s PROBOND glue (I think this is PVC glue)
  • Green painters tape
  • Very sharp utility knife or scissors
  • Router with flush trim bit and a rabbeting bit if you countersunk your drivers
  • 150-200 grit sand paper
  • Iron (the kind use to iron clothes)

Supplies

1. Cut the veneer to the desired size.  You’ll want about 1/2 inch of overhang on each side.  I used sharp utility scissors to cut the veneer sheet.

2. Tape the veneer down to a flat surface.  I used a piece of lexan I had kicking around.

Veneer taped down to a piece of lexan

3. Mask any veneer already applied to the speaker.  Avoid getting glue on the finished side of the veneer.

Masked

4. Apply a thin layer of glue to both the MDF and the back of the veneer using the sponge brush.  Make sure you get right to the edges.  You’ll want to mix a little bit of water into the glue just to make it easier to brush on.  Some recipes call for a 10:1 glue/water mix.  Mine was more like 20:1.  Not enough water is better than too much.

Spread it as thin as you can on each surface while still having a nice even coat.

Glue on the box

dscf0015veneer

5.  Let it dry for about 50-60 minutes.  I got the best results when the glue was just dry enough so it didn’t stick to my finger.

6.  Heat up your iron.  Put it on the highest non-steam setting.

7.  Carefully place the veneer on the box.  Since the glue is still wet, the two surfaces will stick together right away.  I never had to, but it might be tricky to reposition the veneer once the two surfaces touch.

8.  Put a thin cotton sheet (pillow case, dish towl, etc) on top the veneer and iron the veneer on.  Apply quite a bit of pressure to make sure the veneer flattens out nicely.  Make sure you get the edges nice a flat.  There shouldn’t be any bubbles whatsoever.

9.  Let the glue dry for another hour, then use a flush trim bit on your router to trim off the excess.  If you have a steady hand, you could probably use a utility knife, but a router works so much better.  Lightly sand off any jagged edges left by the router.

10.  Repeat for each side.

FrontBack

When doing the driver and cup holes, drill a pilot hole in the veneer big enough for your flush trim bit and then trim the hole.  To do the counter sink, use the exact same rabbetting bit that was used to make it.

For a better explanation of this trimming process, see this page:  http://www.speakerbuilder.net/web_files/Articles/ventut/ventutmain.htm

It’s been two years since I did these boxes and there is no sign of the veneer coming off or cracking!

Zaph’s Inexpensive Mini MTM build

These speakers were built in the summer of 2008.  The design is very old and Zaph no longer distributes it, but I had the parts and the plans around.   After almost 15 years of building speakers, this was basically my first really successful speaker project.

This design is based on the MCM 55-1855 5″ midbass and Seas 27TFFC tweeter. I used Bondo and drywall compound to fill cracks and edge seal. The finish is 3 coats of sealing primer, Rustoleum Painter’s Touch Dark Grey, and some Rustoleum clear gloss.

Just a note about this project.  Please don’t email me asking for the plans.  I’d like to help you out, but they aren’t mine to distribute.