[wdmaudiodev] Re: Virtual Audio Input Driver

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Sun, 27 Jan 2019 19:50:12 -0800

You have chosen a difficult place to start.  Audio drivers are complicated, and 
the environment in which they operate has some unique issues.

In the early days of Windows, pre-Vista, many people wrote filter drivers to do 
the cutesy things you’re talking about here.  So many people wrote cutesy, 
time-consuming filter drivers that it became impossible for professional audio 
applications to get anything approaching the guaranteed latencies that they 
need to do their thing.  So, when the Audio Engine was totally rewritten in 
Vista, the philosophy was changed.  Audio drivers work with the Audio Engine.  
For WaveRT drivers, which is almost all audio drivers, the audio data is never 
touched by kernel code.  The Audio Engine reads and writes from circular 
buffers in the hardware directly.  There’s no place for a kernel filter to hook 
in.

Conceptually, what Microsoft wants you to do is write a Global Effects Audio 
Processing Object (GFX APO), which is a user-mode DLL that runs inside the 
Audio Engine process.  There are 4 or 5 classes of FX APOs that tap in at 
various points in the audio pipeline.  However you can’t just distribute a 
system-wide GFX APO, because that would lead to the same kind of latency muck 
that we had before.  Instead, an APO is considered part of the hardware, and 
gets distributed and installed as part of the driver for a given audio device.  
There are sample APOs in the massive SYSVAD driver sample.

The architecture you’re proposing is certainly possible, but it’s a difficult 
path.  The SYSVAD sample I mentioned above implements a fake microphone and a 
fake speaker.  The fake microphone is fed from a signal generator, the fake 
speaker writes to a WAV file.  The SYSVAD driver is close to what you want, but 
the Microsoft audio team has chosen to use it as a platform to demonstrate 
essentially every feature that an audio driver can support, so it is extremely 
large.  You should take a look to see what you’re facing:  

https://github.com/Microsoft/Windows-driver-samples/tree/master/audio/sysvad
— 
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts: