locked
Wasapi: IAudioClient->Initialize() hanging when opening audio capture device

    Question

  • I'm trying to open the capture/input audio device. I call ActivateAudioInterfaceAsync() , then when I call IAudioClient->Initialize() on the capture device, the app hangs, supposedly because for some reason it's trying to display the 'Allow app to use the mic?' prompt.

    The hang _doesn't_ occur if I manually set the app permission to use the mic (i.e. launch the app without having it open the audio devices, open the permission tile, activate the mic permission).

    Calls to ActivateAudioInterfaceAsync and  IAudioClient->Initialize() are made from the UI thread (the one that receives callbacks for buttons, which on Metro style apps seems to be different from the thread that starts the application, i.e. WinMain).

    What am I doing wrong?

    I've attached the stack that shows the app hung below.

    Thanks,

    Flavio.

                                                

    ntdll.dll!_NtAlpcSendWaitReceivePort@32() Unknown
    rpcrt4.dll!LRPC_CASSOCIATION::AlpcSendWaitReceivePort(unsigned long,struct _PORT_MESSAGE *,struct _ALPC_MESSAGE_ATTRIBUTES *,struct _PORT_MESSAGE *,unsigned long *,struct _ALPC_MESSAGE_ATTRIBUTES *,union _LARGE_INTEGER *) Unknown
    rpcrt4.dll!LRPC_BASE_CCALL::DoSendReceive(void) Unknown
    rpcrt4.dll!LRPC_BASE_CCALL::SendReceive(struct _RPC_MESSAGE *) Unknown
    rpcrt4.dll!LRPC_CCALL::SendReceive(struct _RPC_MESSAGE *) Unknown
    rpcrt4.dll!_I_RpcSendReceive@4() Unknown
    rpcrt4.dll!_NdrSendReceive@8() Unknown
    rpcrt4.dll!@NdrpSendReceive@4() Unknown
    rpcrt4.dll!_NdrClientCall2() Unknown
    AudioSes.dll!_AudioServerCreateStream@36() Unknown
    AudioSes.dll!CAudioClient::CreateRemoteStream(enum SYSTEM_AUDIO_STREAM_TYPE,__int64,__int64,struct SYSTEM_AUDIO_STREAM *) Unknown
    AudioSes.dll!CAudioClient::Initialize(enum _AUDCLNT_SHAREMODE,unsigned long,__int64,__int64,struct tWAVEFORMATEX const *,struct _GUID const *) Unknown

    Metro.exe!App1::MainPage::Startup() Line 171 C++
    Metro.exe!<lambda_f0ad93afb1643234338c56b595dca446>::operator()() Line 48 C++
    Metro.exe!Platform::Details::__abi_FunctorCapture0<<lambda_f0ad93afb1643234338c56b595dca446>,void>::Invoke() Line 850 C++
    Metro.exe!Windows::UI::Core::DispatchedHandler::Invoke() C++
    Metro.exe!Windows::UI::Core::DispatchedHandler::[Windows::UI::Core::DispatchedHandler::__abi_IDelegate]::__abi_Windows_UI_Core_DispatchedHandler___abi_IDelegate____abi_Invoke() C++
    Windows.UI.dll!6283fdff() Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for Windows.UI.dll]
    Windows.UI.dll!628314ae() Unknown
    user32.dll!_InternalCallWinProc@20() Unknown
    user32.dll!_UserCallWinProcCheckWow@36() Unknown
    user32.dll!_CallWindowProcAorW@24() Unknown
    user32.dll!_CallWindowProcW@20() Unknown
    Windows.UI.Xaml.dll!5e06b434() Unknown
    Windows.UI.Xaml.dll!5e06b3af() Unknown
    user32.dll!_InternalCallWinProc@20() Unknown
    user32.dll!_UserCallWinProcCheckWow@36() Unknown
    user32.dll!_DispatchMessageWorker@8() Unknown
    user32.dll!_DispatchMessageW@4() Unknown
    Windows.UI.dll!628311dc() Unknown
    Windows.UI.dll!62831290() Unknown
    Windows.UI.Xaml.dll!5e16dee2() Unknown
    Windows.UI.Xaml.dll!5e16dea1() Unknown
    Windows.UI.Xaml.dll!5e16de65() Unknown
    ntdll.dll!_RtlReleaseSRWLockExclusive@4() Unknown
    03655668() Unknown
    twinapi.dll!67b2c9dd() Unknown
    twinapi.dll!67b2cab2() Unknown
    twinapi.dll!67b2c9f6() Unknown
    SHCore.dll!740c1ffd() Unknown
    kernel32.dll!@BaseThreadInitThunk@12() Unknown
    ntdll.dll!___RtlUserThreadStart@8() Unknown
    ntdll.dll!__RtlUserThreadStart@8() Unknown

    Wednesday, October 10, 2012 3:50 PM

All replies

  • When you're in this state, can you take a dump of the svchost.exe process containing the AudioSrv service and send it to me? email to (mateer at microsoft dot com)

    Matthew van Eerde

    Friday, April 24, 2015 8:57 PM