Terry Barnaby wrote:
Terry Barnaby wrote:
Hi,

I am trying to track down a problem I have with MythTv under Fedora 8 using
the openchrome driver and libchromeXvMC library.
MythTv has a lot of juddering and glitches even though the XvMC VLD
acceleration is in use.
This is also present with the stock via driver and libviaXvMC library.

Using the old mp2decoder XvMC test program I see that sending one
frame at 25Hz uses about 12% CPU. If I modify  mp2decoder to send
two frames at 50Hz (Just calling XvMCPutSurface twice with the same
frame) the CPU usage shoots up to 98%. This is equivalent to
MythTv outputting in BOB de-interlace mode and appears to show the
same problem I have with MythTv.

I guess this could be a libchromeXvMC/libviaXvMC or DRM issue.
Has anyone any idaes on this ?

Cheers


Terry


_______________________________________________
openchrome-users mailing list
[email protected]
http://wiki.openchrome.org/mailman/listinfo/openchrome-users
Main page:
http://www.openchrome.org
Wiki:
http://wiki.openchrome.org
User Forum:
http://wiki.openchrome.org/tikiwiki/tiki-view_forum.php?forumId=1


I have tracked this down a bit further.
The syncVideo() routine is being called from pciFlush() with doSleep = 0.
This is sitting in a tight loop for 20ms (I guess until the next VSYNC ??).
Even setting doSleep to 1 does not fix the issue as in MythTv the
output thread is a Realtime thread and nanosleep() is, I believe, implemented
as a tight loop when call from a real-time thread.

I'm not sure of exactly the best way to fix this issue ...
Does syncVideo() wait for the next VSYNC period ?

Cheers


Terry
Hi,

The enclosed patches reduce the CPU usage while using MythTv from 98% to about 40% on a Via M10K. One is for the Openchrome library and the other is for the
stock via library. These may not be the best way of curing this problem, but I
thought it might help some people or at least give a pointer to possible
solutions.

Cheers


Terry

diff -u -r xf86-video-openchrome-0.2.900-orig/libxvmc/viaLowLevel.c xf86-video-openchrome-0.2.900/libxvmc/viaLowLevel.c
--- xf86-video-openchrome-0.2.900-orig/libxvmc/viaLowLevel.c	2007-09-10 20:57:07.000000000 +0100
+++ xf86-video-openchrome-0.2.900/libxvmc/viaLowLevel.c	2007-12-23 06:40:51.000000000 +0000
@@ -378,7 +378,7 @@
     struct timezone here;
     struct timespec sleep, rem;
 
-    sleep.tv_nsec = 1;
+    sleep.tv_nsec = 100000;
     sleep.tv_sec = 0;
     here.tz_minuteswest = 0;
     here.tz_dsttime = 0;
@@ -487,7 +487,7 @@
     if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D))
 	syncAccel(xl, mode, 0);
     if (mode & LL_MODE_VIDEO)
-	syncVideo(xl, 0);
+	syncVideo(xl, 1);
     if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE))
 	syncMpeg(xl, mode, 0);
     ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b));
@@ -540,7 +540,7 @@
 	if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D))
 	    syncAccel(xl, mode, 0);
 	if (mode & LL_MODE_VIDEO)
-	    syncVideo(xl, 0);
+	    syncVideo(xl, 1);
 	if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE))
 	    syncMpeg(xl, mode, 0);
 	ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b));
diff -u -r xf86-video-via-0.2.2-orig/src/xvmc/viaLowLevel.c xf86-video-via-0.2.2/src/xvmc/viaLowLevel.c
--- xf86-video-via-0.2.2-orig/src/xvmc/viaLowLevel.c	2006-10-11 23:28:51.000000000 +0100
+++ xf86-video-via-0.2.2/src/xvmc/viaLowLevel.c	2007-12-23 06:37:20.000000000 +0000
@@ -378,7 +378,7 @@
     struct timezone here;
     struct timespec sleep, rem;
 
-    sleep.tv_nsec = 1;
+    sleep.tv_nsec = 100000;
     sleep.tv_sec = 0;
     here.tz_minuteswest = 0;
     here.tz_dsttime = 0;
@@ -487,7 +487,7 @@
     if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D))
 	syncAccel(xl, mode, 0);
     if (mode & LL_MODE_VIDEO)
-	syncVideo(xl, 0);
+	syncVideo(xl, 1);
     if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE))
 	syncMpeg(xl, mode, 0);
     ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b));
@@ -540,7 +540,7 @@
 	if ((mode & LL_MODE_2D) || (mode & LL_MODE_3D))
 	    syncAccel(xl, mode, 0);
 	if (mode & LL_MODE_VIDEO)
-	    syncVideo(xl, 0);
+	    syncVideo(xl, 1);
 	if (mode & (LL_MODE_DECODER_SLICE | LL_MODE_DECODER_IDLE))
 	    syncMpeg(xl, mode, 0);
 	ret = drmCommandWrite(xl->fd, DRM_VIA_PCICMD, &b, sizeof(b));
_______________________________________________
openchrome-users mailing list
[email protected]
http://wiki.openchrome.org/mailman/listinfo/openchrome-users
Main page:
http://www.openchrome.org
Wiki:
http://wiki.openchrome.org
User Forum:
http://wiki.openchrome.org/tikiwiki/tiki-view_forum.php?forumId=1

Reply via email to