This is a companion page to my CM6206 enabler, although it is generally applicable.
Here is a procedure that will give you a reasonable chance of getting surround sound in Mac OS X through a multi-channel USB or FireWire sound card hooked up to an external sound system. The procedure is cumbersome and if you do anything wrong in any of the steps, you will either get no sound at all, only stereo, or horrible noise. Good luck. First, some information to check if you really need and want to go through this ordeal at all.
First a short introduction about how digital consumer surround sound works. In the analog-only era, there were already certain systems like Dolby Pro Logic that rely on ‘multiplexing’ extra channels into a stereo signal by means of phase differences. This has some limitations, but works pretty well nevertheless. Then came digital sound which originally only supported stereo. After a while people wanted to upgrade to surround, and history repeated itself in a certain way.
For many years, digital 5.1 surround has actually been a bit of a clever hack of the existing S/PDIF standard that only supported uncompressed stereo audio. The trick is to compress the six separate channels into a bitstream that is not larger than an uncompressed (so-called PCM) stereo stream of about 1.5 Mbit/s. The compressed stream is then transmitted as if it were a regular stereo stream. Because the transmission is all digital, there is no risk of degradation that could destroy the information in the compressed data. A surround-capable decoder recognises this special stream. Instead of treating it as stereo sound, it interprets it as digital data and decodes it, just like an MP3 player decodes the compressed data in an MP3 file. A decoder that does not recognise the encoding will output a terrible noise because that is what one gets when trying to treat compressed data as PCM sound. The most popular standards for encoding 5.1 audio in a bitstream of 1.5 Mbit or less are Dolby Digital (AC3) and DTS.
There are two very distinct ways to get surround sound out of your Mac (or any computer). The first is to decode the surround stream on the computer itself and send the six (or more) channels of raw audio to a dumb sound card like the CM6206 that has six (or more) outputs. All the card does, is pass the raw decoded audio to the analog outputs, it does not decode anything. These outputs are connected to an amplifier through analog cables. That is the method to which the list of instructions below applies.
The second way is to keep the undecoded surround stream intact and pass it through to a smarter external device like a surround receiver, which then does the decoding to its six (or more) outputs. The most popular way to send the AC3 or DTS stream to external decoders used to be over an optical cable, often called S/PDIF or TOSLink. With the advent of HDMI, it has become possible and common to send the stream over the HDMI cable. To make this work, all you need to do is force your media player to pass through the encoded stream, and ensure that the outgoing ‘audio’ is not altered by a volume control or anything else. If you can change the volume, you must set it to 100%. It should then only depend on the receiving device whether it is capable of decoding the stream or not. The instructions below are unnecessary for the pass-through method. You do not need to bother about Audio Midi Setup when you pass through the encoded stream. Right up to the point where it is decoded in the receiver, this stream looks like, and is treated as, an ordinary stereo stream.
To be honest, if you are serious about hooking up your Mac or PC to a surround sound system, I recommend the pass-through method: buy a standalone 5.1 decoder, connect it through an optical cable (with a 3.5mm jack adaptor if needed), and set up your media player to pass through the AC3 or DTS stream. This will be much less hassle, you do not need to go through the steps below, it will work in more media players, and it will avoid bugs in the few media players that do support multi-channel sound cards. You can also use the decoder with any other hardware device that has an optical output.
If you get loud noise instead of the film soundtrack, you probably configured Plex or VLC to pass through the undecoded 5.1 stream. Make sure to disable this.
Mind that you will, of course, only get surround from material that is encoded as surround. You will not get surround out of an MP3 or an audio CD, unless you have installed some kind of plug-in that can ‘inflate’ stereo sound to surround, if such thing exists for VLC. You can however get ‘faux surround’ by duplicating the stereo signal on the surround channels with something like Soundflower.
Also mind that this is not everything. Even when ignoring possible bugs in your media player that can cause the channels to be incorrectly balanced, to get really correct surround sound you should make sure that the LFE channel (often mistakenly called “Subwoofer” channel) is amplified with +10dB relative to the other channels. Moreover, you should not just send only the LFE channel to your subwoofer. Ideally you should do ‘bass management’, i.e. strip the bass off all other channels that have loudspeakers that cannot represent deep bass sounds, and re-route it mixed together with the LFE to your subwoofer. With some luck, your sound system already does this for you. But even otherwise the above procedure will produce decent surround sound that will be good enough for most people.
These instructions were written for OS X Snow Leopard and Lion, but they should remain valid for future releases unless Apple some day revamps Audio Midi Setup.
A few people have mailed me with the question whether it is possible to feed a 5.1 optical stream to the Mac's input port, decode it in software, and send the outputs to a multi-channel sound card. The answer is: no.
Theoretically it is possible, but nobody has bothered writing software that can do it (anyone that tries to, might have their ass whooped by DTS and Dolby lawyers). If you are looking for a reasonably cheap device to decode an optical stream to multiple analog channels, you can look for the ‘HD Audio Rush’ or ‘Mocha’.