Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

OSR Seminars


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 6  
07 Jul 18 06:49
Bruce Lu
xxxxxx@hotmail.com
Join Date: 07 Jul 2018
Posts To This List: 3
SysVAD driver issue: Output audio being interrupted

Hi Guys, 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? Thanks
  Message 2 of 6  
09 Jul 18 01:33
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 12008
SysVAD driver issue: Output audio being interrupted

On Jul 7, 2018, at 3:48 AM, xxxxx@hotmail.com <xxxxx@lists.osr.com> wrote: > > 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. Your driver is required to supply what the Audio Engine asks for. You will have to have a circular buffer inside your driver to hold the larger buffers from your application, and deliver them 1920 bytes at a time to the Audio Engine. ??? Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 6  
09 Jul 18 04:26
Bruce Lu
xxxxxx@hotmail.com
Join Date: 07 Jul 2018
Posts To This List: 3
SysVAD driver issue: Output audio being interrupted

Yes, I have a circular buffer to hold the data from application. And copy the required 1920 bytes from the circular buffer to the destination pointer of CopyFrom. Does the GetPostion of msvad or sysvad return accurate values? These two samples use relative timestamp to calculate position.
  Message 4 of 6  
09 Jul 18 13:59
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 12008
SysVAD driver issue: Output audio being interrupted

xxxxx@hotmail.com wrote: > Yes, I have a circular buffer to hold the data from application. And copy the required 1920 bytes from the circular buffer to the destination pointer of CopyFrom. > > Does the GetPostion of msvad or sysvad return accurate values? These two samples use relative timestamp to calculate position. I think you need to prove that to yourself.  Have you added trace outputs so you can follow the computations and verify they're doing what you expect?  I just completed a virtual audio driver project based on MSVAD that works very much as you described (application feeds fake mic data into circular buffer which is then sent out through CopyFrom, as well as in the other direction), and it's working reliably.  I maintain statistics so we can monitor the circular buffer levels over time, and the graph is quite consistent. Also, are you putting a red flag in the debug log if the circular buffer either fills or goes dry?  That's an indication of a problem. Where does your app get its timing? -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 5 of 6  
09 Jul 18 21:00
Bruce Lu
xxxxxx@hotmail.com
Join Date: 07 Jul 2018
Posts To This List: 3
SysVAD driver issue: Output audio being interrupted

Thanks for your suggestion. I will add trace in the circular buffer. > Where does your app get its timing? My application doesn't send timestamp to Driver. I use DirectShow to play an audio file and I use DirectShow's Sample Grabber to get playing PCM samples then pass them to Driver. In the driver side, I haven't modified the MSVAD's GetPosition function, so the time is calculated from KeQueryInterruptTime.
  Message 6 of 6  
09 Jul 18 21:23
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 12008
SysVAD driver issue: Output audio being interrupted

xxxxx@hotmail.com wrote: > Thanks for your suggestion. I will add trace in the circular buffer. > >> Where does your app get its timing? > My application doesn't send timestamp to Driver. I use DirectShow to play an audio file and I use DirectShow's Sample Grabber to get playing PCM samples then pass them to Driver. It's not about timestamping, it's about pacing the data flow so you don't flood the circular buffer.  The answer to my question is "DirectShow".  It gets its timing from timestamps in the audio file. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 19:27.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license