fredag den 15. juni 2007

Mythtv Speed Tips

If a process is run with elevated privileges, it's possible to realize some performance gains. If you configure your system in just the right way, you can run the mythfrontend process at a higher processing priority than standard user processes get. This can be useful if your system is completely taxed during playback, which is usually the case when playing back high-definition recordings (unless you have a really fast processor, such as a 3.6GHz Pentium 4 or better). On some systems, altering your mythfrontend binary to run as set-uid root is sufficient:

# chmod u+s /usr/bin/mythfrontend

However, recent changes to the 2.6 Linux kernel have made that method obsolete, and favor another solution. For the latest kernels, you must run PAM 0.79 or later (PAM is an acronym for pluggable authentication modules), and then make a few changes to /etc/security/limits.conf. Assuming you're running mythfrontend as user mythtv, add the following to limits.conf:


Mythtv - rtprio 50
Mythtv - nice 0

These changes aren't dynamic, so you'll need to log out and log back in to have those changes applied to your mythtv user account.

Using either or both of the preceding privilege escalation methods, launch mythfrontend from a console window, navigate to Utilities>Setup>TV Settings>Playback, and check the box for "Enable realtime priority threads" (see Figure 1). Then work your way through the rest of the settings pages. At that point, you should be able to watch a recording with real-time priority enabled. Briefly start watching either a recording or live TV, and then exit out of mythfrontend. On the console from which you launched mythfrontend, you should see a message that looks something like the following:

2006-01-29 11:27:34.264 Using realtime priority.

If you haven't configured everything just right, you'll see the following instead:

2006-01-29 11:28:07.004 Realtime priority would require SUID as root.

Retrace your steps if you run into this error. If one privilege escalation method fails, try the other, or try enabling both at the same time, which should more or less guarantee success. Make sure you're running the latest PAM available for your system and be sure to completely log out and log back in (or even try a reboot, if you feel the urge)

Ingen kommentarer:

Blog-arkiv