What is "bitperfect", and what do I have to do for bitperfect playback?
An important measure for the quality of a soundcard's SPDIF port is the capability of so called "bitperfect playback" - this term coins the ability to directly transmit sound data through its SPDIF port to a receiver (e.g. a regular home theater amplifier, a custom built DAC, etc.) without having any loss or degradation in the process. An obvious way of testing this is to play some wave file while recording the output signal at the SPDIF port with another soundcard: after synchronization of the played and recorded sound files, a bit by bit comparison of both files should result in no differences if both soundcards are bitperfect.
There are easier ways to test this capability, they require however a receiver capable of decoding ac3 or dts. The basic assumption behind this test is that any kind of audio processing usually alters the ac3/dts frames in a way that corrupts them. The receiver fails to identify damaged ac3/dts frames and plays them like regular PCM audio which make them sound like white noise. By playing ac3 or dts audio embedded into a regular wave file (samples are available here), a playback chain (player software => kmixer/audio service => driver) can be tested for whether or not audio processing takes place: if the chain is bitperfect, the receiver decodes the DTS, and if the chain isn't, the receiver plays white noise.
Most consumer grade soundcards aren't bitperfect by design: some sound hardware may be limited to only one sample rate to the effect that sound processing is mandatory (sample rate conversion in this case), in other soundcards' drivers there are annoying "features" which can't be fully disabled (e.g. karaoke, fake 3D sound, "crystalizer" and alike). The latter applies to the C-Media based soundcards: while the hardware is fully capable of bitperfect playback at a multitude of sample rates, all versions of the official driver process the sound. Some versions even cripple the sample size of the sound data from regular 16 bit down to 14 bit which results in a hefty loss of dynamic range (roughly estimated from 96dB/16 bit to 84dB/14 bit).
In the professional grade market, customers expect their soundcards to be bitperfect for obvious reasons, and the drivers are specifically engineered for this. These soundcards often come laden with other features which are pretty much useless in a regular home theater/HiFi environment (e.g. multitrack recording). Moreover, they're manufactured in much smaller volume than consumer grade soundcards, hence their pricetag is usually tenfold or even more of what a regular consumer soundcard costs.
So in essence, in the past there have been only two options for the audiophile user: either accept the deterioration of sound quality induced by the driver's processing, or bite the bullet and buy an expensive professional grade soundcard. Not anymore: after reading the specs of a C-Media chip, I decided to write my own driver from scratch which completely avoids processing. It is compatible to C-Media based soundcards which are widely available for a mere 20 US$/€. The result is a slim and sleek driver which runs on all major Windows operating systems. It supports bitperfect playback for 16 bit sound streams at sample rates of 44.1kHz, 48kHz, 88.2kHz and 96kHz - this effectively covers almost all music on CDs and subsequent formats as well as audio from DVDs on sale today.
On the software side, there are some more obstacles: in order to play multiple sounds simultaneously, a so called "kmixer" / "kernel audio mixer" (XP, 2000) respectively "audio service" (Vista) which is part of the sound subsystem of Windows mixes them together and adjusts the volume of the resulting stream. Contrary to popular belief, the kmixer of Windows 2000 and XP doesn't modify the sound and is thus bitperfect if these four conditions are met: 1. The PCM/wave volume slider of the mixer (sndvol32.exe) must be set at its maximum. Some start-up applications modify the volume slider (e.g. hardware monitoring tools from Asus). 1. The player must be compiled for the same architecture that the OS was compiled for - e.g. 32 bit player on a 32 bit OS, 64 bit player on a 64 bit OS. This is the case for the vast majority of installations because the 64 bit version of Windows XP isn't very commonly used. 1. Applications other than the player mustn't play sounds, otherwise the two output streams will be potentially sample rate converted and mixed. 1. Applications which are using the soundcard for recording have to use the same sample rate as concurrently running applications which are playing sounds - the soundcard has only one clock generator and hence this limitation arises.
Most parts of the sound subsystem of Windows XP/2000 including the kmixer run in the privileged kernel mode, and this poses a security threat because most drivers are badly written with regard to security. The sound subsystem has thus been completely rewritten for Vista so that most parts, including the audio service which provides the functionality of the kmixer, runs in user mode. Also, they've changed the internal format which is used for audio processing from 16 bit integer to 32 bit float. A sample size of 16 bit is commonly used on most media, but it's difficult to handle when it comes to audio processing. The new 32 bit float audio engine of Vista processes multiple audio streams a lot better with regard to audio quality than the old 16 bit kmixer of XP/2k. Unfortunately though, Vista's reimplementation apparently doesn't disable the sound processing when it isn't needed to the effect that the audio service is not bitperfect anymore - audio processing happens on all the sound data when the application uses only standard interfaces like DirectSound/MME (with the exception of DD/dts passthrough).
For some users, it may be therefore necessary to bypass the kmixer/audio service alltogether for bitperfect playback. This can be done in either of these two ways: 1. Kernel streaming - this interface has been implemented to 2000/XP/Vista in response to Steinberg's ASIO. Applications which use this interface instead of DirectX/MME bypass the kmixer. In Vista, the kernel streaming interface has been marked "deprecated", and it doesn't work with WaveRT versions of the driver, but it can be used with non-WaveRT versions. There are output plugins for all the popular players, namely WinAMP and foobar2000. 1. WASAPI - a new interface which appeared first in Vista. Applications which utilize its "exclusive mode" have bitperfect access to the soundcard's driver. This works with both the WaveRT and the non-WaveRT version. Recently, a plugin for foobar2000 has been released: http://www.foobar2000.org/components/
If you have any comments or questions about the above topics, feel free to drop me an email or use the comment system below.