Geek TV: open source rocks

I’ve said it before, and you’ve heard it before me, but open source rocks.

I had a problem with MediaPortal that was bugging me. Certain things were taking too long, and too much memory. Long story short, I worked around the problem, in code, it in a couple hours of work. Given that it would have taken a similar amount of less intellectually stimulating work to find such a problem in a closed-source program, and I probably wouldn’t have been able to fix it, I consider this a great thing.

If you want lots of detail about the problem, and maybe its ultimate resolution, you can check out the forum thread I started over at MediaPortal support. We’ll see how that turns out. Could be that I’m an idiot, so my pointing to this thread may turn out to be a bad idea :-). Anyway, Slow graph rendering for analog card. I’ve reproduced my first three posts below for my own reference later, but you can read them too: I totally give you permission.


Slow graph rendering for analog card


I hope nothing in this message is obvious or dumb; I don’t know MediaPortal, DirectShow, or Microsoft TV technologies all that well. However, I did find a problem and found a workaround for it, so maybe with some help we can find the right fix for it.

On my system with a Hauppauge WinTV-HVR-1600, it takes a very long time (probably 90 seconds), with the CPU maxed out, to bring up the Edit form for the analog side of my card in Televison->Capture Cards in MediaPortal Setup. It also take a long time, with a maxed out CPU, for MediaPortal to start up.

The line of code that takes a long time is line 297 in TVCapture/Graphs/Analog/SinkGraph.cs (from tag “Version 0.2.2”, I’m trying to stay with the stable build)
int hr = _captureGraphBuilderInterface.RenderStream(cat, null/*new Guid[1]{ med}*/, _filterCapture, null, _mpeg2DemuxHelper.BaseFilter);

I don’t know how to debug further down, since that’s a call to Microsoft code. I did notice in my early investigation that there’s lots of registry activity that looked consistent with DirectShow searching hard for matching filters.

It does eventually find a rendering (hr is 0 upon return), and everything works from there.

I saw that there is fallback code after the line above. So, I commented out the line (and the three lines after, and re-declared ‘int hr’) and let the fallback code try. It quickly finds an acceptable answer. After that change, the setup dialog comes up quickly, MediaPortal starts quickly, and analog TV is still available for viewing and tuning.

This problem may have become worse after I installed Nero ShowTime, which probably installs some DS filters. I’ll have to try uninstalling that to see if that really was a factor.

What are some good next steps to narrow down this problem and find the right solution? Or, is there enough data here for someone else who knows this system better to fix it?

[By the way, in looking at this, I noticed that the FillInAll method in EditCaptureCardForm gets called three times in the process of bringing up the form. I suspect it really only needs to be called once, which would lessen the problems with the form coming up.]



Here’s a little more info. Nero is possibly part of the problem, but definitely not all of it.

Here are the actual timings for bringing up the Edit form in a few situations. (The ’90 seconds’ above was just a guess).
Original configuration: 196 seconds
After uninstalling Nero completely (I had a mishmash of OEM 6 Suite and Ultra 7 Suite installed; I uninstalled and deleted everything I could find): 20 seconds
With the workaround described above (removing the call to RenderGraph): 1 second


And some more info:

After I reinstalled part of the Nero Ultra 7 Suite (details below), the Edit form took 168 seconds (without the code workaround). So Nero must be installing some filter(s) that are confusing to DirectShow’s search. However, if I capture the filter graph in GraphEdit before executing the RenderGraph, then render various pins in the graph, none of them take very long.

Nero likes DS filters; Program FilesCommon FilesAhead includes 46 files with extension .ax. (I deleted that directory before installing the Suite again, so I know these are Nero-related files).

Now, the question is: is there something wrong with how MediaPortal sets up its graph, or is it something bad about Nero’s filters? Or does it really matter, since Nero is a fact of life and it seems likely that MediaPortal can work around the situation?

Here’s what I installed from Nero:
Burning ROM

CD-DVD Speed

But I didn’t install:

Fast CD-DVD Burning Plugin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.