Re: filter graph freezing

Tech-Archive recommends: Speed Up your PC by fixing your registry



On Fri, 17 Aug 2007 10:53:49 -0400, Chris P. wrote:

On Thu, 16 Aug 2007 22:31:54 +0100, Richard Jones wrote:

Thanks everyone.

I think I've found the problem - well almost.

I inserted a null transform filter and monitored what audio passed beween
AVI splitter and DV Mux. The files that caused problems are those which pass
data in 96000 byte sized IMediaSamples. When the graph is run, the first two
of these samples pass through but then no more. The graph just stops
executing but still reports that it is in "playing" state.

Using the same files, but hacking the output size of the samples from my
null transform filter to (for example) 192000 bytes the graph ran to
completion (although half of the audio data was obviously rubbish).

Why 96000 byte sized samples cause the DV Mux to stop is a mystery, but it
does appear to be a bug.

Would have to do some more digging into the CheckMediaType() to see what
size the DVMux is requesting. It would be quite easy to write a filter
that repacks the audio into 192000 byte samples, but first it's probably a
good idea to find out exactly why this is happening. A few of us have
source code access which we can use to dig deeper into this, but we will
need repro steps on how to produce a suitable sample or a sample file.

Richard gave me a sample and I reproduced the problem. It is posted below
for posterity.

"The DVMux filter has code to hold the audio samples for processing as it
may receive more audio than video (makes sense). It also has code that
instructs it to hold more than 1 audio sample for the case that a frame of
video is addressing audio that may span 2 audio samples. This was exactly
your case as there was 12.5 frames worth of audio in the first sample,
which required access to audio sample 0 and 1 simultaneously in order to
process video frame 13. However it didn't actually lock up until receiving
video frame 22 as it had 10 video frame buffers.

There is a bug with the way it uses the allocators, and only 1 audio sample
was being allocated by the allocator. This caused the second audio sample
being delivered to block, meaning it could never achieve it's desire to
have 2 audio samples available, resulting in a deadlock. I was able to
locally hack the DVMux code while running in memory to increase the audio
sample allocation to 2 which caused it to work perfectly. So a fix from
Microsoft is definitely possible, but I'm not sure how timely."

--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
.



Relevant Pages

  • Re: filter graph freezing
    ... I inserted a null transform filter and monitored what audio passed beween ... AVI splitter and DV Mux. ... When the graph is run, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: how to delay sound stream ?
    ... actual latency) so it sets the audio *out* of sync. ... transform filter. ... For example if an audio sample comes into the transform filter with a ... Iain Downs ...
    (microsoft.public.win32.programmer.directx.video)
  • Timestamp help
    ... I'm trying to get timestamp data from an audio stream. ... custom Transform Filter that passes the data onto a standard audio ... My goal is to use the Transform filter to strip out the ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Audio scrub
    ... scrubs the slider control, they can hear the audio in the speed they moved ... For your solution you will need to write a custom transform filter. ... The pitch shift isn't difficult to implement if you have some basic audio ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: How to get an audio output pin i a DirectShow transform filter
    ... >> build audio based on the video frame and render it. ... > CBaseFilter to make the transform happen with the extra output pin. ... Grab the source to CTransformFilter from the base classes and modify it ...
    (microsoft.public.win32.programmer.directx.video)