Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AMCAP.exe and AVStream based driver issue

262 views
Skip to first unread message

Imti

unread,
Mar 19, 2008, 11:31:21 AM3/19/08
to
Hi Tim

I have a problem with my AVStream driver. The DispatchSetState is not
getting called.

When I try to run start capture/preview in AMCap.exe I get an error:
Error 8007048f: Cannot start Graph. And the windbg stack trace says
that the call after ks!CKsPin::Property_ConnectionState is failing.
This function is suppose to call ks!KspCreatePipeSection+0x45, however
it is not called, please help me out to figure out what could be the
issue.

The Normal stack trace is as below:
820025c0 00000001 00000000 avshws!CCapturePin::DispatchSetState [d:
\winddk\6001.17051\src\avstream\avshws\capture.h @ 243]
82002530 00000001 00000000 ks!CKsPin::ClientSetDeviceState+0x56
82388558 00000001 00000000 ks!
CKsPipeSection::DistributeStateChangeToPins+0x7b
81ecc008 00000001 00000000 ks!CKsQueue::SetDeviceState+0x25
81ecc008 00000001 00000000 ks!
CKsPipeSection::DistributeDeviceStateChange+0x1f
82002530 81ecc008 00000000 ks!CKsPipeSection::Init+0x3ba
00000000 82002530 81eafbb8 ks!KspCreatePipeSection+0x45
8204ae28 820025c0 81e94b28 ks!CKsPin::Property_ConnectionState+0x10a
8204ae28 00000003 f6b93130 ks!KspPropertyHandler+0x616
8204ae28 f6b93104 820025b4 ks!KspHandleAutomationIoControl+0x174
81efcf10 8204ae28 ba858c58 ks!CKsPin::DispatchDeviceIoControl+0xa7
81efcf10 8204ae28 806ee2d0 ks!DispatchDeviceIoControl+0x28
8204aebc 81ed1720 8204ae28 nt!IopfCallDriver+0x31
81efcf10 8204ae28 81ed1720 nt!IopSynchronousServiceTail+0x60
00000d18 00000d00 00000000 nt!IopXxxControlFile+0x611
00000d18 00000d00 00000000 nt!NtDeviceIoControlFile+0x2a
00000d18 00000d00 00000000 nt!KiFastCallEntry+0xf8

Can someone help me in knowing on what condition the DispatchSetState
doesn't get called.

Regards
Imtiaz Ahmed

Geraint Davies

unread,
Mar 20, 2008, 6:20:28 AM3/20/08
to
On Wed, 19 Mar 2008 08:31:21 -0700 (PDT), Imti <imtia...@gmail.com>
wrote:

>Hi Tim
>
>I have a problem with my AVStream driver. The DispatchSetState is not
>getting called.
>

Are you getting a state change from stop to acquire, or nothing at
all? Perhaps the state change is failing elsewhere in the graph --
what else is in the graph downstream of you?

Imti

unread,
Mar 21, 2008, 8:05:27 AM3/21/08
to
On Mar 20, 3:20 pm, Geraint Davies <gerai...@gdcl.co.uk> wrote:
> On Wed, 19 Mar 2008 08:31:21 -0700 (PDT), Imti <imtiazfi...@gmail.com>

> wrote:
>
> >Hi Tim
>
> >I have a problem with my AVStream driver. The DispatchSetState is not
> >getting called.
>
> Are you getting a state change from stop to acquire, or nothing at
> all? Perhaps the state change is failing elsewhere in the graph --
> what else is in the graph downstream of you?

Hi Geraint

Thanks for your prompt reply.

No state change is occuring. The wdm stream has an audio output pin
and an video pin. When I save the graph in AMCap2 and open in
GraphEdit, the video pin seems to be connected, however the audio pin
isn't connected to any of the decoders.

The AMCap application gets stuck at pMC->Run() call and the return
type of the call is NO INTERFACE as shown below

BOOL StartCapture()
{
BOOL f, fHasStreamControl;
HRESULT hr;

// way ahead of you
if(gcap.fCapturing)
return TRUE;

// or we'll get confused
if(gcap.fPreviewing)
StopPreview();

.......
...........
REFERENCE_TIME start = MAX_TIME, stop = MAX_TIME;

hr = gcap.pBuilder->ControlStream(&PIN_CATEGORY_CAPTURE, NULL,
NULL, &start, NULL, 0, 0);

fHasStreamControl = SUCCEEDED(hr);

IMediaControl *pMC = NULL;
hr = gcap.pFg->QueryInterface(IID_IMediaControl, (void **)&pMC);
if(FAILED(hr))
{
ErrMsg(TEXT("Error %x: Cannot get IMediaControl"), hr);
return FALSE;
}

if(fHasStreamControl)
hr = pMC->Run(); -----> This call fails.
else
hr = pMC->Pause();
if(FAILED(hr))
{
// stop parts that started
pMC->Stop();
pMC->Release();
ErrMsg(TEXT("Error %x: Cannot start graph"), hr);
return FALSE;
}
.....
......
}

