[mythtv-users] PVR250 + TVWonder = jerky

Isaac Richards ijr at po.cwru.edu
Wed Jun 4 21:37:57 EDT 2003


On Wednesday 04 June 2003 07:21 pm, michael at optusnet.com.au wrote:
> It may paper over the problem, but the underlying cause will
> still exist.
>
> The basic problem is long standing. That is, RingBuffer::safe_read
> doesn't handle the request windowing correctly.
>
> The logic you've currently got there is
>
>         if there's less than one requests worth of data buffered then
>                 send off a 'random' number of requests for more blocks.
>         munch data and return it.
>
> If the supplier is normally fast (i.e. it's normally reading from
> disk, but every now and then runs slow because there's a sync() or
> similar) then you'll get infrequent random rebuffering.
>
> The real solution (as I think was mentioned some time ago) is to
> count the number of requests outstanding, and ensure that that
> number doesn't drop below a given threshold. (i.e. no less
> than 5 requests outstanding or some such).
>
> (And no, the the read ahead code doesn't fix this. It just hides the
> problem a bit more).

Nope.  The issue is that due to the scheduler and the way all backend requests 
are synced and due to them using the Qt event loop and everything, there's a 
limited number of requests you can make of the backend in any given time 
period.  Simply requesting blocks more often doesn't help -- it's still bound 
by that limit.  Requesting _more_, however, does.

Just for fun, I tried out your previous patch and it had absolutely no effect 
on very high bitrate ( > 14000 kbps) streams.

Isaac


More information about the mythtv-users mailing list