[mythtv] MythTv with Via XvMc MPEG Decoding: Motion jitter
Terry Barnaby
terry1 at beam.ltd.uk
Fri Sep 17 08:22:33 EDT 2004
Hi,
I have got a bit further on this issue.
In MythTv the frame sync system, has changed quite a bit and is
now performed in the vsync.c file. This now chooses what
it thinks is the best timing system to use.
On the Via M10000 system the vsync algorithem chooses to
use the DRM vsync interrupt system. This is fine by me (as I
added the VSYNC Interrupt :) ), but it appears to cause
frame output instability. If you disable the DRM vsync interrupt
system (comment out in VideoSync::BestMethod()) so that MythTv uses
the linux RTC, all looks much better.
Delving into the DRM vsync interrupt system, there is a call
to VideoSync::KeepPhase() in DRMVideoSync::WaitForFrame().
This seems to be the root of the problem. Remove this and
things appear fine (I am at work viewing on a VGA monitor rather
than PAL TV). With KeepPhase() the peak discrepancy in
the frame display time is around 26ms and without it it is
around 10ms. I note that the Vsync interrupt at work is
60Hz when connected to a VGA screen with my X-Server mode lines.
The code in VideoSync::KeepPhase() doesn't seem right to me ...
void VideoSync::KeepPhase()
{
// Keep our nexttrigger from drifting too close to the exact retrace.
// If delay is near zero, some frames will be delay < 0 and others
// delay > 0 which would cause continous rapid fire stuttering.
// This method is only useful for those sync methods where WaitForFrame
// targets hardware retrace rather than targeting nexttrigger.
// cerr << m_delay << endl;
if (m_delay < -(m_refresh_interval/2))
OffsetTimeval(m_nexttrigger, 200);
else if (m_delay > -500)
OffsetTimeval(m_nexttrigger, -2000);
}
Terry
Terry Barnaby wrote:
> Hi All,
>
> I have just had a chance to look at the motion "artifacts" problem
> with using the latest Via XvMc MPEG Decoding with MythTv.
>
> There is a large amount of motion jitter on the display. I have
> narrowed this down to some problem with MythTv 0.16 CVS.
>
> My System:
> M10000 Via system running Fedora Core 2.
> Kernel 2.6.7 with DRM from CVS date 2004-9-12.
> Unichrome Via X driver from CVS 2004-9-16, AGP-DMA enabled
> Unichrome Via libXvMC library from CVS 2004-9-16
> MythTv from CVS + XvMC QMatrix mods.
>
> My Tests:
> 1. Using MythTv 0.16 CVS there is a large amount of jitter both using
> the Via XvMc MPEG Decoding and the internal software decode
> with Xv display output.
> I am unable to turn on Vertical sync mode with 0.16, it seems
> to have been removed (experemental AV sync).
>
> 2. Using MythTv 0.15.1 the display looks good with both the Via XvMc
> MPEG Decoding and the internal software decode with Xv display
> output. Using Via XvMc MPEG decoding CPU usage is about 12%.
> If I enable Vertical sync mode the picture quality is still
> very good, but additionally when a jump forward in the video
> is performed (cursor right key) the display restarts quickly
> and cleanly. Without Vertical sync mode there is a period of
> about 3 seconds of display sluggishness.
>
> So the motion jitter problem seems to be an issue with a new
> synchronisation scheme in MythTv. Note I am running MythTv as root
> still so the Real-time mode is enabled.
>
> The Chroma QMatrix code does not seem to have made much difference
> that I can see as yet, but I have been focassing on the motion problems
> ....
>
> I will investigate further today.
>
> Terry
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
--
Dr Terry Barnaby BEAM Ltd
Phone: +44 1454 324512 Northavon Business Center, Dean Rd
Fax: +44 1454 313172 Yate, Bristol, BS37 5NH, UK
Email: terry at beam.ltd.uk Web: www.beam.ltd.uk
BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software
"Tandems are twice the fun !"
More information about the mythtv-dev
mailing list