[mythtv-users] Playback stoppyand go-y. Ie super-duper-uber-jittery.

Greg Stark gsstark at mit.edu
Tue Mar 28 18:03:23 UTC 2006


Greg Stark <gsstark at MIT.EDU> writes:

> So my question is, what does mythfrontend use to handle vsync if it's _not_
> using opengl vsync? Reading the code it seems to base it on some calculated
> refresh rate, but where does it get that refresh rate?

Ok, it seems it uses XF86VidModeGetModeLine to calculate a refresh rate. And
the ATI driver appears to be giving a bogus value that makes mythtv think the
refresh rate is 434Khz. I could see how that would confuse mythtv.

I submitted an xorg bug report:
https://bugs.freedesktop.org/show_bug.cgi?id=6421

But it seems like mythtv can easily protect itself here. It already defaults
to 60hz if it can't get any refresh rate from X. I would say it should also
fail over to the default if the refresh rate it gets from X is unreasonable.

Something like this (untested):

cd /r3/usr_local/src/mythtv-0.19/libs/libmythtv/
diff -u /r3/usr_local/src/mythtv-0.19/libs/libmythtv/videoout_xv.cpp.\~1\~ /r3/usr_local/src/mythtv-0.19/libs/libmythtv/videoout_xv.cpp
--- /r3/usr_local/src/mythtv-0.19/libs/libmythtv/videoout_xv.cpp.~1~	2006-02-08 11:38:17.000000000 -0500
+++ /r3/usr_local/src/mythtv-0.19/libs/libmythtv/videoout_xv.cpp	2006-03-28 13:02:40.000000000 -0500
@@ -422,10 +422,15 @@
     double rate = (double)((double)(dot_clock * 1000.0) /
                            (double)(mode_line.htotal * mode_line.vtotal));
 
-    // Assume 60Hz if we can't otherwise determine it.
-    if (rate == 0)
-        rate = 60;
-
+    // Assume 60Hz if we can't otherwise determine it
+    // or if it's an unreasonable value
+    if (rate < 20 || rate > 200) {
+      VERBOSE(VB_PLAYBACK, LOC + QString(
+                "Unreasonable refresh rate %1Hz reported by X -- defaulting to 60Hz")
+	      .arg(rate));
+      rate = 60;
+    }
+    
     rate = 1000000.0 / rate;
 
     return (int)rate;

-- 
greg



More information about the mythtv-users mailing list