A realtime linux-rt kernel (not linux-lowlatency, and not a tuned linux-generic) are a must to do realtime audio processing at ridiculously low latencies in linux (<3ms).
Realtime audio processing at ridiculously low latencies is necessary to play synthesized music in real time, rather then use a sequencer or do recordings. It also helps for the latter two.
Ubuntu Studio have abandoned real time kernels, mainly because rt kernels are difficult to maintain properly. However, that's also unfortunate; full rt_preempt is simply the only real unique opportunity that linux audio has to offer compared to Mac and Windows, and they just threw it out the window for their own covenience. It would be a much better trade-off to offer Ubuntu Studio for LTS releases only, but include your realtime kernel. If you're doing audio, stability and performance are the primary concern. LTS is a good match for both.
Primarily for my own production use, I set up a real time kernel repository. It consists of a reasonably close version of a vanilla kernel patched with rt_preempt and configured like the Ubuntu kernel. I use these both for high-reliability audio performance and also for my every day primary kernel and they work great, usually with a couple limitations.
These kernels are prepared carefully, but they are not affiliated with Ubuntu. DO NOT contact the good folks at Ubuntu, Canonical or Ubuntu Studio for support when using these kernels. Reproduce the problem with an official kernel, then it's okay to ask for help. If in doubt, get a seperate partition with a minimal system to use these kernels on, and use the official Ubuntu kernels day to day. It's a good idea to have a special "production" live performance system anyway!
These kernels do not have the usual Ubuntu patches applied and may require disabling security features of Ubuntu to run properly. DO NOT USE THESE ON SERVER MACHINES ON THE INTERNET UNLESS YOU KNOW WHAT YOU ARE DOING.
New versions of these kernels will be made available a couple weeks after the first point release of a new Ubuntu version
Only 64-bit Intel compatible CPUs are supported
Import the key into the keyring
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 57ED9602
Add the repository
# Ubuntu 12.04 sudo sh -c 'echo deb [arch=amd64] http://deb.capocasa.net/rt precise universe > /etc/apt/sources.list.d/linux-rt-cmc.list' # Ubuntu 14.04 sudo sh -c 'echo deb [arch=amd64] http://deb.capocasa.net/rt trusty universe > /etc/apt/sources.list.d/linux-rt-cmc.list'
Only LTS releases are supported.
Update sources and install
sudo apt-get update sudo apt-get install `apt-cache search linux- | grep '\-rt[0-9]*\s' | cut -f1 -d\ `
sudo reboot # ... and you're good do go.
If you don't want the realtime kernel to load by default, modify your grub settings.
It is possible that your machine will no longer start properly or freeze randomly after installing these kernels if it conflicts with other software or hardware you have installed. See Configuration for known issues.
If this happens, reboot your machine and select "Advanced Options For Ubuntu" in the GRUB boot menu. Select the topmost entry that contains the word generic. This is your normal Ubuntu kernel that should always work.
Once you have booted with the generic kernel, you can either uninstall these kernels or see if you can get them to work by uninstalling potentially conflicting software or removing or disabling conflicting hardware. Try taking a cell phone picture of the error message (it normally says "kernel oops" or "kernel panic" and google it to see what may be causing the conflict. If you figure it out, use apt-get remove to uninstall it and contact me so I can mention it in the configuration section.
sudo apt-get remove `apt-cache search linux- | grep '\-rt[0-9]*\s' | cut -f1 -d\ ` sudo rm /etc/apt/sources.list.d/linux-rt-cmc.list sudo apt-get update
Some kernels require some special Ubuntu configuration to run properly.
AppArmor: The kernel conflicts with AppArmor, which causes hard freezes. The easiest way to work around this is to uninstall AppArmor. Make your own judgement on the security implications of this; my opinion is that it's fine for a desktop machine as long as you are more conservative than usual when adding additional 3rd party packages. Let me know if you have a better solution.
sudo apt-get remove apparmor
Temperature Panic: The kernel panics if the critical temperature interrupt is called. This should have no implications for normal operation, but you should shut off your computer if it comes up. The simplest workaround is to get some heat paste and clean your CPU fan. If you are going to go on stage, you want to make sure this never happens anyway.
VirtualBox: The kernel is not compatible with the VirtualBox kernel module and the kernel will panic on boot most of the time if the VirtualBox KDMS kernel module for this kernel is available. I would prefer to configure VirtualBox KDMS not to build the module for this kernel, but was as of now unable to figure out how. I have simply uninstalled VirtualBox for the moment.
sudo apt-get remove virtualbox*
On my Lenovo y560p, it is necessary to disable an interrupt to get rid of some bug-induced system load.