Sunday, April 24, 2005

Reference: Enable real time thread processing

from mythtv howto:

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.

rlimits

The rlimits method is the preferred method and is included in Linux 2.6.12 and above. Unfortunately, you need PAM version 0.79 or above, which may not be supported by your distribution yet. 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 is 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 Capabilties

You may also need to install the realtime module, using your distribution's realtime package. Assuming the users who will be running mythfrontend 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, you just need to run this as root:

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

0 Comments:

Post a Comment

<< Home