Log in

View Full Version : DirectShowSource and MpaDecFilter not working


stax76
5th June 2008, 22:31
I would like to submit a bug report but I'm not sure where to send. There is not much to say, DirectShowSource won't render audio on every file that would render fine with MpaDecFilter. Log file is here (http://www.2shared.com/file/3394557/fb3e013f/buglog.html).

Reproduce it as follows:

Download MpaDecFilter here (http://sourceforge.net/project/showfiles.php?group_id=170561&package_id=264678&release_id=582299)
Register it
Open a video file with GraphStudio, check if MpaDecFilter is there, config dshow if not
Create AviSynth script with code: DirectShowSource("path to video file", timeout=5000)
Open script with MPC or GraphStudio, there is no sound, there would be if you open the video directly without AviSynth

IanB
5th June 2008, 23:58
Yes, here is the right place to discuss problems with Avisynth ands its component.

What would you like me to do, it correctly connected to a decoder (I assume is MpaDecFilter) that offered 24000Hz, 16bit Stereo audio.00:00:00.141 001 0x01568040 0x000008F0 GetSample::QueryAccept(audio) MEDIATYPE_Audio
00:00:00.141 001 0x01568040 0x000008F0 *** Audio: Accepted! Channels:2. Samples/sec:24000. Bits/sample:16. Type:2
00:00:00.172 002 0x01568040 0x000004D4 GetSample::NewSegment(0, 233600000, 1.000000) (audio)
00:00:05.172 020 0x01568040 0x000008F0 ** TIMEOUT ** waiting for Graph to start!For whatever reason DirectShow did not return from the start call within the 5 second limit you imposed, the default timeout limit is 60 seconds. So DirectShowSource abandoned the audio track and proceeded with just the video.

The problem is more likely to be the DirectShow Splitter or Source, which I cannot divine from the information provided.

stax76
6th June 2008, 04:15
I've pmed Casimir666 after creating this thread pointing him to read here. It's not the splitter or src causing the issue.

IanB
6th June 2008, 07:03
Just a thought MpaDecFilter is not parsing or otherwise reading the entire file on open, if so increase the timeout value to be greater than the time it take to parse (whatever) the file.

And my crack about Splitter or Source and Divining was a hint that you should confess that information as it may well be very relevant.

stax76
7th June 2008, 13:38
Increasing timeout don't help (I'm not such a n00b ;-), any dshow app renders it, that is a strong indication the bug is in AviSynth.

IanB
8th June 2008, 14:34
@stax,

Okay,

1. Do DirectShowSource(...., logfile=bug.log, video=false, logmask=-1), post that log!
2. What is the type of the file?
3. What DS Splitter are you using?
4. What DS Source Filter are you using?
5. Is the audio stream really 2:42:13.333 long?
6. What is your OS and HW?

stax76
8th June 2008, 19:05
I created a 7z file making it easy for you (wasn't hard though) to reproduce, contains following files:

test.avs
clip.mp4
graphstudio.exe
log.txt
MpaDecFilter.ax
reg.bat
unreg.bat

mirror 1: http://www.2shared.com/file/3406329/ed565c0f/MpaDecFilter_bug.html
mirror 2: http://www.mediafire.com/?w2lm1tmy3xj

Do DirectShowSource(...., logfile=bug.log, video=false, logmask=-1), post that log!

Log file is included in 7z file.

What is the type of the file?

Tried avi with mp3 and mp4 with aac, sample is included in the 7z file.

What DS Splitter are you using?
What DS Source Filter are you using?

avi: File Source (Async.)
mp4: Haali Media Splitter

Is the audio stream really 2:42:13.333 long?

I don't remember the file but I don't think I had/have such a long file.

What is your OS and HW?

XP MCE 2005 (that is XP Pro + MCE with SP2 IIRC) SP3, Athlon 64 X2 5200+, Gigabyte board with AMD 770 Chipset

IanB
12th June 2008, 01:30
Try this :- AviSynth_080612.exe (http://avisynth2.sourceforge.net/AviSynth_080601.zip). If it works, I will put up a RC2 with this DSS.

MpaDecFilter correctly does this negotiation for a sample buffer allocator. DSS does not implement one so MpaDecFilter notifies that it will be using 0x0156313c :-00:00:00.140 008 0x015675E0 0x00000A50 GetSample::GetAllocatorRequirements(0, 0, 0, 0)
00:00:00.140 008 0x015675E0 0x00000A50 GetSample::GetAllocator() E_NOTIMPL
00:00:00.140 008 0x015675E0 0x00000A50 GetSample::NotifyAllocator(0x0156313c, 0) (audio)

Latter on it again asks for DSS's allocator, which it should already know from the previous negotiation that none is implemented, Doh!. MpaDecFilter should not have done this call here :-00:00:00.159 008 0x015675E0 0x00000F90 GetSample::QueryInterface({56a8689d-0ad4-11ce-b03a-0020af0ba770}, ppv)
00:00:00.159 008 0x015675E0 0x00000F90 GetSample::GetAllocator() E_NOTIMPL
It should be just using the negotiated Allocator, 0x0156313c.

Even worse it should not just hang when a method call gives it a result it does not like. I suspect the thread just suicides without releasing any locks or reporting an error.

And worse still if it was connecting to an IPin that implements an allocator that is not the one as negotiated then I suspect thing would get a little confused internally.

As a work around I now remember the negotiated Allocator and feed it back in subsequent GetAllocator() calls.

stax76
12th June 2008, 06:41
I don't know enough about dshow to understand what the problem was but I can confirm that it's working now. It seems you are expecting people to put there best into a support request. I understand that and I might have to rethink how I submit support requests and what I should expect from people submitting request to me. Thanks for the support and work on AviSynth.

IanB
12th June 2008, 12:16
@stax,

Glad to hear the workaround has solved your problem. Sorry if I seemed a little short here, but debugging DirectShow issues is not one of my favourite pastimes. I have learned to extract all the possibly necessary info with all the I's doted and T's crossed before I start. And the level of detail in the answer is really intended for Cas.