[wdmaudiodev] Windows virtual audio driver stops working after few days

  • From: Andrea Guardascione <carybus@xxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 2 Feb 2016 03:22:50 +0100

Hi all,
This is my first message and I am new to Windows Driver development so 
apologies if I say something silly, I tried to search for an answer but I can't 
find anything.
I started studying Windows driver development and I wanted to so something to 
implement a loopback audio driver.
What I am trying to do is having two application running, A and B, and have 
them communicating via the loopback driver:
- the output of A speakers becomes the input of B mic- the output of B speakers 
becomes the input of A mic
B runs all the time, A is on request, it opens and closes the channel
I downloaded the Windows Driver examples from 
https://code.msdn.microsoft.com/windowsapps/Windows-Driver-Kit-WDK-81-cf35e953
And I modified the msvad - vadsimpl implementation to remove the logic that 
writes to a file and add a circular buffer in CopyTo and CopyFrom.
I also simplified the topology to be as follow:
static PCCONNECTION_DESCRIPTOR MiniportConnections[] ={  //  FromNode,          
           FromPin,                        ToNode,                      ToPin  
{   PCFILTER_NODE,                KSPIN_TOPO_WAVEOUT_SOURCE,      
KSNODE_TOPO_WAVEOUT_VOLUME,  1 },  {   KSNODE_TOPO_WAVEOUT_VOLUME,   0,         
                     KSNODE_TOPO_WAVEOUT_MUTE,    1 },  {   
KSNODE_TOPO_WAVEOUT_MUTE,     0,                              
KSNODE_TOPO_LINEOUT_VOLUME,  1 },  {   KSNODE_TOPO_LINEOUT_VOLUME,   0,         
                     PCFILTER_NODE,               KSPIN_TOPO_LINEOUT_DEST },
  {   PCFILTER_NODE,                KSPIN_TOPO_MIC_SOURCE,          
KSNODE_TOPO_MIC_VOLUME,      1 },  {   KSNODE_TOPO_MIC_VOLUME,       0,         
                     PCFILTER_NODE,               KSPIN_TOPO_WAVEIN_DEST }};
Everything works really well except that after 2 or 3 days the application B 
(the one that runs ll the time) stops receiving audio, putting some tracing in 
CopyFrom I noticed that one of the drivers stops calling CopyFrom, it only 
calls CopyTo, while the other one calls both.
If I close and restart B, everything starts working again. If I run the same 
test using VB calble (http://vb-audio.pagesperso-orange.fr/Cable/) it works 
without errors for several days so I am assuming that there is something in the 
driver that I didn't implement properly and it triggers only at random time.
Has anyone ever seen something similar before? I am not sure where to start 
looking at.
Thank you very much for the help!
Best Regards,Andrea                                       

Other related posts: