[wdmaudiodev] Re: VAD processing and re-routing streams

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Mon, 27 Apr 2020 12:29:30 -0700

Giacomo Costantini wrote:

I would like to implement a Virtual Audio Device which processes stereo, 5.1 or 7.1 streams, performs some spatialisation audio processing, and outputs stereo.

Is there really any point to this?  If you do web searches on this topic, there are a many technical people who argue that this is a silly thing to do.  There is no spatialization in headphones.  It's just two speakers.  One can assume that the applications writers that are PRODUCING the audio are in a much better position to decide how to reduce the output.  It's better to let them produce 7.1-specific data and 5.1-specific data and stereo-specific data, because they know what they want.

What  is not totally clear to me is how to get the output stream from SYSVAD and re-route it to available stereo speakers.
I understand I will have to write a user application for that, but I would really appreciate if someone could point me to what specific API/architecture/technology/code should I use for that.
I have found https://docs.microsoft.com/de-de/windows/win32/coreaudio/stream-management, but am I right in thinking that using those APIs I should get the stream from the loopback pin and reroute it to some speaker device?

If your VAD supports a loopback pin, that may be possible. Otherwise, you'll end up with what I'll present below.

And they have an app called "WavesLoop Application" which is constantly running and apparently provides a list of stereo output devices and performs the operations on the streams in user mode.
What I do not understand is how they manage to get the kernel buffer stream from the LINEOUT endpoint without apparently having any loopback.

Their driver exposes private ioctls that are used by the application to access a circular buffer of data.  I've done two solutions that use this same technique.

Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Other related posts: