• From: Waldemar Haszlakiewicz <waldemar.haszlakiewicz@xxxxxxxx>
  • To: wdmaudiodev <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Sat, 25 Oct 2003 19:16:47 +0200

Hello to all

As some time back somebody was asking how to get driver special commands 
through AVStream
ks.sys layer, here are some ideas and also questions from me how legal are my 

My first idea was to use IRP_MJ_DEVICE_CONTROL, but as this is used by ks.sys 
my only
choice was to save the ks defined MajorFunction[IRP_MJ_DEVICE_CONTROL], check 
if the
ioControlCode is "user" defined and if not call the ks supplied DEVICE_CONTROL 
procedure (in other case the driver sets the IRP stuff and returns).
Now as much as this is all nice and beautiful I really don't like this 
"patching" stuff.
My questions: Is this allowed at all? Well why now it's just another filter in 

Now as "patching" is "patching" I was searching for more legal solutions and 
came to a
really nice solution -> KSPROPERTY_AUDIO_DEV_SPECIFIC.
So here is the second idea(read after the picture):
//                   --------------------------
//                   | "Filter"               |
//                   |  (1) ------------ (0)  |
//  Bridge Pin  1 o--|-->o--|ADC Node 0|--o>--|--o 0  Sink Pin
//                   |      ------------      |      (WaveIn 1,2)
//                   |                        |
//                   |  (1) ------------ (0)  |
//    Sink Pin  2 o--|-->o--|DAC Node 2|--o>--|--o 3  Bridge Pin
//   (WaveOut 1,2)   |      ------------      |
//                   |                        |
//                   --------------------------
//                   |                        |
//                   | (1)----------------(0) |
//     Sink Pin 4 o--|->o-|Filter Control|-o>-|--o 5 Bridge Pin
//  (Asio and CPanel)|    ----------------    |
//                   |                        |
//                   --------------------------
//      Asio and Control Panel commands are all done trough
//      the KSPROPERTY_AUDIO_DEV_SPECIFIC property on filter.
//      Every definition of IN/OUT looks from card point of view and not
//      the driver( filter ).
//      e.g. WaveIn1 - input channel 1 into card
//      One wave pin is 1 stereo channel(can be mono also if defined in format).

Now this one wouldn't require any "patching" but as not everything that shines 
is gold
I came to a problem/question:
- If an application uses DirectKS protocol can filter still get the
KSPROPERTY_AUDIO_DEV_SPECIFIC property or in other words can Asio/ControlPanel 
already opened DirectKS filter (Asio/ControlPanel would open Pin 4 and nothing 

Now if Asio/ControlPanel can open the Pin 4 than KSPROPERTY_AUDIO_DEV_SPECIFIC 
is really just
a little more sophisticated IRP_MJ_DEVICE_CONTROL option.
So in multicard,multichannel driver the first filter registered to the system 
would have another
two pins and would act as user defined "ioControlCode" messages parser.

Now it all depends on if filter can be accessed while used by a DirectKS 
Can it?

Has any one any other solution?

Waldemar Haszlakiewicz


WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx


Other related posts: