C-Media CM6206 Enabler for Mac OS X v2.1
by Alexander Thomas (aka Dr. Lex)
This is a small program that activates the analog and S/PDIF outputs on USB devices that are based on the C-Media CM6206 multi-channel sound chip (sometimes also referred to as CMI6206). One of the common cheap devices sold on eBay that uses this IC can be seen in the photo at the right. It's a 5.1 device but the IC supports up to 7.1 audio. The one I bought had a serial number “29776659” but there are other products that use this IC. Some major brands also use this chip, for instance Zalman uses it in their ZM-RS6F USB headphones. The Sweex SC016 is also based on the CM6206, as is the Diamond XS71U.
The CM6206 chip is a fully compliant USB audio device that should work as-is on any modern operating system without requiring drivers. At first sight it does work: the sound card can be selected in the audio control panel and the 6 or 8 channels can be assigned using Audio MIDI setup. But there is no sound output. The same symptoms occur in Windows until the C-Media driver is installed. Apparently the device boots with its outputs disabled, and the only thing the ‘driver’ does is send some specific configuration requests to enable both the analog outputs and the optical S/PDIF.
Therefore I started gathering information: I used a USB sniffer to look at the packets sent to the device in Windows with and without the driver installed, and I found some useful clues in the Linux ALSA driver source code and mailinglist. Combined with some sample code from the XCode Developer kit, I managed to create a simple program that sends the crucial packets, enabling both the analog outputs and the S/PDIF. So there you have it, surround sound on your Mac for the price of a cheap USB audio card on eBay — with some caveats however. Mind that turning on the outputs is all this enabler does. All the rest is the task of your operating system. If your system does not recognise the sound card, it is not this enabler's fault.
The first version of this program had to be run manually, but thanks to a donation by Mark Hempelmann I was motivated enough to turn it into a fully automatic daemon. All you need to do is run the installer and reboot, and your sound card should work. With that I mean you should get sound from it, but whether you can get surround from it depends entirely on whether your OS X sound settings are properly configured.
You need OS X 10.5 or newer to make this work. It should work in 10.8, unless perhaps you enabled GateKeeper. The program is theoretically able to run on OS X 10.4.x, but I have so far been unable to connect to the CM6206 in OS X 10.4.11, and I assume any lower version will fail too. For some reason unknown, all interfaces on the device are “in use” (error e00002c5) no matter what I try. If anyone has a clue how to fix this, I'm interested.
OS X 10.7 ‘Lion’ has a bug that requires the sound card to be connected at the moment the computer is booted or woken from sleep. Otherwise it is not available as a sound device. There is nothing I can do about this because it has nothing to do with the enabler. It seems to be caused by a quirky USB or audio driver in the operating system itself and will hopefully be fixed in an upcoming Lion update. Do not unplug the sound card once it works, or you will have to reboot/wake again after plugging it back in.
If you want to uninstall the enabler, all you need to do is delete the following two files:
/Library/Application Support/CM6206 /Library/LaunchDaemons/be.dr-lex.cm6206init.plist
The source code (44kB) is also available. If someone feels like it, it could be extended to a GUI that allows to control specific aspects of the CM6206, like enabling stereo or bias voltage on the microphone input.
Setting up surround sound
Unfortunately, at the time of this writing it is still quite a hassle to get surround sound properly set up on OS X. Therefore I made a checklist of what you should do to get 5.1 sound out of any multi-channel sound card.
To test if all channels work, you can download an AC3 test sound below. I recommend VLC to play the file, as it's the only player I currently know that properly assigns the channels, although you may also have success with QuickTime combined with Perian. The following file can also be used to roughly calibrate the volumes if you're using a mixed set-up, although I noticed that for many films the rear speaker volume needs to be readjusted for reasons unknown*. Mind that for movie soundtracks you also need to apply a +10dB boost to the LFE channel to bring it at the correct level.
Download 5.1 channel test file (zip archive, 145KiB)
*: I suspect that AC3 streams can specify a relative gain for the rear/center channels, and that VLC ignores this gain when decoding the stream, but I can be wrong about this. At any rate, this issue as wel as the lack of multichannel sound card support in Plex, annoyed me enough to get a proper 5.1 decoder connected through S/PDIF, so I'm currently not using the cm6206-based sound card anymore.
Many people seem to be confused about the difference between sending surround sound as passthrough (through S/PDIF) and playing it as six or eight separate channels. As I have explained elsewhere, these are two entirely different situations. With this specific sound card you can do both, although on a regular Mac you can also perform passthrough without this card: simply use a tiny 3.5mm adaptor to connect a Toslink cable directly to the built-in line out port.
The CM6206 is not able to decode AC3 or DTS streams. It is a simple sound card with 6 or 8 output channels and a few input channels. Plugging an optical cable into the S/PDIF input if your card has one, will not cause decoded audio to come out of the outputs, nor can you get multi-channel output by sending an encoded 5.1 stream from your Mac. The software you use must support built-in 5.1 decoding to get multi-channel output out of your sound card. For instance VLC supports this, but at the time of this writing, Plex does not.
Do not expect to get surround from stereo material. An application must address all six or eight output channels to produce output on all speakers. When playing stereo sound, i.e. what almost every normal Mac application like iTunes produces, only your front left & right speakers will be used, not even your subwoofer unless your sound system has bass management — which it probably doesn't unless it is high-end. There are ways to get upmixing in MPlayer and even system-level upmixing by using Jack, but neither methods are really practical. Soundflower should also allow this in an easier way. All these solutions will however produce ‘fake’ surround, they will only replicate channels to put more of your loudspeakers to use. Getting plausible ‘real’ surround from stereo requires complex processing and is far from trivial.
More about the S/PDIF (Toslink) output: as far as I can tell, the CM6206 only supports 8 output channels, and on most cards only 6 of those are connected. There is no separate S/PDIF output channel, which is why you won't see it in the OS X control panel or Audio Midi Setup. The S/PDIF can only be turned on and off and is just a hardwired copy of the signal that goes to the Front channel. You can get AC3/DTS passthrough by configuring your media application to pass through the undecoded 5.1 stream. This makes the card's S/PDIF only really useful on a ‘hackintosh’ that doesn't have a built-in S/PDIF, because on a real Mac it's much simpler and cheaper to use the Mac's built-in S/PDIF through a 3.5mm jack adapter.
To be honest, I do not recommend this kind of sound card to anyone who wants to get hassle-free surround sound on their Mac. These cards are most useful to people who want multiple sound channel output for special applications. But for simple 5.1 sound they are a pain in the ass because only few programs support them, and the ones that do often have bugs. If you want to connect your Mac to a surround system and you are doubting whether to buy either a multi-channel card like this or a stand-alone surround decoder connected through S/PDIF, I can only recommend the latter. A stand-alone decoder will work without having to fiddle with complicated system settings or tweaking volume knobs with every new film you watch. On top of that, it has the added advantage that it will work with any other device that has an S/PDIF output.
- 1.0 (2009-06-11): Initial release.
- 2.0 (2011-01-31): Converted to daemon, added installer.
- 2.1 (2011-02-24): Prevented the program from delaying the computer while going to sleep.
- 2.1 (2011-04-09): Fixed permissions problem in installer.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
I am in no way affiliated with C-Media or the manufacturer of your specific sound card. This is just a hobby project.