[wdmaudiodev] Re: audiodg.exe hangs while system is shutting down on Windows 8.1

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 23 Jul 2014 13:19:42 +0000

Hmm…. can you create a dump file of audiodg.exe in the hung state, and send it 
to me off-list?


1.       Set the DisableProtectedAudioDg registry key as described here: 
http://msdn.microsoft.com/en-us/library/windows/hardware/ff538609(v=vs.85).aspx

2.       Reboot (or just net stop audiosrv and net start audiosrv) so the key 
change takes effect

3.       Get into the hung state (net stop audiosrv should take the place of 
shutting down so you can still interact with the computer)

4.       Go into Task Manager | More details | Details | Find the audiodg.exe 
process | Right-click | Create dump file

Symbols for your APO .dll would also help.

From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Dhaval Kavar
Sent: Tuesday, July 22, 2014 11:48 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] audiodg.exe hangs while system is shutting down on 
Windows 8.1

Hi All,

We are developing an APO for Input devices.

For echo cancellation, we use Loop-back feature and we use similar method as 
described in: 
http://msdn.microsoft.com/en-us/library/windows/desktop/dd370800%28v=vs.85%29.aspx

To capture the render audio data, we have a thread in APO.

We are facing issues on Windows 8.1 OS (both 32bit and 64bit) that happen in 
below use case:
a. Start Windows Sound Recorder. This will load our Input APO (MFX on Windows 
8.1 or LFX on Windows 7) in memory under audidg.exe.
b. Shutdown the Windows OS.

When system is getting shutting down, input APO gets APO::UnlockForProcess and 
then we make a call to IAudioClient -> Stop method. But, IAudioClient -> Stop 
method hangs! This is issue 1.

IAudioClient -> Stop executes in a capture thread and we wait for the thread to 
complete its task. Because capture thread is already in hung state 
WaitForSingleObject on thread handle times out. Then we release the objects 
that we hold and IAudioCaptureClient -> Release hangs too. This is issue number 
2.

Some consequences that we saw on above hangs are as follows:
Because audiodg.exe is in hung state, System does not shutdown properly and 
"System" process (process ID: 4) makes the system to Sleep. We observe this 
behavior via Event Viewer application where we can see an Event ID 42 is added 
with "The system is entering sleep. Sleep Reason: Application API" description.

When we start the machine again, it starts in the same state where audiodg.exe 
is in hung state! So, we cannot use input or output device anymore unless we 
kill audiodg.exe and restart the audio services again.

More analysis:
We saw that when we make IAudioClient -> Stop method call, IAudioSessionEvents::
OnStateChanged -> AudioSessionStateInactive gets called on Windows 7 while 
system is shutting down. But, same method does not executed on Windows 8.1!

Any help or idea on how to solve these issues would be much appreciated.

Regards,
Dhaval

Other related posts: