[wdmaudiodev] Re: AVStream miniport driver design question

  • From: Waldemar Haszlakiewicz <waldemar.haszlakiewicz@xxxxxxxx>
  • To: Igor Slewsarev <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 29 Oct 2003 18:08:30 +0100

Dear Igor

Nope I understood you correctly and my answer was at least in my eyes correct.

1st Each filterfactory is like a device on it's own -> now it depends how many 
channels you set
that each pin can handle (multichannel) or in your case 1 mono channel per PIN 
-> but take notice
that you'll have problems playing sound as normally 1 pin exposes it self as 1 
stereo channel.
Now you can define a filterFactory which is just a capture or just a renderer 
and it can be both
too -> and even in this case upper layer will look at filterFactory as a 
separate render and a
separate capture device (well not really but it looks like this from 
application point of view).

2nd It doesn't matter what you use for data transfer (copy or dma) in both 
cases you will have a
streamPointer which will point to the PIN's (not filterFactory's) data/mappings.
So every channel is on it's own, but is using the same device properties 
(..,DPC->DMA,..) as all
other pins.
Now how the data for your Pin is constructed depends on how many channels have 
you defined in
KSDATARANGE_AUDIO and more what kind of pin has connected to your pin.


Now as you said that you want to have 16 separate devices -> this means that 
you have 16 separate
filterFactories (but only 1 device).
Now you need to register every filterFactory interface to KSCATEGORY_AUDIO and
KSCATEGORY_RENDER and/or KSCATEGORY_CAPTURE.
(This can be done in inf file too.)

And after registering you need to call KsCreateFilterFactory for every 
filterFactory
(ks can do this for you to if you'll use KSDEVICE_DESCRIPTOR).


>If not, I suppose, it should be one filter-factory which constructs a filter 
>with 16 pins.
If you'll define 1 filter factory with 16 pins the application will see only 1 
device which supports
16 channels.

>Sum: I should correct my question. Really I'm
interesting in
1) how to properly describe my device as
multifunctional (if it really needed)
If your device supports only audio streams than you don't need to define 
multifunctional device ->
(Notice: You have used 'multifunctional' word wrongly -> if your device is 
multifunctional than
your device includes more than 1 type of data -> e.g. audio and midi -> when 
you register your
device to a different category(read interface, class) your device becomes 
multifunctional.)

>2) how to make my device(s) to be visible to waveIn API
KsCreateFilterFactory

>3) how to add my filter (or filters?) to a list of a system sound recording  
>devices.
KsCreateFilterFactory

>4) is it necessary to implement class factory for a
topology filter (if I only
   can control volume for each stream)?
All you need to do is to register your interface and call KsCreateFilterFactory 
-> all other pin
stuff is supported through pin properties (KSAUTOMATION_TABLE and don't forget 
to set the NODE's
too).


If you want I can send you some snippets of my code.
(Unfortunately I can't show you the whole driver because of the hardware legal 
issues.
Fortunately the interface(and some other parts) is/are out of the legal stuff.)

Waldemar Haszlakiewicz


IS> Hello, Waldemar!

IS> Thanks for your help. But it seems to me You have
IS> misunderstood me.
IS> I have to write a KS driver for a PCI device which has
IS> 16 separate ADC (and 16
IS> input jacks) and one shared DMA controller. So each
IS> ADC can work independently
IS> and produce separate output stream. Now I realize that
IS> from the point of view
IS> of any user mode capture application it should be 16
IS> separate devices, am I
IS> wright?. If so, I have to make choice between writing
IS> of my own proprietary bus
IS> driver (or using mf.sys) and expressing this
IS> 'multifunctionality' by means of
IS> KS subsystem (I am thinking about 16 filter factories
IS> each with one sink pin
IS> factory and etc.). If not, I suppose, it should be one
IS> filter-factory which
IS> constructs a filter with 16 pins. In any case, main
IS> requirement is to allow
IS> user to select definite input jack as a system default
IS> sound recording device.

IS> Sum: I should correct my question. Really I'm
IS> interesting in
IS> 1) how to properly describe my device as
IS> multifunctional (if it really needed)
IS> 2) how to make my device(s) to be visible to waveIn
IS> API and
IS> 3) how to add my filter (or filters?) to a list of a
IS> system sound recording
IS>    devices.
IS> 4) is it necessary to implement class factory for a
IS> topology filter (if I only
IS>    can control volume for each stream)?

IS> Sincerely,
IS> Igor Slewsarev.

IS> --- Waldemar Haszlakiewicz
IS> <waldemar.haszlakiewicz@xxxxxxxx> wrote:
>> You can set first a filterFactory ("filter") with
>> more than a stereo capabilities -> for those
>> programs which can have surround or similar
>> features.
>> Then you can set a filterFactory for every stereo
>> channel you have.
>> 
>> For filters you don't have to support any dispatch
>> routines if you really don't need to ->
>> but you'll need them for pins.
>> KSPIN_DESCRIPTOR_EX definition can be the same for
>> all channels (except for that multichannel one ->
>> where KSDATARANGE_AUDIO and similar will be
>> different).
>> 
>> Take notice that in KSDATARANGE_AUDIO you define if
>> the "pin" is a mono, stereo, multichannel one.
>> 
>> 
>> Now you need to register interfaces too -> you can
>> do it in inf file or you can use
>> KsCreateFilterFactory or you can set everything in
>> KSDEVICE_DESCRIPTOR already.
>> 
>> If you'll need any help with KsCreateFilterFactory
>> just mail me and I'll help you out.
>> 
>> Now if you'll want to support MME and DirectX users
>> you'll have to define KSDATARANGE_AUDIO
>> with KSDATAFORMAT_SPECIFIER_WAVEFORMATEX and
>> KSDATAFORMAT_SPECIFIER_DSOUND -> one after another.
>> The second one will signal that you support DirectX
>> to.
>> 
>> 
>> Sum: you just define need to define one
>> KSPIN_DESCRIPTOR_EX and a second one for
>> multichannel if you
>> wish.
>> 
>> Any other questions just ask.
>> 
>> Waldemar Haszlakiewicz
 


IS> __________________________________
IS> Do you Yahoo!?
IS> Exclusive Video Premiere - Britney Spears
IS> http://launch.yahoo.com/promos/britneyspears/
IS> ******************

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

IS> URL to WDMAUDIODEV page:
IS> http://www.wdmaudiodev.de/

******************

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

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.de/

Other related posts: