none
about enumerating devices RRS feed

  • Question

  •  

    right-clicking the speaker icon in the notification area, and selecting playback Devices, in my computer , i can see two devices , one is speaker and the other is digital output . if the speaker device is inactive when not connect to a  headphone , otherwise is active; but if the digital output device is active whether connect to a digital sound speaker  or not.

     following code, will enumerate all active device in mmsys.cpl , playback device

     

    Code Snippet

    hr = CoCreateInstance(
      CLSID_MMDeviceEnumerator, NULL,
      CLSCTX_ALL, IID_IMMDeviceEnumerator,
      (void**)&pEnumerator);
     EXIT_ON_ERROR(hr);

     hr = pEnumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &pCollection);
     EXIT_ON_ERROR(hr);

     

     


    if there are two audio card , so enumerate two  digital output devices ,only one adapter  connect to a  digital speaker, if my application use the one which not connect to digital speaker, and opening a stream , format is  WAVE_FORMAT_DOLBY_AC3_SPDIF, we cannot listen any sound.

    are there methods for determing whether a digital output device connect to a
    digital speakers?

    thank you in advance.

    Wednesday, November 12, 2008 2:06 PM

All replies

  • You have two S/PDIF outputs, and you're trying to figure out which one to play to?

    The "plugged"/"unplugged" behavior of the analog output that you're noticing is powered by electrical impedance sensing, which is relayed to the driver by the HD Audio hardware per the HD Audio spec.

    I'm not aware of any "is-there-a-receiver-plugged-in" mechanism for S/PDIF outputs.  I don't immediately see what you could do other than play to all S/PDIF outputs simultaneously, or perhaps allow the user to choose the correct one via UI.
    Wednesday, November 12, 2008 5:04 PM
    Moderator