You are not logged in.

#1 2014-04-26 09:57:43

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 478
Website

Soft-Realtime and Idle-Only scripts (BFS)

These handy scripts to make use of the BFS patches' extra scheduling policies (soft realtime for music production, emulation gaming, video calling, etc. and  forced idle-only to keep long-term and high-load tasks out of the way)

Execute a command or enhance a running process with isosynchronous scheduling, the highest priority and the most favorable IO policy (almost realtime):
/usr/bin/isosched

if [[ $1 == -p ]]; then
	shift
	schedtool -I -n -20 "$@"
	ionice -c 2 -n 0 -p "$@"
else
	schedtool -I -n -20 -e ionice -c 2 -n 0 "$@"
fi

Execute a command or limit a running process with idle priority scheduling, the lowest priority and the least favorable IO policy (buried alive):
/usr/bin/idleprio

if [[ $1 == -p ]]; then
	shift
	schedtool -D -n 20 "$@"
	ionice -c 3 -p "$@"
else
	schedtool -D -n 20 -e ionice -c 3 "$@"
fi

For example, make X near-realtime:

sudo isosched -p `pidof X`

Then start PCSX2 at near-realtime

isosched pcsx2

This should give you the maximum frame rate and best AV synchronization possible. Also works well for WINE programs.

Last edited by quequotion (2014-08-01 20:57:26)

Offline

#2 2014-04-26 14:35:37

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 478
Website

Re: Soft-Realtime and Idle-Only scripts (BFS)

Ordinary users are not allowed to increase priority by default (the policy seems designed for multi-user systems).
If you have administrative rights, replace "$USER" with your username and append the following line to control your own destiny:
/etc/security/limits.conf

$USER		-	nice		-20

Last edited by quequotion (2014-08-01 20:59:01)

Offline

Board footer

Powered by FluxBB