[Openchrome-users] cle266: time spent in XvMCPutSurface() is longer than frame duration

Reinhard Nissl rnissl
Sat Jan 13 01:11:07 PST 2007


Hi,

I'm trying to optimize xine-lib's xxmc driver which uses
XvMCPutSurface() to display a video frame.

Typically, the time spent in this function is less then 1 ms. But
occationally, it happens that it needs 50 ms to process and then 20 ms.

Please have a look at the attached code fragment. This function is
called every 40 ms to display a frame. When bob-deinterlacing is
enabled, it first displays for example the top field. Then it sleeps ~20
ms and displays the bottom field.

I've instrumented the code with gettimeofday() calls to see how long it
takes to execute specific parts of the code. At the end of the function
the deltas are output on screen. In the attached output, dt4 lists the
time spent in the first call of XvMCPutSurface() and dt9 for the second.
The last column dt shows the total time spent for executing the code.

As you can see, dt4 and dt9 are typically less than 1 ms and dt6 shows
the time spent with sleeping (~20 ms) between the two calls to
XvMCPutSurface().

But at a certain point in time, dt9 rises immediately to more than 50 ms
and the total time spent to ~70 ms. As a result, xine tries to hurry up
and calls the output function immediately with the next frame. As a
result, dt4 and dt9 show values of about 20 ms. The total time spent
raises to over 40 ms, so xine continues to hurry up but the situation
doesn't improve. Finally, xine drops some frames and the time spent in
XvMCPutSurface() goes back to normal values.

The 20 ms seem to be the result of the video driver's waiting for the
next vblank interrupt. But I have no idea, why the issue starts
repeatedly at the second call to XvMCPutSurface() with a duration of
more than 50 ms.

Looks to me like a driver issue -- how could it be solved?
And why does XvMCSyncSurface() occasionally spend 56 or even 79 ms (dt3)?

BTW: I use a VIA EPIA MII-6000E, xorg.conf was taken from this location:
http://www.kingcot.eclipse.co.uk/unichrome/xorg.conf.txt, currently
there is no TV connected to S-Video, but a PC monitor to VGA. I took
this binary driver package:
http://www.logix.cz/michal/devel/suse-openchrome/OpenSUSE-10.2/xorg-x11-driver-video-7.2-33/RPMS/i586/xorg-x11-driver-video-7.2-33_openchrome.i586.rpm

Bye.
-- 
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl at gmx.de


-------------- next part --------------
A non-text attachment was scrubbed...
Name: code.txt.bz2
Type: application/x-bzip2
Size: 1653 bytes
Desc: not available
Url : http://wiki.openchrome.org/pipermail/openchrome-users/attachments/20070113/6629c604/code.txt-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.txt.bz2
Type: application/x-bzip2
Size: 16851 bytes
Desc: not available
Url : http://wiki.openchrome.org/pipermail/openchrome-users/attachments/20070113/6629c604/output.txt-0001.bin



More information about the Openchrome-users mailing list