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

  • From: "Jeff Pages" <jeff@xxxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 2 Feb 2016 13:33:56 +1100

Hi Andrea,

 

Some first-glance suggestions.

 

Does it consistently stop after the same amount of time each time? If so,
I'd be looking for a counter that's wrapping around to zero.

 

On the other hand, if it's completely random (it could run for a minute or a
week), perhaps there's a race condition with two things very rarely
happening at the same time which shouldn't (or which you don't cater for).

 

Does it happen at all when your driver is only running one way (i.e. with
only A's speakers going to B's mic or vice-versa)? That might give you a
clue as to where to start looking.

 

Jeff

 

 

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Andrea Guardascione
Sent: Tuesday, 2 February 2016 1:23 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Windows virtual audio driver stops working after few
days

 

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-cf35e9
53

 

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: