Bug - jack detection on Windows 7 hdaudio.sys mixed capture

Bug - jack detection on Windows 7 hdaudio.sys mixed capture

  • Comments 5

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.

  1. 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
  2. The first state change (plug or unplug) after a reset works
  3. 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.

Leave a Comment
  • Please add 4 and 2 and type the answer here:
  • Post
  • Can't you just disable jack detection?

  • Sure.

  • I have been creating a program to send and get the responses for Intel HDA verbs and params. The "get" verbs work well, however the first set verb I tried - reset (mentioned aboved) - fails (the response is all 0s, including the "valid" bit). When trying the HDA Utility program it reports that the "chk" driver is necessary for setting. What is this driver?

    On a related note how does a program receive unsolicited responses after enabling them?

    Thanks!

  • chk versions of Windows (including hdaudio.sys) are available via MSDN subscription.

    I don't know whether the HD Audio driver will relay unsolicited responses up through the debug interface; I suspect not.  You might need to write a custom HD Audio function driver to capture those.

    What is your scenario where you need to see the verbs directly?  If you like you can email me privately: mateer at microsoft dot com

  • My original plan was to make an app like all the custom ones that audio driver providers ship with their drivers, but much more stream-lined (all of those usually are overly graphical, etc). I understand that the Sound control panel does many of those things. I also wanted to be able to do automated things based on pin events (pin connect / disconnect).

    I haven't got anywhere near that far and for the moment I am instead working on a program similar to HDAU just to be able to see all the data that is there.

Page 1 of 1 (5 items)