[mythtv] Jumpy dvd playback - thread contention

John Harvey john.p.harvey at btinternet.com
Wed Nov 18 07:57:57 UTC 2009


I have a problem playing back dvd's on a low powered system. Dual Core Atom
using vdpau graphics.
If the DVD's are imported and played from disk (local or network) it is
fine.
The playback is very jumpy and after digging around the problem is caused by
locking in dvdnav between avformatdecoder & dvdringbuffer.

Both call IsInMenu which calls into dvdnav_is_domain which does a lock.
For some reason avformatdecoder fails to get the lock for up to about a
second which causes the jumpy behaviour.

Just before calling that it avformatdecoder cals DVD()->CellChanged() &
DVD->InStillFrame() which are stored in DVDRingBuffer & don't do any
locking. 

As a test i modified IsInMenu to cache the state and only call dvdnav to
update the cached value from methods in DVDRingBuffer that fetch new data.

Since avformatdecoder doesn't try to get a lock this seems to fix the
problem but could someone confirm whether or not this change seems
reasonable? If so i will submit a patch.

This doesn't really explain why avformatdecoder was being starved of the
lock in dvdnav but i nothing seems to change that,(enable/disable real time
threads, different sync methods, enable/disable hyperthreading).
I am running on ubuntu 9.10.

Thanks
JOhn



More information about the mythtv-dev mailing list