Multi Stream selection in a WaveCyclic sound filter.

Hi,

I am working on an audio adapter-minport driver. I have taken the
microsoft wdm sample driver - MSVAD, Simple. The requirement is to have
a server and 2 clients which get connected to the server. These client
machines talk to each other via this server. So on the server, this
MSVAD simple adapter driver takes the voice from client 1 and diverts it
to client 2 and the same on the other path also. WinRTP from Vovida is
used to transfer voice between clients and server. So essentially the
MSVAD does not have any hardware.

In MSVAD simple driver, I have created one WaveCyclic mini port driver
with two rendering and two capturing streams. Let me call these as R1,R2
and C1, C2. R1 and C1 handle a common cyclic buffer. Similarly R2 and
C2 handle another cyclic buffer. Whatever data is written by R1 will be
read by C1 so with R2 and C2.

Applications such as CoolEdit are used for testing this driver on the
server. (Let me call these as CoolEdit1 and CoolEdit2). CoolEdit1 uses
R1 and C2 for Playback and Capturing device. CoolEdit2 uses R2 and C1,
this way bi directional voice can be achieved. Now the problem is, from
any of these applications, we can select one device for PlayBack
(rendering) and one device for Capturing. Since there is only one
waveCyclic filter, they will see only one device which will be selected
for both playback and rendering by both the applications…

Now we can not guarantee that CoolEdit1 gets R1 and C2 pair and
CoolEdit2 gets R2 and C1 pair when they request for available streams…
It might loop back like R1 and C1, R2 and C2 where, whatever CoolEdit1
writes will be read by itself.It should happen like CoolEdit1 writes to
a buffer which will be read by CoolEdit2 and whatever CoolEdit2 writes
to another buffer should be read by CoolEdit1. How can I achieve this ?

Is there any unique identifier (which recognizes the application when
the IRP request for both rendering and capturing streams arrive) which i
can use to map the streams such as, CoolEdit1# mapped to R1,C2 and
CoolEdit2# mapped to R2,C1 ??
I can get the current IRP but is there any information in the IRP which
is similar to process ID of the originator of the the IRP (CoolEdit in
this case) which my driver can access ?

Is there any other idea which i can implement to achieve this
requirement ?

Thanks in advance
Esha

Hi, Esha.

From what you’re saying, it sounds like your miniport exposes one capture
pin and one render pin, and that the miniport allows two streams to be
created on each pin. I’m not sure there’s a way to know which application
is talking to you in this case. I don’t see any useful context information
in the parameters to NewStream().

One way to fix this would be to instantiate two wavecyclic/topology miniport
objects, one for each stream. That way, the object determines which stream
you’re using. We have done this successfully in a driver for a
multi-channel audio card. Of course, this means your two applications would
need to open different devices. Hopefully, that isn’t a problem for you.

You could also try posting this on the wdmaudiodev mailing list. You may
get some other suggestions there. Visit www.wdmaudiodev.de and click on the
“Subscribe” link at the bottom of the page. Once you’ve subscribed, you can
post your message.

Best regards,
-Dan

----- Original Message -----

Subject: Multi Stream selection in a WaveCyclic sound filter.
From: “Eshanye.K.P”
> Date: Thu, 11 Dec 2003 18:31:17 +0530
> X-Message-Number: 14
>
> Hi,
>
> I am working on an audio adapter-minport driver. I have taken the
> microsoft wdm sample driver - MSVAD, Simple. The requirement is to have
> a server and 2 clients which get connected to the server. These client
> machines talk to each other via this server. So on the server, this
> MSVAD simple adapter driver takes the voice from client 1 and diverts it
> to client 2 and the same on the other path also. WinRTP from Vovida is
> used to transfer voice between clients and server. So essentially the
> MSVAD does not have any hardware.
>
> In MSVAD simple driver, I have created one WaveCyclic mini port driver
> with two rendering and two capturing streams. Let me call these as R1,R2
> and C1, C2. R1 and C1 handle a common cyclic buffer. Similarly R2 and
> C2 handle another cyclic buffer. Whatever data is written by R1 will be
> read by C1 so with R2 and C2.
>
> Applications such as CoolEdit are used for testing this driver on the
> server. (Let me call these as CoolEdit1 and CoolEdit2). CoolEdit1 uses
> R1 and C2 for Playback and Capturing device. CoolEdit2 uses R2 and C1,
> this way bi directional voice can be achieved. Now the problem is, from
> any of these applications, we can select one device for PlayBack
> (rendering) and one device for Capturing. Since there is only one
> waveCyclic filter, they will see only one device which will be selected
> for both playback and rendering by both the applications…
>
> Now we can not guarantee that CoolEdit1 gets R1 and C2 pair and
> CoolEdit2 gets R2 and C1 pair when they request for available streams…
> It might loop back like R1 and C1, R2 and C2 where, whatever CoolEdit1
> writes will be read by itself.It should happen like CoolEdit1 writes to
> a buffer which will be read by CoolEdit2 and whatever CoolEdit2 writes
> to another buffer should be read by CoolEdit1. How can I achieve this ?
>
> Is there any unique identifier (which recognizes the application when
> the IRP request for both rendering and capturing streams arrive) which i
> can use to map the streams such as, CoolEdit1# mapped to R1,C2 and
> CoolEdit2# mapped to R2,C1 ??
> I can get the current IRP but is there any information in the IRP which
> is similar to process ID of the originator of the the IRP (CoolEdit in
> this case) which my driver can access ?
>
>
> Is there any other idea which i can implement to achieve this
> requirement ?
>
> Thanks in advance
> Esha