[wdmaudiodev] Virtual Audio Device + Device Not Found Error

  • From: "Dale Hill" <daleh@xxxxxxxxxxxxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 6 Apr 2011 21:06:55 -0600

All,

 

I'm developing a Virtual audio filter based on avstream to perform rendering
and capturing.

Using GraphEdit, I am able to insert my filter and connect the capture
output of avssamp to the render input of my filter. But, when I try to start
the graph I get the following error message:

"This graph cannot play. The device is not connected (Return Code:
0x8007048F)". This message appears immediately before SetState or Process
gets called. Below is the descriptor describing the filter. Any ideas would
be greatly appreciated.

 

Thanks!

 

 

// Filter Descriptors

//

// Pin Data Range

const 

KSDATARANGE_AUDIO

FilterPinDataRange =

{

     {

           sizeof(KSDATARANGE_AUDIO), // Format Size

           0,                   // Flags

           0,                   // Sample Size

           0,                   // Reserved

           STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),     // Major Format

          STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),    // Format Sub Type

           STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX),   // Format
Specifier

     },

     MAX_AUDIO_CHANNELS,                  // Max Channels

     BITS_PER_SAMPLE,                     // Max Bits per sample

     BITS_PER_SAMPLE,                     // Min Bits per sample

     MIN_SAMPLE_FREQ,                     // Min Sample Frequency

     MAX_SAMPLE_FREQ                      // Max Sample Frequency

};

 

const 

PKSDATARANGE 

FilterPinDataRanges[1] = {(PKSDATARANGE)&FilterPinDataRange};

 

// Framing Requirements

DECLARE_SIMPLE_FRAMING_EX(

    FilterPinAllocatorFraming,                  // Structure Name

    STATICGUIDOF(KSMEMORY_TYPE_KERNEL_NONPAGED),// Memory Type

    KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY,     // Flags

     MAX_OUTSTANDING_FRAMES,                    // Frames Outstanding

     1,                                         // Alignment

     FRAME_SIZE,                                // Min Frame Size

     FRAME_SIZE);                               // Max Frame Size

 

// Capture Pin Dispatch Table

const 

KSPIN_DISPATCH 

FilterCapturePinDispatch = 

{

     CFilterCapturePin::DispatchCreate,   // Pin Create

    NULL,                                  // Pin Close

    CFilterCapturePin::DispatchProcess,    // Pin Process

    NULL,                                  // Pin Reset

    CFilterPin::DispatchSetFormat,         // Pin Set Data Format

    CFilterPin::DispatchSetState,          // Pin Set Device State

    NULL,                                  // Pin Connect

    NULL,                                  // Pin Disconnect

    NULL,                                  // Clock Dispatch

    NULL                                   // Allocator Dispatch

};

// Render Pin Dispatch Table

const 

KSPIN_DISPATCH 

FilterRenderPinDispatch = 

{

     CFilterRenderPin::DispatchCreate,    // Pin Create

     NULL,                                // Pin Close

    CFilterRenderPin::DispatchProcess,     // Pin Process

    NULL,                                  // Pin Reset

    CFilterPin::DispatchSetFormat,         // Pin Set Data Format

    CFilterPin::DispatchSetState,          // Pin Set Device State

    NULL,                                  // Pin Connect

    NULL,                                  // Pin Disconnect

    NULL,                                  // Clock Dispatch

    NULL                                   // Allocator Dispatch

};

//

// Pin Descriptors

//

const

KSPIN_DESCRIPTOR_EX

FilterPinDescriptors[] = 

