locked
IAudioClient does not support Exclusive mode in Metro Apps?

    Question

  • I created a C++ Metro apps and use IAudioClient interface to check on some audio formats. Surprisingly it returns Error code 0x8889000e with IsFormatSupported() call.

    hr = pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &(pDeviceFormat->Format), &pReturnFormat);

    For pDeviceFormat->Format, I pass in 2 channel, 44.1K and 16bit. FormatTag 0xFFFE. It is all the settings for the most common format. But the HRESULT returned from this called is 0x8889000e (after some digging, it means Exclusive mode not supported. Please let me know if this error code means something else).

    I thought since IAudioClient interface is still supported in Metro Apps and all those Exclusive mode documentation is labeled as for "Metro Apps" as well. This call should not get any error. 

    My desktop App is able to get a S_OK on this call with all the same parameters. So is this an expected behavior?

    Thank you.

    Angela

    Wednesday, March 21, 2012 8:58 AM

All replies

  • Hello,

    Would you please provide us some sample codes to reproduce this issue?

    You can upload your project to skydriver
    http://skydrive.live.com/

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 22, 2012 7:13 AM
  • Hi Jesse,

    I have uploaded the project to my sky drive. Please let me know if you can't access it.

    Thank you.

    Angela


    • Edited by Angela Yan Friday, March 23, 2012 5:35 AM
    Thursday, March 22, 2012 8:53 AM
  • Hi Jesse,

    Do you have any update on this?

    Thank you.

    Angela

    Tuesday, March 27, 2012 2:39 AM

  • Hi Angela,

    I received your file and we are handling it now. Sorry for delay response.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, March 27, 2012 2:55 AM
  • Hello Angela,

    There is currently some confusion concerning your issue. Is there a particular reason you want to use exclusive mode? Does the same code work if you are not using exclusive mode?

    Thanks,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/


    Tuesday, March 27, 2012 11:17 PM
    Moderator
  • Hello Angela,

    Do you still need help with this? As I suggested in my previous post exclusive mode should work. There were some errors in your code that you provided that I just want to point out. First it appears that your average bytes per second is calculated incorrectly (should be 44100 * 4 = 176400). Also we believe that your format tab should be set to WAVE_FORMAT_PCM (0x1). Finally please verify that you have the "allow applications to take exclusive control of this device" setting selected in the "advanced" tab of the "speakers properties".

    Again if you fix the issues we found and are still having problems please let me know and I will do what I can to help.

    Thanks,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, April 18, 2012 12:00 AM
    Moderator
  • Hello, James:

    I got the same problem for exclusive mode.

    I set the format tab to WAVE_FORMAT_PCM, and the mixformat has been verified by calling IsFormatSupported, it is OK.

    But when I called IAudioClient::Initialize, it returned E_INVALIDARG.

    ////////////////////////////////////////////////////////////////////////////////////////

    REFERENCE_TIME defaultDevicePeriod = 0;
    REFERENCE_TIME minimumDevicePeriod = 0;

    HRESULT hr = m_AudioClient->GetDevicePeriod( &defaultDevicePeriod, &minimumDevicePeriod);

    m_AudioClient->Initialize( AUDCLNT_SHAREMODE_EXCLUSIVE,
                                            AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
                                            defaultDevicePeriod,
                                            defaultDevicePeriod,
                                            m_MixFormat,
                                            nullptr );

    Thanks.


    • Edited by ytshe Thursday, August 29, 2013 11:02 AM
    Thursday, August 29, 2013 10:42 AM