C-Media CM6206 Enabler for Mac OS X v2.1
by Alexander Thomas (aka Dr. Lex)
What is it?
This is a small program that activates the analog and S/PDIF outputs on USB devices that are based on the C-Media CM6206 surround sound chip (sometimes also referred to as CMI6206). One of the common cheap devices that uses this IC and that's sold on eBay 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 sticker with a serial number “29776659”, but there may be other devices 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.
The problem with the CM6206 chip is that it does not produce any audio output at all when plugged in. It behaves like a fully compliant audio device, it 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. 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.
Download
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.
Download the cm6206 enabler (zip archive, 37kB)
You need OS X 10.5 or newer to make this work. 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.
It works under 10.7 (Lion) but you may need to reboot or wake-from-sleep with the device plugged in to get the OS to recognize the sound card. Do not unplug the device once it works or you'll have to reboot/wake again. This seems to be caused by quirky device support in the operating system itself and will hopefully be fixed in an upcoming Lion update.
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.
Caveats
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 doesn't.
Also, 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 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 and will only produce ‘fake’ surround.
More about the S/PDIF 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.
Version history
- 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.
Disclaimer
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.