{

     // Render Pin

     {

           &FilterRenderPinDispatch,  // Dispatch Table

           NULL,                      // Automatic Table,

           {                          // KSPIN_DESCRIPTOR

                0,                   // Interface Count

                NULL,                // Interfaces

                0,                   // Media Count

                NULL,                // Media Types

                SIZEOF_ARRAY(FilterPinDataRanges), // Data Range Count

                FilterPinDataRanges,            // Data Range

                KSPIN_DATAFLOW_IN,              // Data Flow,

                KSPIN_COMMUNICATION_BOTH,       // Communications

                &KSCATEGORY_AUDIO,              // Catagory GUID

                &KSCATEGORY_AUDIO,              // Pin name GUID

                0                               // Reserved

           },

           KSPIN_FLAG_GENERATE_MAPPINGS                    | // Flags

           KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING   | 

        KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING              | 

        KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY               | 

        KSPIN_FLAG_FIXED_FORMAT                            |

           KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING            |    

           KSPIN_FLAG_USE_STANDARD_TRANSPORT               |               

           KSPIN_FLAG_RENDERER,                                 

           MAX_RENDER_PINS,                     // Instances Possible

           0,                                   // Instances necessary

           &FilterPinAllocatorFraming,          // Frameing 

 
reinterpret_cast<PFNKSINTERSECTHANDLEREX>(CFilterPin::IntersectHandler)

     },

     

     // Capture Pin

     {

           &FilterCapturePinDispatch,      // Dispatch Table

           NULL,                           // Automatic Table,

           {                               // KSPIN_DESCRIPTOR

                0,                         // Interface Count

                NULL,                      // Interfaces

                0,                         // Media Count

                NULL,                      // Media Types

                SIZEOF_ARRAY(FilterPinDataRanges),   // Data Range Count

                FilterPinDataRanges,       // Data Ranges

                KSPIN_DATAFLOW_OUT,        // Data Flow,

                KSPIN_COMMUNICATION_BOTH,  // Communications

                &KSCATEGORY_CAPTURE,       // Catagory GUID

                &KSCATEGORY_CAPTURE,       // Pin name GUID

                0                          // Reserved

           },

           KSPIN_FLAG_GENERATE_MAPPINGS         | // Flags

           KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY | 

        KSPIN_FLAG_FIXED_FORMAT                 |

           KSPIN_FLAG_USE_STANDARD_TRANSPORT,   

           MAX_CAPTURE_PINS,                    // Instances Possible

           0,                                   // Instances necessary

           &FilterPinAllocatorFraming,          // Framing 

 
reinterpret_cast<PFNKSINTERSECTHANDLEREX>(CFilterPin::IntersectHandler)


     }

};

 

// Filter Categories

const

GUID

FilterFilterCategories[2] = 

{

     STATICGUIDOF(KSCATEGORY_RENDER),

     STATICGUIDOF(KSCATEGORY_CAPTURE)

};

 

// Filter Dispatch Table

const

KSFILTER_DISPATCH 

FilterFilterDispatch = 

{

     CFilterAudioFilter::DispatchCreate,        // Filter Create

     NULL,                                      // Filter Close

     NULL,                                      // Filter Process

     NULL                                      // Filter Reset

};

 

// Filter Descriptor

const

KSFILTER_DESCRIPTOR

FilterFilterDescriptor = 

{

     &FilterFilterDispatch,               // Dispatch Table

     NULL,                                // Automatic Table

     KSFILTER_DESCRIPTOR_VERSION,         // Version

     0,                                   // Flags

     &KSNAME_Filter,                      // Reference GUID

     DEFINE_KSFILTER_PIN_DESCRIPTORS(FilterPinDescriptors),     

     DEFINE_KSFILTER_CATEGORIES(FilterFilterCategories),  // Catagory Count
and catagories

     DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL,     // Node Count, Size,
Descriptor

     DEFINE_KSFILTER_DEFAULT_CONNECTIONS, // Connection Count and
Connections

     NULL

};

 

//

// Device and filter Descriptors

//

// FilterFilterDescriptor:

//

// The filter descriptor for the Filter Filter.

DEFINE_KSFILTER_DESCRIPTOR_TABLE (FilterDescriptors) 

{ 

    &FilterFilterDescriptor

};

 

Other related posts: