MCE-Pro | Media Center building and customisation

Asus Xonar DX and the Dolby Digital dilemma…. Our solution

When we took a look at the Sapphire Radeon HD 5570 recently we also mulled over the usage of the Home Theatre as a gaming platform in general. One area which we didn’t touch upon in that piece which has proved a weakness for some is audio.

For most gamers this isn’t a big issue, surround sound devices are connected by multiple stereo audio jacks or in the case of some headphones, USB. But with a Home Theatre set up there’s a good chance you’ll want to connect your system to a separate receiver over TOSLINK or Coaxial S/PDIF – this is where problems can arise.

S/PDIF was originally designed to carry uncompressed CD audio data from CD players to a receiver, with just 2 channels. The capabilities were later expanded with support for Dolby Digital and DTS surround sound encoding. To take advantage of these however you need an encoded audio source. Windows is able to pass-through encoded audio to a digital output, but it can’t create its own.

The ASUS Xonar DX

On paper the ASUS Xonar DX could well be just what the Doctor ordered, bringing Dolby Digital Live to a half height, PCIe 1x package with TOSLINK output.

Optical out is provided by a small adaptor that fits into the dual purpose optical and stereo jack connector.

We configure ASUS’s control panel to use (in our case) 6-channels and Dolby Digital Live over S/PDIF. Some of the other cards in ASUS’s Xonar range also provide support for DTS Interactive encoding, but the DX does not.

The problem…

Dolby Digital Live gives you the ability to take a real time 5.1 audio stream and encode it as Dolby Digital which Windows can then send on to the receiver over S/PDIF. This is done by presenting the device to Windows as an analogue 6 channel device, encoding the incoming audio stream to Dolby Digital, and transmitting it to the receiver.

This works great for games, giving surround sound as opposed to the stereo output provided by on-board audio over S/PDIF, but also causes some big problems for Home Theatre users.

Since Windows now sees your default audio device as an analogue High Definition Audio device it’s unable to pass-through the Dolby Digital or DTS streams from sources which already include it such as DVDs or Blu-rays.

Windows Media Player 12 allows you specify output through an audio device other than the default, allowing it to pass-through the digital audio stream correctly, but Windows Media Center does not use this setting. Likewise changing the output setting in Windows Media Center’s speaker settings simply changes the Default Device.

Our solution

You can of course change the Default Device between High Definition Audio and S/PDIF, but for a HTPC with combined gaming and media usage we want something a little more seamless, so we’ve created a small application for automatically managing the default device.

This works by monitoring the currently active window and comparing it to a ‘white list’ of window names, such as “Windows Media Center” or “ArcSoft”, for applications we want to pass-through encoded audio. If the window is on this list the application will switch the Default Device to the first device in the configuration file, which should be set to correspond to the S/PDIF output. If it’s not on the list it will switch the Default back to the HDA device.

The application itself is fairly simple; written in AutoIT and consisting of just 70 lines of code it works simply by opening the Playback Devices options, positioning it off screen, and polling the active window title every 1/5th of a second, changing the Default Device as necessary.

The first line represents the S/PDIF device in the Playback Devices to be used for white-listed applications, the second the HDA device. Any subsequent lines give white-listed window titles. These start with device 0, so in the case of our example screen shot the S/PDIF would be 1, and the HDA would be 0.

Download Auto Output Device Switcher

This application is provided for free, all we ask is that if you find it useful please click one of our Google adverts. We would also like to ask that users please refrain from hot-linking and instead link directly to this page as the download location may change but this page URL will not.

This was written for the Xonar DX it should also work correctly with other cards in the Xonar range, or indeed any other cards which suffer from this issue as it is entirely hardware independent. While it should not cause any harm to your system we obviously cannot offer any support or guarantees, although we are interested in hearing any feedback, positive or negative, via email or comments.

Some anti-virus software has been known to flag up AutoIT applications so please be aware of this. The source code for the application is included in the package and you are free to modify this as you wish.

Update – 07/04/2010

We have updated the device switching tool, renaming it to Auto Output Device Switcher and adding a configuration tool.


Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Comments are closed.

Theme Design by devolux.nh2.me