Monday, June 22, 2009 2:47 PM
Maurits
Bug - jack detection on Windows 7 hdaudio.sys mixed capture
There's a bug that got away from me in Windows 7's HD Audio class driver (hdaudio.sys.)
Before I explain the bug, a few caveats:
If you're using Vista, there's no problem. This only affects Windows 7.
If you use the third-party audio driver, there's no problem. This only affects the Microsoft HD Audio class driver (hdaudio.sys.)
If your recording devices (mic and line in) are independent (can capture from both at the same time) or muxed (can capture from one or the other but not from their sum) then you're fine; this only affects mixed capture (can capture from one, from the other, or from their sum, but not from both sides of the mix independently.)
If either of your recording devices doesn't support jack presence detection then you're fine; this only affects mixed capture where both sides of the mix support jack presence detection.
Here's the bug.
- There are various ways to "reset" the system and bring the OS recording device state into synchronization with the hardware state
- reboot
- reset the HD Audio controller
- reinstall the audio driver
- restart the AudioEndpointBuilder service
- unplug all recording devices in the mix
- The first state change (plug or unplug) after a reset works
- The second and further state changes are not recognized by the OS until a reset.
Here's a sample state diagram assuming a mixed Mic and Line In (click to view full-size:)

Workarounds:
Install the third-party audio driver instead of the HD Audio class driver.
Use audio extension cables to fool the jack presence detection hardware into thinking something is always plugged in.