C-Media CM6206 Enabler for Mac OS X

by Alexander Thomas (aka Dr. Lex)

What is it?

USB 5.1 audio deviceThis 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 problem with the CM6206 chip, at least the one used in the device I bought, 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 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.

So 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

Mind that this is the most braindead solution to this problem possible. It's not a driver, nor a neat GUI-based program. It's a simple command that needs to be executed in a terminal. If there's enough demand, I may try to convert it to something that invisibly runs in the background as a driver.

Download the cm6206 enabler (zip archive, 15KiB)

To use it, first plug in your CM6206-based audio device, then run the program.
If you have no idea how to use console commands, don't worry. It seems that in the latest OS X versions, one can simply double-click executable files. If not, you can still easily make the program double-clickable. Just rename it to “cm6206init.command”. If you then double-click it, it should open in Terminal and run.

Mind that you will need to re-run the command after your Mac wakes up from sleep. You can automate this with SleepWatcher if you have some UNIX scripting knowledge.

It seems you need OS X 10.5.x or 10.6.x to make this work. The program runs on any OS X version starting from 10.3.9, 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.

The source code (18KiB) is also available. Feel free to enhance it or turn it into a proper USB device driver. Next to making the thing more user-friendly, there are some other things that could be improved, like enabling stereo or bias voltage on the microphone input.

Setting up surround sound

Unfortunately, at the time of this writing it's still quite a hassle to get surround sound properly set up on OS X. Here's a checklist of what you should do to get 5.1 sound out of any USB sound card.

  1. Log in using an administrator account. Otherwise OS X will silently ignore any changes you make to the multichannel setup.
  2. In the Sound control panel, select the USB audio output device.
  3. Open the ‘Audio Midi Setup’ program in your Applications/Utilities folder.
  4. Select the USB card as output device and set the sampling rate to 44100 or 48000 depending on the rate of the audio you want to play (for a movie it's most likely 48k).
  5. Set the number of channels to 6 (6ch-16bit).
  6. Click ‘Configure speakers’ and choose “5.1 surround”. You can click the buttons to test each speaker, but mind that the test sound is an awfully loud noise. It's better to use the method described below.
  7. In your media player (e.g. VLC), you may also need to select the USB audio device as output device.

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 movies, the rear speaker volume needs an additional boost for reasons unknown*. Mind that for movie soundtracks you'll 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.

A note 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 built-in S/PDIF through a 3.5mm jack adapter.

Version history

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.