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

  • From: "swapnil kamble" <swap.kamble@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 15 Jan 2009 11:41:21 +0530

My Pin Descriptor is,

    //
    // Audio Capture Pin
    //
    {
        &AudioCapturePinDispatch,
        NULL,
        {
            NULL,                               // Interfaces (NULL, 0 ==
default)
            0,
            NULL,                               // Mediums (NULL, 0 ==
default)
            0,
            SIZEOF_ARRAY( PinAudioFormatRanges_Wave ),
            PinAudioFormatRanges_Wave,
            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 <PFNKSINTERSECTHANDLEREX> // 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_BRIDGE,
            &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_Wave),
            PinAudioFormatRanges_Wave,
            KSPIN_DATAFLOW_IN,                 // Dataflow
            KSPIN_COMMUNICATION_SINK,           // Communication
            &KSCATEGORY_AUDIO,                  // Category
            &g_PINNAME_AUDIO_RENDER,           // Name
            //&g_PINNAME_AUDIO_CAPTURE,
            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 <PFNKSINTERSECTHANDLEREX> // 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_BRIDGE,
            &KSCATEGORY_AUDIO,                  // Category
            &g_PINNAME_AUDIO_RENDER,           // Name
            //&g_PINNAME_AUDIO_CAPTURE,
            0
        },
        0,
        0,
        0,
        NULL,
        NULL
    },
};

KsStudio shows it correctly too.

On Thu, Jan 15, 2009 at 11:38 AM, swapnil kamble <swap.kamble@xxxxxxxxx>wrote:

> Hi Sam,
>             I tried earlier too with these combination of Dataflow and
> Communication. But my dispatchSetState for capture pin is not
> invoked.whereas before SetState, other routines like IntersetSectHandler ,
> DispatchSetFormat and DispatcthCreate are invoked and completed
> successfully. In KsStudio, I get following message, eventually fails to call
> DispatchSetState. But same pin parameters works perfectly when registered
> only under Capture Sources category.
>
> *Setting Pin state to KSSTATE_RUN
> KsPinInst::SetState: failed to set state property: KSSTATE_RUN*.
>
>
>
>
> On Wed, Jan 14, 2009 at 8:15 PM, Sam Tertzakian <sam@xxxxxxxxxxx> wrote:
>
>>  DATA_FLOW for Render Bridge Pin should be KSPIN_DATAFLOW_OUT.
>>
>> DATA_FLOW for Capture Bridge Pin should be KSPIN_DATAFLOW_IN.
>>
>> Communication type for both bridge pins (above) should be
>> KSPIN_COMMUNICATION_BRIDGE.
>>
>> Communication type for Render Data should be KSPIN_COMMUNICATION_SINK.
>>
>> Communication type for Capture Data should be KSPIN_COMMUNICATION_BOTH.
>>
>> Make sure you render topology has a DAC node.
>>
>> Make sure your capture topology has a ADC node.
>>
>>
>>
>> Look at the example for AC97. It has both capture and render pins. You
>> should have a similar situation.
>>
>>
>>
>> *From:* wdmaudiodev-bounce@xxxxxxxxxxxxx [mailto:
>> wdmaudiodev-bounce@xxxxxxxxxxxxx] *On Behalf Of *swapnil kamble
>> *Sent:* Tuesday, January 13, 2009 10:02 PM
>> *To:* wdmaudiodev@xxxxxxxxxxxxx; dsisolak@xxxxxxxxxxxxxxxxxxxxxx
>> *Subject:* [wdmaudiodev] Re: AVStream driver as a both Capture and
>> Renderer Filter
>>
>>
>>
>> Hi,
>>     My pin descriptor looks like this,
>>
>> const
>> KSPIN_DESCRIPTOR_EX
>> FilterPinDescriptors [CAPTURE_FILTER_PIN_COUNT] = {
>>     //
>>     // Audio Capture Pin
>>     //
>>     {
>>         &AudioCapturePinDispatch,
>>         NULL,
>>         {
>>             NULL,                               // Interfaces (NULL, 0 ==
>> default)
>>             0,
>>             NULL,                               // Mediums (NULL, 0 ==
>> default)
>>             0,
>>             SIZEOF_ARRAY( PinAudioFormatRanges_Wave ),
>>             PinAudioFormatRanges_Wave,
>>             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 <PFNKSINTERSECTHANDLEREX> // 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
>>     //
>>     {
>>         &AudioRenderPinDispatch,
>>         NULL,
>>         {
>>             NULL,                               // Interfaces (NULL, 0 ==
>> default)
>>             0,
>>             NULL,                               // Mediums (NULL, 0 ==
>> default)
>>             0,
>>             SIZEOF_ARRAY( PinAudioFormatRanges_Wave ),
>>             PinAudioFormatRanges_Wave,
>>             KSPIN_DATAFLOW_OUT,                 // Dataflow
>>             KSPIN_COMMUNICATION_SINK,           // 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 <PFNKSINTERSECTHANDLEREX> // 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_IN,
>>             KSPIN_COMMUNICATION_NONE,
>>             &KSCATEGORY_AUDIO,                  // Category
>>             &g_PINNAME_AUDIO_RENDER,           // Name
>>             0
>>         },
>>         0,
>>         0,
>>         0,
>>         NULL,
>>         NULL
>>     },
>>
>> };
>>
>> Along with that I am using two volume nodes. So KsStudio shows my 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  |         ------------          |
>> //                 |                               |
>> //                   --------------------------
>>
>>  This is not true. The driver can have both a render and capture pin on a
>> single filter. (This is how the USB Audio class driver works.). As to why
>> this is not working, I am not sure. I would need more info on the topology.
>> KsStudio.exe may be your friend here if you have the WDK.
>>
>>
>>
>>
>>
>> DJ
>>
>>
>>
>> *From:* wdmaudiodev-bounce@xxxxxxxxxxxxx [mailto:
>> wdmaudiodev-bounce@xxxxxxxxxxxxx] *On Behalf Of *Tim Roberts
>> *Sent:* Tuesday, January 13, 2009 9:39 AM
>> *To:* wdmaudiodev@xxxxxxxxxxxxx
>> *Subject:* [wdmaudiodev] Re: AVStream driver as a both Capture and
>> Renderer Filter
>>
>>
>>
>> swapnil kamble wrote:
>>
>>
>>                      I am having problems in designing topology for my
>> driver. I have developed Capture/Renderer filter with following topology
>> works perfectly fine for me.
>> ...
>>
>> But when I combine both of them and make topology as,
>>
>>
>> Why are you trying to combine then?
>>
>>
>>   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 ?
>>
>>
>> There is certainly one very big problem with this topology:  a single
>> filter cannot be both a source (capturer) and a sink (renderer).  Are you
>> trying to make a transform filter?
>>
>> --
>>
>> Tim Roberts, timr@xxxxxxxxx
>>
>> Providenza & Boekelheide, Inc.
>>
>>
>>
>>
>> --
>> ...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: