I created a virtual microphone driver based on MSVAD (it works with win7) and another based on SysVAD (it works with Win10).
I send 48KHZ stereo PCM samples from my application to virtual driver with IKsControl::KsProperty method. The PCM samples are reading from mp3 or wave file, then send to driver 4608 bytes continuously.
In the driver side, I create a circular buffer to cache pcm samples from application. When the 'CMiniportWaveCyclicStreamMSVAD::CopyFrom' is calling after 'CMiniportWaveCyclicStreamMSVAD::GetPosition', I copy the cached samples from circular buffer to DMA. If the cached sample is not enough, I fill 0.
The issue is: the output audio of virtual microphone sounds being interrupted sometimes and have noise. It seems because GetPostion and CopyFrom are called every 10 milliseconds, and the CopyFrom request 1920 bytes each time, but application send data to driver with 4608 bytes frequency.
I tried to allocate bigger buffer size for circular buffer, but it doesn't work.
How to fix this issue? Could anyone help me?