Imti

unread,
Mar 22, 2008, 10:16:10 AM3/22/08
to

Hi All

Please help me on this issue as Iam going clueless..........

The following line in the AMCap application fails.

// create the capture filters of the graph. We need to keep them
loaded from
// the beginning, so we can set parameters on them and have them
remembered
//
BOOL InitCapFilters()
{


..........
.............

// We'll need this in the graph to get audio property pages
hr = gcap.pFg->AddFilter(gcap.pACap, wachAudioFriendlyName);
if(hr != NOERROR)
{
ErrMsg(TEXT("Error %x: Cannot add audio capture filter to
filtergraph"), hr);
goto InitCapFiltersFail;
}
.........
..........

}

Please help me on this, why this Audio pin is not getting added to the
graph.

Regards
Imtiaz Ahmed

The March Hare [MVP]

unread,
Mar 22, 2008, 10:36:58 AM3/22/08
to
On Sat, 22 Mar 2008 07:16:10 -0700 (PDT), Imti wrote:

> Please help me on this, why this Audio pin is not getting added to the
> graph.

What is the failed HRESULT?

What are the values of gcap.pACap and wachAudioFriendlyName?

--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution

Imti

unread,
Mar 22, 2008, 1:05:35 PM3/22/08
to
On Mar 22, 7:36 pm, "The March Hare [MVP]"


HRESULT = VFW_S_DUPLICATE_NAME
wachAudioFriendlyName = "CrusherCapture Source" which is my Dirver's
friendly Name
gcap.pACap = 0x00a8a8ec

Regards
Imtiaz Ahmed

The March Hare [MVP]

unread,
Mar 22, 2008, 1:17:48 PM3/22/08
to
On Sat, 22 Mar 2008 10:05:35 -0700 (PDT), Imti wrote:

> HRESULT = VFW_S_DUPLICATE_NAME

So the called succeeded :) You should use the SUCCEEDED() macro rather
than checking against NOERROR (S_OK).

From the doc page for IFilterGraph::AddFilter:

VFW_S_DUPLICATE_NAME Successfully added a filter with a duplicate name.

The March Hare [MVP]

unread,
Mar 22, 2008, 2:05:09 PM3/22/08
to
On Sat, 22 Mar 2008 11:17:48 -0600, The March Hare [MVP] wrote:

> You should use the SUCCEEDED() macro rather
> than checking against NOERROR (S_OK).

... or FAILED(hr) macro (same as !SUCCEEDED(hr))

Imti

unread,
Mar 24, 2008, 7:02:59 AM3/24/08
to
On Mar 22, 11:05 pm, "The March Hare [MVP]"

By Changing return type of AddFilter from NOERROR to SUCCEEDED() it
went further. However the Run function in the AMCap fails and the
return type is 0x8007048f "The Device is not connected".

BOOL StartCapture ()
{
.........
........


if(fHasStreamControl)
hr = pMC->Run();

else
hr = pMC->Pause();

..........
.........
}

Is something wrong with the DispatchSetFormat or what is going wrong
here, can someone help me.

Regards
Imtiaz Ahmed

The March Hare [MVP]

unread,
Mar 24, 2008, 5:34:36 PM3/24/08
to
On Mon, 24 Mar 2008 04:02:59 -0700 (PDT), Imti wrote:

> By Changing return type of AddFilter from NOERROR to SUCCEEDED() it
> went further. However the Run function in the AMCap fails and the
> return type is 0x8007048f "The Device is not connected".

Did you check that the device is connected in GraphEdit? (see the
REGISTER_FILTERGRPH #ifdef'd code in the samples)

Also, why are you adding two devices with the same name to your
filtergraph? (see original return code you asked about)

hung...@gmail.com

unread,
Jun 11, 2014, 12:19:43 PM6/11/14
to
Imtiaz,
Have you resolved this problem? Please give me some hint since I also have had a same problem. Thanks

and...@telemed.lt

unread,
Feb 26, 2016, 8:48:03 AM2/26/16
to
среда, 19 марта 2008 г., 17:31:21 UTC+2 пользователь Imti написал:
To note...
The same behavior you will get if you try to pause or start graph with not connected pin that has specified non zero InstancesNecessary value in the KSPIN_DESCRIPTOR_EX structure.
0 new messages