Bit-perfect playback using iTunes and Windows 7 - almost

Discussion in 'Digital Sources' started by tppc, Sep 1, 2012.

  1. tppc

    tppc Dogs know best

    If your favorite audio player is iTunes you probably already know that it can only interface to the Windows 7 audio stack using Shared mode which passes audio samples through the Windows Audio Engine (mixer). Itunes does not yet offer a setting to enable Exclusive mode which passes audio samples unaltered (bit-perfect) directly to the audio device bypassing the Windows Audio Engine and any digital signal processing (DSP) that the engine may perform.

    You can however achieve "near" bit-perfect playback using Shared mode by making a few simple changes to Windows 7 sound settings, and being mindfull of where volume control occurs and of any DSP that may occur in the audio device.

    The Windows settings are accessed through tabs on the Control Panel Sound applet for the given default audio device.

    1. Set level to 100%
    2. Disable sound effects
    3. Set output sample rate = source sample rate
    4. Set output bit depth > source bit depth

    With these settings the Windows Audio Engine will only perform int->float(32)->dither->int processing on the audio samples. There will be no Windows volume or effects processing, no sample rate conversion, and since the output bit depth is greater than the source bit depth, mathematical precision is maintained and truncation distortion is avoided when the float(32) samples are dithered then converted to the output integer bit depth.

    The only DSP that occurs in the audio engine is dithering. It's actually re-dithering since the samples would have already been dithered at some point during audio post production. This gets as close to bit-perfect through the audio engine as is possible using Shared mode :)

    But what about volume control?

    Since Windows volume level for the audio device is set to 100% that leaves volume control in the hands of either the audio player or an external device such as a Preamp or DAC. Since the goal is to maintain near bit-perfect playback (i.e., the only DSP is dither) then the volume control must not perform any DSP on the audio samples.

    The only case where no volume DSP will occur is where the audio player volume is set to 100% and an external analog volume control is used. If however the audio player controls volume or the external device uses a digital volume control then DSP occurs on the audio samples.

    Finally, the device driver and firmware for the audio device (external DAC, motherboard audio chip, sound card, etc) must not perform any DSP on the samples before converting them to analog.

    Chat w/whiteboard on the Windows audio stack from two of the designers: Larry Osterman and Elliot Omiya.

    BACKGROUND: WASAPI Audio Rendering Modes

    Note: all existing Windows audio API's were re-plumbed to go through WASAPI.

    Shared mode: audio is processed by the Windows Audio Engine before being sent to the hardware audio device. The audio engine performs DSP including mixing, enhancement (EQ, bass boost, etc.), sample rate conversion, dithering, and so on. Multiple audio applications can send audio simultaneously through the engine and share the hardware audio device, hense the term "Shared mode".

    Exclusive mode: audio bypasses the audio engine and is sent directly to the hardware audio device. When an audio application enables Exclusive mode, no other application can use the audio device. Exclusive mode is geared for pro-audio applications that perform their own DSP, however it can also be used to achieve bit-perfect playback if (1) the audio player does not perform any DSP and (2) the hardware audio device supports the source sample rate and bit depth exactly and does not perform any DSP before converting the samples to analog.
  2. satkinsn

    satkinsn low end audio Subscriber

    Do you know if the audio stack has changed in Win 8?

  3. tppc

    tppc Dogs know best

    I have not done much digging yet but I would guess that most of the changes in the 8 audio stack are probably along the lines of bug fixes and algorithm improvements. The 7 stack is pretty nice as-is from my experience and I can't envision any major redesign happening. Hopefully though there will be some new audio features in 8 that will benefit Hi-Fi.
  4. tppc

    tppc Dogs know best

  5. satkinsn

    satkinsn low end audio Subscriber



Share This Page