Real-time Scheduling of Video Display

From MythTV Official Wiki
Jump to: navigation, search

Software-update-available.png This page is up-to-date as of MythTV version 0.27.6, the current release is 0.28.1

Enabling real-time scheduling of the display thread

MythTV supports real-time scheduling of the video output thread. There are three ways to go about enabling this: You can use rlimits, you can use the realtime security module, or on older systems you can SUID the executable. Enabling real-time scheduling is optional, but can make the video display smoother, especially if you are decoding HDTV.


The rlimits method is the preferred method and is included in Linux 2.6.12 and above and requires PAM version 0.79 or above. Assuming anyone running mythfrontend is in the audio group and rlimits are supported, all you need to do is place this in your /etc/security/limits.conf

* - rtprio 0
* - nice 0
@audio - rtprio 50
@audio - nice 0

realtime module

The second option is to use the Linux realtime kernel module. This will be phased out over time, but is currently supported by many distributions that do not yet support rlimits. If you are not using the distribution kernel you must configure your kernel with:

Security options : [*] Enable different security models
Security options : [M] Default Linux Capabilities

You may also need to install the realtime module, using your distribution's realtime package. Assuming the users who will be running myth-frontend will be in the audio group you can get the GUID of a named group like so:

$ grep audio /etc/group

If the number printed out from the grep was 18, you can now load this module as root before starting mythfrontend:

# modprobe realtime gid=18

run as root option (not safe)

The final and least preferred option is to set the sticky bit on the mythfrontend executable. This opens a security hole, but is the only option on systems that do not support either rlimits or the realtime module. This does not work on modern distributions either, and is not recommended on any system connected to the Internet. This may also make it impossible to debug MythTV without running gdb as root. If you would still like to do this, do the following as root:

# chmod a+s /usr/local/bin/mythfrontend /usr/local/bin/mythtv