[mythtv] HD3000 buffer overrun solution - patches for hdtvrecorder.cpp/.h against mythtv 0.16

Eric Anderson rico99 at sbcglobal.net
Mon Dec 6 22:56:05 UTC 2004


Hi John -

If you can, please send me your patch. I'm interested to see how you 
did it.

Wow, 96MB of buffering. That's quite a bit. Especially with 3 going.

Clearly the more processing that gets in-lined with decoding the HDTV
stream makes it harder for an underpowered system to keep up. So while
it's nice to have the closed-caption information decoded, at some point
there's going to be a limit to how much can be decoded before you just
can't keep up. (Although -- *most* of the ATSC packets are still going
to be video information. So perhaps the amount of overhead processing
for things such as closed-caption and program information won't be so 
bad?)

Now, it sounds like with 3 streams and the new code, you're really not
keeping up while running Daniel's code. So your buffer is almost always
gradually filling, right? And when you finally overflow, it's pretty 
much game
over, if I understand correctly.

For my system, my original goal was to get just 1 stream working 
without buffer
overruns. And without the read() thread, I was getting buffer overruns 
whenever
I did any serious amount of disk or CPU activity.

I guess one thing that could be added would be a piece of code that 
computes
a moving average of the buffer depth over time. If the buffer is 
steadily increasing
over time, mythbackend could take some action. Examples:

          1. Simplest would be to print a warning as in:
             "Mythbackend is falling behind. Estimating %d seconds to 
buffer exhaustion..."

          2. Next easiest would be to try to turn off some of the backend
             decoding functionality (although I'm not sure how much you 
buy
             by doing that).

          3. Most complicated would be to spawn yet another thread and
             shuffle data to a temporary file. Unfortunately, by doing 
that you've
             now just increased the amount of I/O that you have to do by 
2x -- so
             it may be a losing proposition. Essentially, you get closer 
to doing a
             two-pass operation. But by the time you get this far, maybe 
it's time to
             buy a second PC to hold the 3rd card? =)

Regards.

-Eric

  
         



More information about the mythtv-dev mailing list