none
Is there any Audio Stream Routing feature at all in Media Foundation ? RRS feed

  • Question

  • Hi

    I always wanted to know why the Audio Stream Routing feature, which is meantioned everywhere for Media Foundation in the MSDN, does not work at all.

    It is meantioned in several places in the MSDN, but this is the most obvious one:

    https://docs.microsoft.com/en-us/windows/win32/coreaudio/stream-routing

    Quote:

    "In Windows 7, an application can seamlessly transfer a stream from an existing default device to a new default audio endpoint. High-level audio API sets such as Media Foundation, DirectSound, and WAVE APIs implement the stream routing feature. Media applications that use these API sets to play or capture a stream from the default device use the default implementation and will not have to modify the application."

    Now the problem is that it does not work at all. If you create an audio device source by calling MFCreateDeviceSource, and if you omit the endpoint ID parameter to create the source from a default device, then there is no audio stream routing. Now there are 2 questions here.

    The first would be:

    Is this is just another error in the documentation like the other 10 000 i discovered over the past 3-5 years ?

    The second would be:

    Is there a hidden attribute, that is not listed in Visual Studio and in the MSDN, that can be set to activate stream routing ?

    ->

    The second question might be most interessting, as there was this hidden attribute for the "Video Processor MFT", which was neither in the MSDN documentation nor in any header available in Visual Studio. That attribute is a rather important one, and is only known through a Microsoft Sample Code. Does the audio device source in Media Foundation also have such a hidden attribute, or is this just an error in the documentation ?

    As a side note: There seem to be several more issues with audio device sources created from the MFCreateDeviceSource function. One would be that the device removed event ( MECaptureAudioSessionDeviceRemoved ) is not send when the device was removed/lost. I found dozens of questions about it over at Stackoverflow and also here in the forum, which were never answered. And after testing the audio device source extensively myself i have to concur, that the event is never fired ( no matter what settings ).

    It looks like the developement of the audio device source implementation was kinda put to a hold after Windows 7, and errors creeped in. It seems that the focus for Microsoft was UWP/WinRT from Windows 8 onwards, and that errors in existing code bases were never fixed. For example, i found around 100 hard bugs in the EVR which were never fixed, and it looks like the audio device source shared the same fate.

    I hope a Microsoft dev can clear this up.

    Regards,

    Francis





    • Edited by Francis Grave Wednesday, August 7, 2019 10:55 AM Edit
    Wednesday, August 7, 2019 10:47 AM

All replies

  • Hello Francis Grave,

    >>>Now the problem is that it does not work at all. If you create an audio device source by calling MFCreateDeviceSource, and if you omit the endpoint ID parameter to create the source from a default device, then there is no audio stream routing.

    What does "the endpoint ID parameter" mean? I can't find related information.

    To identify this issue, can you show a mini, complete and reproducible sample? So I can try to reproduce it.

    What's your Windows version?

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 8, 2019 7:38 AM
  • Hello Francis Grave,

    >>>Now the problem is that it does not work at all. If you create an audio device source by calling MFCreateDeviceSource, and if you omit the endpoint ID parameter to create the source from a default device, then there is no audio stream routing.

    What does "the endpoint ID parameter" mean? I can't find related information.

    To identify this issue, can you show a mini, complete and reproducible sample? So I can try to reproduce it.

    What's your Windows version?

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thank you Rita, for your interest.

    If you are not a developer of the audio device source, then you will not be able to clarify what i want to know. I am not sitting over any specific code right now. I was just asking it here, because it was never answered on Stackoverflow and in the Social MSDN.

    I can not give you any small sample, as i am not into any specific code right now. But it should not be to hard to write a few lines yourself. The "Endpoint ID" is an attribute you pass to the MFCreateDeviceSource function, that is why i inserted a hyperlink. All you had to do is to click on the link.

    What i am looking for with this forum question is background knowledge about the implementation of the source. If you are not someone who has experience or knowledge about the implementation details, then please dont try any further to solve that riddle. I was hoping that some MSFT members with knowledge about DirectShow or Media Foundation, like Roman for example, or maybe even the developer of the source himself, could answer this question.

    Regards,

    Francis



    Thursday, August 8, 2019 2:14 PM