<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I posted the following on my homepage this morning:<br>
<p class="first">I bought a dual Opteron 244 back in November of 2003
because I wanted a really, really fast desktop machine. Around the same
time, I started playing with <a href="http://www.mythtv.org/">MythTV</a>,
and it wasn't long after that I got a <a href="http://www.pchdtv.com">pcHDTV</a>
HD-2000 card and began watching high-definition programming.
Unfortunately, despite the Opteron's superior I/O bus design and
incredibly speedy processing, it had more trouble decoding HDTV than
did a much cheaper non-HT uniproc Pentium 4.</p>
<p>It has taken quite some time for MythTV to get to the point where it
can reasonably be used with this configuration. Recently, a version of
ffmpeg that appears to be optimized for <a
 href="http://www.x86-64.org/">AMD64</a> has been imported into the
Myth CVS repository: to get this, make sure to uncheck the "uselibmpeg"
option in Setup/TV Settings/Playback. However, this alone isn't
sufficient.</p>
<p>While I can't pinpoint the exact problem, I changed two major things
in one day that resulted in much improved performance:</p>
<ol>
  <li><em>Cross/Downgraded from <a href="http://www.debian.org/">Debian</a>
gcc-3.4 to <a href="http://www.ubuntulinux.org/">Ubuntu</a> Hoary.</em>
This is a non-trivial operation if you are not used to screwing with
Debian packages a lot. I still find old pieces of gcc-3.4/4.0-based
packages now and then, and need to reinstall them from Ubuntu's archive
when I find them. I recommend reinstalling from scratch if you aren't
comfortable with recovering from broken libc packages by hand. :)</li>
  <li><em>Upgraded my kernel to 2.6.11.6.</em> I actually don't think
this was part of the performance improvement, but it was a variable, so
I didn't want to leave it out. If you have stability problems with
CONFIG_PREEMPT_BKL (preempting the big kernel lock), turn it off; I did.</li>
</ol>
<p class="first">In sum, my configuration looks like the following:</p>
<ul>
  <li>Hardware: Dual Opteron 244; <a href="http://www.tyan.com/">Tyan</a>
Thunder K8W S2885 mobo w/AMD-81x1 I/O interfaces; <a
 href="http://www.nvidia.com/">NVidia</a> FX5600 AGP; 4 GB PC2700
(333MHz) dual DDR SDRAM; <a href="http://www.creative.com/">Creative</a>
SB Live! 5.1 with coax S/PDIF</li>
  <li>Distribution: Ubuntu Hoary</li>
  <li>Linux: 2.6.11.6 (See <a
 href="http://www.krose.org/%7Ekrose/projects/mythtv/tyan.config">my
kernel .config</a>)</li>
  <li>ALSA drivers: 1.0.8 (alsa-source 1.0.8-4ubuntu4)</li>
  <li>NVidia drivers: 7167 (nvidia-kernel-source 1.0.7167-0ubuntu25)</li>
  <li>MythTV configuration: CVS as of 2005-Apr-02. Configuration
options: <tt>--disable-audio-arts --disable-audio-jack --disable-lirc
--disable-joystick-menu --disable-firewire --disable-ivtv
--disable-xrandr --enable-opengl-vsync --enable-memalign-hack
--cpu=x86_64</tt></li>
  <li>MythTV patches: [<a
 href="http://www.krose.org/%7Ekrose/projects/mythtv/broken_pthread_rwlock.diff">broken
pthread_rwlock_*</a>] </li>
  <li>MythTV compilation: gcc-3.3, because the required Ubuntu packages
(e.g., libGLU, libqt-mt) are compiled with gcc-3.3 and link with
libstdc++5. I use <tt>make CC="gcc-3.3" CXX="g++-3.3" LINK="g++-3.3"</tt>
to build.</li>
  <li>MythTV config: turn off libmpeg decoding; use "ALSA:iec958" for
the sound device; turn on AC3 passthrough; turn on extra audio buffering</li>
</ul>
<p class="first">Performance improved significantly under this
configuration. The following tests were performed with a playback
window size of 1066x600 (16:9).</p>
<ul>
  <li>Playback of a specific 1080i clip (CBS football) went from
&gt;99% of one CPU (with dropped frames) under the old config to ~55%
of one CPU for mythfrontend and 15% for X.org with smooth playback.</li>
  <li>Playback of a specific 720p clip (FOX "24") went from &gt;99% of
one CPU (with dropped frames) under the old config to ~40% of one CPU
for mythfrontend and 15% for X.org with smooth playback.</li>
</ul>
<p class="first">Furthermore, at full size (1280x1024 with the video
letterboxed to 16:9), playback still runs smoothly, though 1080i
playback consumes close to 100% of one CPU for mythfrontend. Not clear
why the playback window size should matter with XVideo, but it does.</p>
<p>If you have success with this configuration, I'd love to hear about
it. If you have problems and are able to determine what I've left out,
let me know so I can add the appropriate config elements.</p>
Cheers,<br>
Kyle<br>
<br>
</body>
</html>