[mythtv] [patch] Fix for sluggish pause

Doug Larrick doug at ties.org
Wed Dec 1 03:21:08 UTC 2004

David Engel wrote:
> On Tue, Nov 30, 2004 at 10:55:07AM -0500, Doug Larrick wrote:
>>David Engel wrote:
>>>That's the problem!  Try changing the decoder_lock from a QMutext to a
>>>pthread_mutex_t and see if that helps.  I suspect it will, and will
>>>also get rid of the sched_yield which I didn't like anyway.  If you
>>>can't make the change, I will do it tonight.
>>I'll give it a try.  I might be able to get to this tonight.
> Well, pthread_mutex_t seems to have the same problem as QMutex in that
> a precess already waiting doesn't get priority over a process that
> releases, yields and reacquires. :(  IOW, the sched_yield is stil needed
> on UP and probably won't help much on SMP.  You can try mutex.patch for
> yourself if you like.
> getframe.patch partially implements my return early from NVP::GetFrame
> suggestion.  It's for testing only, but please give it a try.  If it
> works OK, I'll flesh it out.

I did some testing myself this evening, and yes, pthread_mutex_t doesn't 
help for me either.

What *does* work on my HyperThreaded box is replacing the sched_yield 
with a small usleep (I used 50; I notice you used 1000); either one 
should resolve to about 1 scheduler interval.

I am concerned though that this loop is spending way too much time just 
spinning during normal playback, especially with your getframe.patch. 
Maybe I'm being dense, but where exactly is it that it sleeps (rather 
than busy-waits) if we don't need a new frame yet?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20041130/1dc2638e/signature.pgp

More information about the mythtv-dev mailing list