[wdmaudiodev] Re: AVStream driver as a both Capture and Renderer Filter

  • From: "swapnil kamble" <swap.kamble@xxxxxxxxx>
  • To: "Mostek Access" <mostekaccess@xxxxxxxxx>, wdmaudiodev@xxxxxxxxxxxxx, "Sam Tertzakian" <sam@xxxxxxxxxxx>, dsisolak@xxxxxxxxxxxxxxxxxxxxxx
  • Date: Thu, 15 Jan 2009 18:37:02 +0530

Thanks Waldemar,
                            I am using ksstudio and graphedit tools only,
for testing my drivers. I have got my problem, what is happening behind the
seen causing problem. Lets start it stepwise to get it,

//                    --------------------------
//                   |                             |
//                   |     (1) ------------ (0)   |
//Bridge 1   o--|-->o-|ADCNode|--o>--|--o 0  Comm. Both Pin
//                   |           ------------       |      (WaveIn 1,2)
//                   |                              |
                        ________________
Works fine.
Next I added two dummy bridge pins so topology became,

//                    --------------------------
//                   |                            |
//                   |     (1) ------------ (0)  |
//Bridge 1 o--|-->o--|   ADC    |--o>--|--o 0  Comm Both Pin
//                   |         ------------        |      (WaveIn 1,2)
//                   |
//                   |  (1) ------------ (0)      |
//            2 o--|-->o--|DAC       |--o>--|--o 3  Bridge Pin
//   Bridge      |         ------------         |
//                  |                              |

Gets registered under "Audio Capture Sources" and works fine here too.
Till this point my capture filter under graphedit looks like

//                    --------------------------
//                   |                            |
//           Wave|*             Capture *|
//            Pin   __________Pin___
Here Capture pin is representing pin 0 (As we want).

Next problem arises when I just move my type of pin 2 from Bridge to Sink.
As it is going to get registered now in "Audio Renderers" too. It happens as
expected. But graph in graphedit looks totally different it looks like

//                    --------------------------
//                   |                            |
//           Wave|*                           |
//                   |                            |
//    SW Synth|*             Capture *|
//                   |                            |
//    CD Player|*                           |
//            Pin    _______________

And one big strange thing happens which is the root cause of our problem, is


Capture Pin (as seen in dia.) is not been represented by pin 0 (as it was
happening one step before).* Instead Pin 2(which is just made from comm.
bridge to comm. sink) is represented as a capture.(We were expecting pin 0
to come as a capture and pin 2 as a render.).*

I am not getting why is this happening, but its happening. I also came to
know this thing after lot of debugging and providing altogether different
dispatch tables and all other things for both pins. But this happens and
surely causing problems.

I am again providing my new Pin Descr.

    //
    // Audio Capture Pin
    //
    {
        &AudioCapturePinDispatch,
        NULL,
        {
            SIZEOF_ARRAY( PinInterfaces_Wave ),
            (KSPIN_INTERFACE*) &PinInterfaces_Wave,
            SIZEOF_ARRAY( PinMediums_Wave ),
            (KSPIN_MEDIUM*) &PinMediums_Wave,
            SIZEOF_ARRAY( PinAudioFormatRanges_WaveSink ),
            PinAudioFormatRanges_WaveSink,
            KSPIN_DATAFLOW_OUT,                 // Dataflow
            KSPIN_COMMUNICATION_BOTH,           // Communication
            &KSCATEGORY_AUDIO,                  // Category
            &g_PINNAME_AUDIO_CAPTURE,           // Name
            0                                   // Reserved
        },
        KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING | // Flags
            KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING |
            KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY |
            KSPIN_FLAG_FIXED_FORMAT,
        1,                                      // Instances Possible
        0,                                      // Instances Necessary
        &AudioDefaultAllocatorFraming,          // Allocator Framing (filled
later)
        reinterpret_cast <PFNKSINTERSECTHANDLEREX> // Intersect Handler
            (CAudioCapturePin::IntersectHandler)
    },
    //Bridge PIN
    {
        NULL,
        NULL,
        {
            SIZEOF_ARRAY( PinInterfaces_Wave ),
            (KSPIN_INTERFACE*) &PinInterfaces_Wave,
            SIZEOF_ARRAY( PinMediums_Wave ),
            (KSPIN_MEDIUM*) &PinMediums_Wave,
            SIZEOF_ARRAY( PinAudioFormatRanges_WaveBridge ),
            PinAudioFormatRanges_WaveBridge,
            KSPIN_DATAFLOW_IN,
            KSPIN_COMMUNICATION_BRIDGE,
            &KSCATEGORY_AUDIO,                  // Category
            NULL,           // Name
            0
        },
        0,
        0,
        0,
        NULL,
        NULL
    },
    //Audio Renderer Pin
    {
        &AudioPinDispatch_1,
        NULL,
        {
            SIZEOF_ARRAY( PinInterfaces_Wave ),
            (KSPIN_INTERFACE*) &PinInterfaces_Wave,
            SIZEOF_ARRAY( PinMediums_Wave ),
            (KSPIN_MEDIUM*) &PinMediums_Wave,
            SIZEOF_ARRAY( PinAudioFormatRanges_WaveSink ),
            PinAudioFormatRanges_WaveSink,
            KSPIN_DATAFLOW_IN,
          *  **KSPIN_COMMUNICATION_SINK,*                */// as soon as
made to sink causes problem*
            &KSCATEGORY_AUDIO,                  // Category
            &g_PINNAME_AUDIO_RENDER,
            0
        },
        KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING | // Flags
            KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING |
            KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY |
            KSPIN_FLAG_FIXED_FORMAT|
            KSPIN_FLAG_RENDERER,
        1,
        0,
        &AudioDefaultAllocatorFraming,          // Allocator Framing (filled
later)
        reinterpret_cast <PFNKSINTERSECTHANDLEREX> // Intersect Handler
            (CAudioCapturePin::IntersectHandler)
    },
    //Bridge PIN
    {
        NULL,
        NULL,
        {
            SIZEOF_ARRAY( PinInterfaces_Wave ),
            (KSPIN_INTERFACE*) &PinInterfaces_Wave,
            SIZEOF_ARRAY( PinMediums_Wave ),
            (KSPIN_MEDIUM*) &PinMediums_Wave,
            SIZEOF_ARRAY( PinAudioFormatRanges_WaveBridge ),
            PinAudioFormatRanges_WaveBridge,
            KSPIN_DATAFLOW_OUT,
            KSPIN_COMMUNICATION_BRIDGE,
            &KSCATEGORY_AUDIO,                  // Category
            &g_PINNAME_AUDIO_RENDER,
            0
        },
        0,
        0,
        0,
        NULL,
        NULL
    },


};

