Low-jitter reduces interrupts in the datastreams (jitter), giving continuous graphics and audio, that is optimal for a multimedia computer OS.
Many Linux-distros use the standard config of the kernel, or close. Unfortunately the standard config, is neither specialised for desktop, or server. Also debugging is usually left on, and low-latency kernel-variants often still are not agressively tuned towards low os-jitter. What that means is that these distros will perform much poorer on the desktop than it can. And that includes the most popular distro “Ubuntu” which I use. However configuring and compiling ones own kernel for it, shaving off unceccesary features, really gets it to the performance one would want.
Low-jitter means a responsive desktop, ultrasmooth openGL, low-latency audio, and good for database servers aswell, and minimal network latency.
Ubuntu is nice, that it is one of the more professional desktop linux distributions.
Even if Ubuntu is more professional, Mark Shuttleworth still talks about “lust” on his blog, and one gets the impression that some of the userinterface is influenced by that. That can easily be changed by changing themes and backgrounds ofcourse.
Ctrl+T brings up the terminal, where we can install Lubuntu-desktop “sudo apt-get install lubuntu-desktop”.
If there should be anything, look at the Ubuntu documentation. Most there should be relevant. Do notice that Ubuntu does not provide support for modified kernels, and it comes with no guarantee.
Kernel debs: Download and doubleclick, and install. (or from terminal (ctrl+alt+t) sudo dpkg -i *lowjitter*)
Update: 13.10 files can be downloaded here.
If installing via doubleclick, one also needs to do a “sudo update-grub” in terminal, to update the bootloader. If you have linux installed on several partitions, and you are not installing this on the main partition, you might need to do it first on your current install then your main install.
If you need to install nvidia-driver, see here.
Software such as Renoise now plays without interruptions, at 1ms latency, on a 2.5ghz dual-core. (without RT-threads, meaning overall os-jitter is never higher than 1ms .) This on ext4 filesystem, which seems to have the lowest jitter aswell. Doom 3, which is a jitter-sensitive game, since it does 3 passes pr. frame to openGL, will also play perfectly, and with accurate timing, on the same machine with a Nvidia GTX 280. General desktop performance will be very responsive. I also tried Steam which seems to be working excellently aswell. Steam might be sensitive to antialiasing. 2xMSAA seems to work fine.
Also with correct nice-levels, you can still run big desktops like KDE, and still have low jitter.
Ofcourse to completely get rid of browser-video jitter, one needs to sync playback to refresh rate, something the Wayland crew seems to make some points about. However I have not yet tried Wayland.
X-server also needs to be set to high priority, to not be a performance bottleneck: (which probably belongs in a startup-script somewhere). Notice that nice works better than rt-threads here.
sudo schedtool -p 0 -n -20 -N `pgrep X`
Do note that some games require configuration for optimal performance aswell.
For instance doom 3: Download this config file, and install to .doom3/base in your home directory. Also works for prey (.prey/base).
NVIDIA specific: Nvidia config for doom3/prey can also be set to quite high resolution: In the nvidia config I set the AA to override, and “8x: 4xSS – 2xMS”, because Doom 3 is an “older” game. Normally I would set this to 2xMS. Anisotropic is also set to 2x, because it makes texturezooming look better (better than higher yes). The loss of textureresolution by 2xaniso only, is madeup by, with 4xSS anyway. For 2xMS only, there should be a slider for texure LOD, which I use on windows. If those options are not available in your card, just set it to the closest.
With “cat /proc/driver/nvidia/params” we see some settings that can be changed. “sudo gedit /etc/modprobe.d/nvidia-graphics-drivers.conf” creates a file, that changes the obvious stuff. Put this into it, and save.
options nvidia NVreg_EnableMSI=1
options nvidia NVreg_RegisterForACPIEvents=0
options nvidia NVreg_UsePageAttributeTable=1
We can also do some optimizations for a non-compositing window-manager.
Copy and paste into a console. Console pasting can be done, by simply selecting the text, and pressing middle mousebutton, in console.
sudo nvidia-xconfig --no-acpid-socket-path sudo nvidia-xconfig --no-allow-glx-with-composite sudo nvidia-xconfig --no-composite sudo nvidia-xconfig --no-add-argb-glx-visuals sudo nvidia-xconfig --no-connect-to-acpid sudo nvidia-xconfig --no-disable-glx-root-clipping sudo nvidia-xconfig --no-damage-event sudo nvidia-xconfig --no-enable-acpi-hotkeys sudo nvidia-xconfig --no-multisample-compatibility sudo nvidia-xconfig --no-use-events
If you know how to use modelines, here is a modeline for 72.734hz @ 1280×1024. (“minimal psychovisual noise” refresh rate)
“1280×1024″ 142.714 1280 1368 1504 1728 1024 1025 1028 1068 +hsync +vsync
General configuration options: 90hz (lowest jitter) (no high res timers). This kernel also was also hardwired to 1158500nS granularity, which I find to best suit a profile of “natural” with regards to jitter levels in OpenGL. I also enabled tick_skew=1, to further reduce jitter. iommus and misc options are also turned off for minimal jitter, and maximum performance. See also config for other options. Less code running, is ofcourse also less bugs.
For minimal jitter, run your apps you want low-jitter in, reniced to -20. (doom 3, chromium-browser, wine (needs wine* + winappname*)
If sound is missing in browser after updating to 12.04 you also need to do “rm -rf ~/.pulse”.
Sourcecode from Ubuntu Quantal 3.5.4 Kernel. Edited and configged for “home/pro desktop” with max 16 cpus. It also has currently a tweak “echo 80000 > sched_shares_window” and a fix for Fireface UCX soundcard. My local config can also be viewed here.
This is my contribution, to what I consider an optimal desktop OS.
Peace Be With You.
update: The bootoption “idle=poll” also improves jitter, and will be in the next version, along with any new developments ofcourse. I am also testing cpuidle.off=1 and rcu_nocbs
Mike Gailbraith also told me kernelthreads were so lightweight, for the most extreme nicing, one could approximately put everything on idle schedule policy, which is preempted by what is run as normal, and X + app on normal pri. - ljtune low-jitter example tuning script, based on this. The perfectionist will ofcourse tweak this to his own taste.
I am also currently compiling the kernel with -fno-defer-pop.
VLC desktop-recording needed some tweaking for best results also. Input codecs – Live caching “1 ms” – Clock sync “disable”. Videocodec/x264 – preset fast – setting film, and recording at 60fps both in VLC and codec, for 30fps conversion later. Still quite a bit more jitter in the video though, which ofcourse is a good reason to be interested in Wayland. Mir by Canonical seems to be a similar approach. May the best solution win.
update: With 3.11 CFS is said to be as fast as BFS, so not only should average jitter be better but also performance. Best performance with ”TICK_CPU_ACCOUNTING=y instead of IRQ”, and periodic timer tick, which is 90hz here, so not much.
Updated article also with kernel 3.12 for Ubuntu 13.10, with most of the tweaks, and modifications to:
gedit kernel/Kconfig.hz for 90hz timer.
gedit kernel/sched/fair.c for 1158500 granularity.
gedit Makefile adding -fno-defer-pop to cflags and cxxflags.
Peace Be With You.