Could avstream work together with portcls?

I'm developing a PCIe video/audio capture card driver. For the video capture, it is no doubt to use avstream. For the audio capture, I’ve studied msvad/vadarray sample and thought it should work well. However, when I try to combine these two frameworks in the same driver, they conflict badly. Is it actually possible to merge them? If not, which approach would be better?

  1. Implement the audio capture using avstream: Based on the “custom-audio-driver-type-decision-tree”, I’m not sure whether avstream can handle audio DMA properly. I also checked wdmaudiodev and found someone work with this for several weeks.
  2. Implement a bus driver that creates two virtual child devices (PDOs): one for the avstream driver and one for the portcls driver. Gemini mentioned this approach, but I’m not sure if there is a sample—or whether this is even the correct direction.

If your card’s audio input is tied to the video input (such as a camera with a microphone), then you can handle both with a single filter-centric AVStream driver. The “avssamp” sample does exactly this. It does simulated DMA. It’s not exactly clear that it uses the best model, but it is certainly a proof of concept.

Thanks for the suggestion. From what I see, avssamp currently isn’t recognized as an audio capture (like mic). As far as I know, this is because it lacks the topology configuration. Is that correct?

AVStream should be creating a topology for you

It’s been a few years, but the last time I tried this, the only thing the audio side needed was to implement the KSPROPERTY_JACK_DESCRIPTION property in KSPROPSETID_Jack. Windows doesn’t recognize an audio device unless it exposes the jack properties.