If you have any clue about this problem, please reply.

Thanks..

On Thu, Jan 15, 2009 at 4:24 PM, Mostek Access <mostekaccess@xxxxxxxxx>wrote:

> Now I haven't checked your definitions, but I remember that I had HUGE
> problems before everything
> worked properly. I would advise you to start a tool in the DDK named:
> ksstudio.exe and enable
> logging of all the messages. Then try to use/conect your filter in the
> program and you will see what's wrong.
>
> Have to say that this program gives you a lot of information on what is
> happening.
>
> If you wont have any luck even with ksstudio, contact me and I'll see what
> I can do.
>
> Peace and good luck
> Waldemar
>
>
> ---------[ Received Mail Content ]----------
> > Subject : Re: AVStream driver as a both Capture and Renderer Filter
> > Date : Tue, 13 Jan 2009 11:59:55 +0530
> > From : "swapnil kamble"
> > To : "Mostek Access"
> >
> >And my Pin Descriptor is like this,
> >
> >const
> >KSPIN_DESCRIPTOR_EX
> >CaptureFilterPinDescriptors [CAPTURE_FILTER_PIN_COUNT] = {
> > //
> > // Audio Capture Pin
> > //
> > {
> > AudioCapturePinDispatch,
> > NULL,
> > {
> > NULL, // Interfaces (NULL, 0 ==
> >default)
> > 0,
> > NULL, // Mediums (NULL, 0 ==
> >default)
> > 0,
> > SIZEOF_ARRAY( PinAudioFormatRanges_WaveSink ),
> > PinAudioFormatRanges_WaveSink,
> > KSPIN_DATAFLOW_OUT, // Dataflow
> > KSPIN_COMMUNICATION_BOTH, // Communication
> > KSCATEGORY_AUDIO, // Category
> > g_PINNAME_AUDIO_CAPTURE, // Name
> > 0 // Reserved
> > },
> > KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING | // Flags
> > KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING |
> > KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY |
> > KSPIN_FLAG_FIXED_FORMAT,
> > 1, // Instances Possible
> > 1, // Instances Necessary
> > AudioDefaultAllocatorFraming, // Allocator Framing (filled
> >later)
> > reinterpret_cast // Intersect Handler
> > (CAudioCapturePin::IntersectHandler)
> > },
> > //Bridge PIN
> > {
> > NULL,
> > NULL,
> > {
> > NULL, // Interfaces (NULL, 0 ==
> >default)
> > 0,
> > NULL, // Mediums (NULL, 0 ==
> >default)
> > 0,
> > SIZEOF_ARRAY( PinAudioFormatRanges_WaveBridge ),
> > PinAudioFormatRanges_WaveBridge,
> > KSPIN_DATAFLOW_IN,
> > KSPIN_COMMUNICATION_NONE,
> > KSCATEGORY_AUDIO, // Category
> > g_PINNAME_AUDIO_CAPTURE, // Name
> > 0
> > },
> > 0,
> > 0,
> > 0,
> > NULL,
> > NULL
> > },
> > //
> > // Audio Renderer Pin
> > //
> > {
> > AudioCapturePinDispatch1,
> > NULL,
> > {
> > NULL, // Interfaces (NULL, 0 ==
> >default)
> > 0,
> > NULL, // Mediums (NULL, 0 ==
> >default)
> > 0,
> > SIZEOF_ARRAY( PinAudioFormatRanges_WaveSink ),
> > PinAudioFormatRanges_WaveSink,
> > KSPIN_DATAFLOW_IN, // Dataflow
> > KSPIN_COMMUNICATION_BOTH, // Communication
> > KSCATEGORY_AUDIO, // Category
> > g_PINNAME_AUDIO_RENDER, // Name
> > 0 // Reserved
> > },
> > KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING | // Flags
> > KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING |
> > KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY |
> > KSPIN_FLAG_FIXED_FORMAT|
> > KSPIN_FLAG_RENDERER,
> > 1, // Instances Possible
> > 1, // Instances Necessary
> > AudioDefaultAllocatorFraming, // Allocator Framing (filled
> >later)
> > reinterpret_cast // Intersect Handler
> > (CAudioCapturePin::IntersectHandler1)
> > },
> > //Bridge PIN
> > {
> > NULL,
> > NULL,
> > {
> > NULL, // Interfaces (NULL, 0 ==
> >default)
> > 0,
> > NULL, // Mediums (NULL, 0 ==
> >default)
> > 0,
> > SIZEOF_ARRAY( PinAudioFormatRanges_WaveBridge ),
> > PinAudioFormatRanges_WaveBridge,
> > KSPIN_DATAFLOW_OUT,
> > KSPIN_COMMUNICATION_NONE,
> > KSCATEGORY_AUDIO, // Category
> > g_PINNAME_AUDIO_RENDER, // Name
> > 0
> > },
> > 0,
> > 0,
> > 0,
> > NULL,
> > NULL
> > },
> >
> >};
> >
> >
> >On Tue, Jan 13, 2009 at 11:26 AM, swapnil kamble wrote:
> >
> >> Hi Waldemar,
> >> I having problems in designing topology for my driver.
> >> My driver is a virual driver. I developed Capture filter with following
> >> topology works perfectly fine for me.
> >>
> >> // --------------------------
> >> // | |
> >> // | (1) ------------ (0) |
> >> //Bridge 1 o--|-->o--|Vol Node|--o>--|--o 0 Comm. Both Pin
> >> // | ------------ | (WaveIn 1,2)
> >> // | |
> >> ________________
> >>
> >> *Capture Pin = Pin 0
> >>
> >> *Then for renderer filter, inverse the direction with pins too. so my
> >> topology looks like
> >>
> >> // | (1) ------------ (0) |
> >> // 2 o--|-->o--|Vol Node|--o>--|--o 3 Bridge Pin
> >> // Comm | ------------ |
> >> // Both pin | |
> >> // (WaveOut 1,2)
> >>
> >> *Renderer Pin = Pin 2*
> >>
> >> This also works fine for me.
> >>
> >> But when I combine both of them and make topology as,
> >>
> >> // --------------------------
> >> // | |
> >> // | (1) ------------ (0) |
> >> //Bridge 1 o--|-->o--|Vol Node|--o>--|--o 0 Comm Both Pin
> >> // | ------------ | (WaveIn 1,2)
> >> // |
> >> // | (1) ------------ (0) |
> >> // 2 o--|-->o--|Vol Node|--o>--|--o 3 Bridge Pin
> >> // WaveOut | ------------ |
> >> // | |
> >> // --------------------------
> >>
> >> I *assume *here that my pin *0 will become capture pin and pin 2 will
> >> become renderer pin*. Is there anything mismatching between my
> assumption
> >> and my topology ?
> >>
> >> When I create and render or capture filter the dispatch routines of the
> >> particular routines are not called.
> >>
> >> Do you have any idea about this ? Is there something missing here,when
> we
> >> combine both the things ?
> >>
> >> Your any suggestion about this will really help me to solve this
> problem.
> >>
> >> Thanks.
> >> --
> >> ...Swapnil
> >>
> >> || Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
> >> || Hare Rama Hare Rama Rama Rama Hare Hare ||
> >>
> >
> >
> >
> >--
> >...Swapnil
> >
> >|| Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
> >|| Hare Rama Hare Rama Rama Rama Hare Hare ||
> >
>



-- 
...Swapnil

|| Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
|| Hare Rama    Hare Rama   Rama   Rama    Hare Hare ||

Other related posts: