Avstream usb audio driver clock issue with "Audio Capture Source"

hi all.

i have implementing a vendor specific usb audio client driver for Windows XP.

i am using graphedit application once the audio device is connected,
i find my device recognized in “WDM Streaming Capture Devices” and “Audio Capture Sources”.

If i select my device filter from “WDM Streaming Capture Devices” and render it and select play,there would be no problem wrt streaming ,but if i select my device filter from “Audio Capture Sources”,my attempt to get an interface to the master clock fails,

during KSSTATE_ACQUIRE

i am using this line of code for clock

if (!NT_SUCCESS (KsPinGetReferenceClockInterface ( m_Pin,
&m_Clock )
)) {
KdPrint((“m_Clock not assigned\n”));
// If we could not get an interface to the clock,
// don’t use one.
//
m_Clock = NULL;

}

ie.,clock was not assigned. so how to get the interface to the master clock?

thanks in advance

xxxxx@lntinfotech.com wrote:

i have implementing a vendor specific usb audio client driver for Windows XP.

i am using graphedit application once the audio device is connected,
i find my device recognized in “WDM Streaming Capture Devices” and “Audio Capture Sources”.

If i select my device filter from “WDM Streaming Capture Devices” and render it and select play,there would be no problem wrt streaming ,but if i select my device filter from “Audio Capture Sources”,my attempt to get an interface to the master clock fails,

during KSSTATE_ACQUIRE

ie.,clock was not assigned. so how to get the interface to the master clock?

If you can’t get a reference, then there isn’t one.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim

If you can’t get a reference, then there isn’t one.

yes its not there thats why my streaming with “Audio Capture Sources” not working.

but then why reference of clock for “WDM Streaming Capture Devices” is there??

whats the difference between clock reference in “WDM Streaming Capture Devices” filter and
“Audio Capture Sources” filter ?

if i am not getting the clock for filter then how should i start streaming without the clock reference?

Do i need to implement KSPIN_FLAG_IMPLEMENT_CLOCK flag in KSPIN_DESCRIPTOR_EX??

xxxxx@lntinfotech.com wrote:

> If you can’t get a reference, then there isn’t one.
>

yes its not there thats why my streaming with “Audio Capture Sources” not working.

but then why reference of clock for “WDM Streaming Capture Devices” is there??

whats the difference between clock reference in “WDM Streaming Capture Devices” filter and
“Audio Capture Sources” filter ?

if i am not getting the clock for filter then how should i start streaming without the clock reference?

Do i need to implement KSPIN_FLAG_IMPLEMENT_CLOCK flag in KSPIN_DESCRIPTOR_EX??

Audio devices often act as the master clock in a graph.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

hi tim,
“Audio devices often act as the master clock in a graph” can you plz elaborate on this??i did not get what you meant…

secondly,with “Audio Capture Sources” and “WDM Streaming Capture Devices” streaming happens,the only difference with “Audio Capture Sources” is that i am filling
ptr_Leading -> StreamHeader -> PresentationTime.Time and ptr_Leading -> StreamHeader -> OptionsFlags with zero as i have no clock.

so audio data gets played with “WDM Streaming Capture Devices” and does not get played with “Audio Capture Sources”…

any suggesstions would help me…

thank you,
avinash

xxxxx@lntinfotech.com wrote:

hi tim,
“Audio devices often act as the master clock in a graph” can you plz elaborate on this??i did not get what you meant…

What I mean is that, in a graph where there is an audio render filter,
that filter is often asked to BE the master clock because it has the
most urgent need for timing. That means you have to support
KSPROPERTY_STREAM_MASTERCLOCK.

Note that I do not KNOW whether this is the issue you’re seeing, but
it’s not impossible.

secondly,with “Audio Capture Sources” and “WDM Streaming Capture Devices” streaming happens,the only difference with “Audio Capture Sources” is that i am filling
ptr_Leading -> StreamHeader -> PresentationTime.Time and ptr_Leading -> StreamHeader -> OptionsFlags with zero as i have no clock.

so audio data gets played with “WDM Streaming Capture Devices” and does not get played with “Audio Capture Sources”…

What DO you see in that case?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim

>That means you have to support KSPROPERTY_STREAM_MASTERCLOCK.

As you told to support KSPROPERTY_STREAM_MASTERCLOCK
i have implemented it and just give a KdPrint but its not coming to the set and get handler of it.

DEFINE_KSPROPERTY_TABLE (MasterClkPinPropertyTable)
{
DEFINE_KSPROPERTY_ITEM
(
KSPROPERTY_STREAM_MASTERCLOCK, // property item defined in ksmedia.h
PropertyAudioMasterClock, // our “get” property handler
sizeof(KSPROPERTY), // minimum buffer length for property
sizeof(ULONGLONG), // minimum buffer length for returned data
PropertyAudioMasterClock, // our “set” property handler
NULL, // default values
0, // related properties
NULL,
NULL, // no raw serialization handler
0 // don’t serialize
)

};

DEFINE_KSPROPERTY_SET_TABLE (MasterClkPinPropertySetTable)
{
DEFINE_KSPROPERTY_SET
(
&KSPROPSETID_Stream, // property set defined in ksmedia.h
SIZEOF_ARRAY(MasterClkPinPropertyTable), // the properties supported
MasterClkPinPropertyTable,
0, // reserved
NULL // reserved
)

};

DEFINE_KSAUTOMATION_TABLE (AudioPinAutomationTable)
{
DEFINE_KSAUTOMATION_PROPERTIES (MasterClkPinPropertySetTable),
DEFINE_KSAUTOMATION_METHODS_NULL,
DEFINE_KSAUTOMATION_EVENTS_NULL
};

I have provided AudioPinAutomationTable to my pin automation table in KSPIN_DESCRIPTOR_EX.

const
KSPIN_DESCRIPTOR_EX
CaptureFilterPinDescriptors[CAPTURE_FILTER_PIN_COUNT] = {

//
// CLAUDIO_AUDIO_CAPTURE_PIN
//
{
&AudioCapturePinDispatch,
&AudioPinAutomationTable,
{
NULL, // default interfaces (NULL, 0 == default)
0,
NULL, // default mediums (NULL, 0 == default)
0,
SIZEOF_ARRAY(CapturePinDataRanges), // Range count (filled in later)
CapturePinDataRanges, // Ranges (filled in later)
KSPIN_DATAFLOW_OUT, // Dataflow
KSPIN_COMMUNICATION_BOTH, // Communication
&KSCATEGORY_AUDIO, // Category
&g_PINNAME_AUDIO_CAPTURE, // Name
0 // Reserved
},
// Flags
KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY,
1, // Instances Possible
1, // Instances Necessary
&AudioDefaultAllocatorFraming, // Allocator Framing (filled later)
reinterpret_cast // Intersect Handler
(CAudioCapturePin::IntersectHandler)
},

//
//CLAUDIO_MIC_BRIDGE_PIN
//
{
NULL,
NULL,
{
NULL, // default interfaces (NULL, 0 == default)
0,
NULL, // default mediums (NULL, 0 == default)
0,
SIZEOF_ARRAY(PinDataRangePointersBridge), // Range count (filled in later)
PinDataRangePointersBridge, // Ranges (filled in later)
KSPIN_DATAFLOW_IN, // Dataflow
KSPIN_COMMUNICATION_BRIDGE, // Communication
&KSNODETYPE_MICROPHONE, // Category
NULL, // Name
0 // Reserved
},
0,
0, // Instances Possible
0, // Instances Necessary
NULL, // Allocator Framing (filled later)
NULL, // Intersect Handler

}
};

NTSTATUS PropertyAudioMasterClock
(
IN PIRP pIrp,
IN PKSPROPERTY property,
IN OUT HANDLE handle
)
{KdPrint((“>>PropertyAudioMasterClock \n”));

if(property->Flags & KSPROPERTY_TYPE_SET){
// set property
KdPrint((“>>PropertyAudioMasterClock set property \n”));

}
else if(property->Flags & KSPROPERTY_TYPE_GET){
//get property
KdPrint((“>>PropertyAudioMasterClock get property \n”));

}

pIrp->IoStatus.Status = STATUS_SUCCESS;
return STATUS_SUCCESS;
}

i have also implemented KSPIN_FLAG_IMPLEMENT_CLOCK flag in KSPIN_DESCRIPTOR_EX but still its not getting any kdprint of get and set handler.

i have also given the callback function KSCLOCK_DISPATCH in KSPIN_DISPATCH.

const
KSCLOCK_DISPATCH
DispatchAudioPinClock ={
AudioPinSetTimer, // SetTimer
AudioPinCancelTimer, // CancelTimer
AudioPinCorrelatedTime, // CorrelatedTime
AudioPinResolution // Resolution
};

and just give a KdPrint in that functions but still not getting any call for that function.

and in my code i am not using KeSetTimer and DPCs

can any one tell why i am not getting any call for these functions.

>>What DO you see in that case?

i am getting the data from the device to my host driver but there is no clock interface so it cant render by render filter.

any suggesstions would help me…

Thanks
Avinash Nabait

Hi Avinash,

Do you fix this issue already? I also found out same issue as you.

HP

This thread is more than 10 years old. You need to create a new thread and describe your issue in detail.

Ok Thanks