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

  • From: Giacomo Costantini <giacomo.costantini3@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Tue, 28 Apr 2020 11:29:11 +0100

Hi Tim, 
thank you very much for the prompt response.

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.

The intent of our product is to produce adaptive stereo for loudspeakers, not 
for headphones. But I suppose the fact of having stereo -> stereo or 5.1 -> 
stereo is just a matter of configuring the audio filter and handling the 
streams in my DSP, so it’s not that relevant for the other questions.

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.


That starts to make some sense, thanks for the info. 
I am not very familiar with IOCTLs on Windows, so if there is any code or more 
specific documentation you can share or point me to, that would be of great 
help.

Thanks again,
Giacomo


On 27 Apr 2020, at 20:29, Tim Roberts <timr@xxxxxxxxx> wrote:

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 ;
<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 <mailto:timr@xxxxxxxxx>
Providenza & Boekelheide, Inc.

Other related posts: