特殊:Badtitle/NS100:HowToVanillaKernelWithRealtimePreemption:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的2个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/HowToVanillaKernelWithRealtimePreemption}} | {{From|https://help.ubuntu.com/community/HowToVanillaKernelWithRealtimePreemption}} | ||
{{Languages|UbuntuHelp:HowToVanillaKernelWithRealtimePreemption}} | {{Languages|UbuntuHelp:HowToVanillaKernelWithRealtimePreemption}} | ||
'''''Please note: This is an outdated [[UbuntuHelp:HowTo|HowTo]].''' Current versions of Ubuntu have the Realtime Kernel in the repositories, and no patching is required. Simply do <code><nowiki>sudo apt-get install linux-rt</nowiki></code> to install the current realtime kernel, or <code><nowiki>sudo apt-get install ubuntustudio-audio</nowiki></code> to get the realtime kernel along with a suite of audio applications.'' | |||
To get to the goal of true real-time, low-latency audio work under Linux, you will absolutely require Realtime-Preemption. Ingo Molnar, who currently works for Red Hat, wrote a patch that will apply to the the [http://www.kernel.org/ official vanilla kernel sources]. This patch gives you roughly 95% preemption, as compared to about 50% preemption without the patch. If you don't think you need the extra preemption, you can stick with Dapper's default kernel. | To get to the goal of true real-time, low-latency audio work under Linux, you will absolutely require Realtime-Preemption. Ingo Molnar, who currently works for Red Hat, wrote a patch that will apply to the the [http://www.kernel.org/ official vanilla kernel sources]. This patch gives you roughly 95% preemption, as compared to about 50% preemption without the patch. If you don't think you need the extra preemption, you can stick with Dapper's default kernel. | ||
Take note that if you follow this tutorial, you may lose some of the Ubuntu-specific features that are not supported by the official Linux kernel (generally device driver modules). This should only affect a small group of users, but if you find that a particular piece of hardware stops working with this kernel, you may require additional manual patching. | Take note that if you follow this tutorial, you may lose some of the Ubuntu-specific features that are not supported by the official Linux kernel (generally device driver modules). This should only affect a small group of users, but if you find that a particular piece of hardware stops working with this kernel, you may require additional manual patching. | ||
Firstly, get the latest patch from [http://people.redhat.com/mingo/realtime-preempt/ http://people.redhat.com/mingo/realtime-preempt/]. At the time of writing, the latest patch listed there is ''patch-2.6.16-rt26''. We also will want the bd-claim.patch as well, which fixes EVMS (one of the things Ubuntu's patched kernel fixes). | Firstly, get the latest patch from [http://people.redhat.com/mingo/realtime-preempt/ http://people.redhat.com/mingo/realtime-preempt/]. At the time of writing, the latest patch listed there is ''patch-2.6.16-rt26''. We also will want the bd-claim.patch as well, which fixes EVMS (one of the things Ubuntu's patched kernel fixes). | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo su | sudo su | ||
cd /usr/src | cd /usr/src | ||
wget http://people.redhat.com/mingo/realtime-preempt/older/patch-2.6.16-rt26 | wget http://people.redhat.com/mingo/realtime-preempt/older/patch-2.6.16-rt26 | ||
apt-get install kernel-patch-evms | apt-get install kernel-patch-evms | ||
gunzip kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch.gz | gunzip kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch.gz | ||
</nowiki></pre> | </nowiki></pre> | ||
Now download the latest matching official kernel source from [http://www.kernel.org/ http://www.kernel.org/]. At the time of writing, the latest kernel is 2.6.16 (do not use the 2.6.16.x kernels, they will cause issues when patching!). | Now download the latest matching official kernel source from [http://www.kernel.org/ http://www.kernel.org/]. At the time of writing, the latest kernel is 2.6.16 (do not use the 2.6.16.x kernels, they will cause issues when patching!). | ||
<pre><nowiki> | <pre><nowiki> | ||
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2 | wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2 | ||
tar jxf linux-2.6.16.tar.bz2 | tar jxf linux-2.6.16.tar.bz2 | ||
mv linux-2.6.16 linux-2.6.16-rt26 | mv linux-2.6.16 linux-2.6.16-rt26 | ||
mv linux linux.old | mv linux linux.old | ||
ln -s linux-2.6.16-rt26/ linux | ln -s linux-2.6.16-rt26/ linux | ||
</nowiki></pre> | </nowiki></pre> | ||
If you use the NVIDIA module for your video, you can prepare to make the deb package for this as well: | If you use the NVIDIA module for your video, you can prepare to make the deb package for this as well: | ||
<pre><nowiki> | <pre><nowiki> | ||
apt-get install nvidia-kernel-source | apt-get install nvidia-kernel-source | ||
tar zxf nvidia-kernel-source.tar.gz | tar zxf nvidia-kernel-source.tar.gz | ||
</nowiki></pre> | </nowiki></pre> | ||
''There are other modules that you may require as well. Please add them to the wiki here if you have the package names. If you require assistance, post on the discussion page of this wiki and one of the editors will hopefully be able to assist you.'' | ''There are other modules that you may require as well. Please add them to the wiki here if you have the package names. If you require assistance, post on the discussion page of this wiki and one of the editors will hopefully be able to assist you.'' | ||
Now, let's patch the kernel source. | Now, let's patch the kernel source. | ||
<pre><nowiki> | <pre><nowiki> | ||
cd linux/ | cd linux/ | ||
patch -sp1 < ../patch-2.6.16-rt26 | patch -sp1 < ../patch-2.6.16-rt26 | ||
patch -sp1 < ../kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch | patch -sp1 < ../kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch | ||
</nowiki></pre> | </nowiki></pre> | ||
For other patches, test them first without making changes using the --dry-run option. If the test applied cleanly, successfully, then apply your extra patch. | For other patches, test them first without making changes using the --dry-run option. If the test applied cleanly, successfully, then apply your extra patch. | ||
If you like the fancy Ubuntu screen while booting, you can apply the bootsplash patch. | If you like the fancy Ubuntu screen while booting, you can apply the bootsplash patch. | ||
<pre><nowiki> | <pre><nowiki> | ||
cd .. | cd .. | ||
wget ftp://ftp.bootsplash.org/pub/bootsplash/kernel/bootsplash-3.1.6-2.6.15.diff | wget ftp://ftp.bootsplash.org/pub/bootsplash/kernel/bootsplash-3.1.6-2.6.15.diff | ||
cd linux/ | cd linux/ | ||
patch -p1 < ../bootsplash-3.1.6-2.6.15.diff | patch -p1 < ../bootsplash-3.1.6-2.6.15.diff | ||
</nowiki></pre> | </nowiki></pre> | ||
Now, copy the config from Ubuntu's default kernel, install libncurses-dev dependency and run menuconfig. | Now, copy the config from Ubuntu's default kernel, install libncurses-dev dependency and run menuconfig. | ||
<pre><nowiki> | <pre><nowiki> | ||
cp /boot/config-`uname -r` .config | cp /boot/config-`uname -r` .config | ||
apt-get install libncurses-dev build-essential | apt-get install libncurses-dev build-essential | ||
make menuconfig | make menuconfig | ||
</nowiki></pre> | </nowiki></pre> | ||
If you have never used menuconfig before, you should learn. Look around, change the settings that you are certain you want to change. In this step, you must change the following settings: | If you have never used menuconfig before, you should learn. Look around, change the settings that you are certain you want to change. In this step, you must change the following settings: | ||
第55行: | 第56行: | ||
Now build the kernel and module debs. This step will take a very long time (possibly in the hours range, depending on your hardware). You will need kernel-package installed for this: | Now build the kernel and module debs. This step will take a very long time (possibly in the hours range, depending on your hardware). You will need kernel-package installed for this: | ||
<pre><nowiki> | <pre><nowiki> | ||
apt-get install kernel-package | apt-get install kernel-package | ||
make-kpkg clean | make-kpkg clean | ||
make-kpkg modules_clean | make-kpkg modules_clean | ||
make-kpkg --revision 1 --initrd kernel_image kernel_headers modules_image | make-kpkg --revision 1 --initrd kernel_image kernel_headers modules_image | ||
</nowiki></pre> | </nowiki></pre> | ||
Once that is complete with no errors, you can then install the new deb packages: | Once that is complete with no errors, you can then install the new deb packages: | ||
<pre><nowiki> | <pre><nowiki> | ||
cd .. | cd .. | ||
dpkg -i *2.6.16-rt26*.deb | dpkg -i *2.6.16-rt26*.deb | ||
exit | exit | ||
</nowiki></pre> | </nowiki></pre> | ||
Now you probably want to tell GRUB to remember your default kernel choice. This is optional though, if you don't want to set this, you'll just have to always select your kernel from the GRUB menu at every boot. | Now you probably want to tell GRUB to remember your default kernel choice. This is optional though, if you don't want to set this, you'll just have to always select your kernel from the GRUB menu at every boot. | ||
<pre><nowiki> | <pre><nowiki> | ||
nano /boot/grub/menu.lst | nano /boot/grub/menu.lst | ||
</nowiki></pre> | </nowiki></pre> | ||
Change the line that says ''default 0'' to say ''default saved'' located near the top of the file. | Change the line that says ''default 0'' to say ''default saved'' located near the top of the file. | ||
第75行: | 第76行: | ||
If something goes wrong, just choose the original kernel from the GRUB menu during bootup, and then remove the kernel packages: | If something goes wrong, just choose the original kernel from the GRUB menu during bootup, and then remove the kernel packages: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get remove kernel-image-2.6.16-rt26 kernel-headers-2.6.16-rt26 | sudo apt-get remove kernel-image-2.6.16-rt26 kernel-headers-2.6.16-rt26 | ||
</nowiki></pre> | </nowiki></pre> | ||
If you installed modules, you can remove them as well: | If you installed modules, you can remove them as well: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get remove nvidia-kernel-2.6.16-rt26 | sudo apt-get remove nvidia-kernel-2.6.16-rt26 | ||
</nowiki></pre> | </nowiki></pre> | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2008年10月19日 (日) 15:37的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/HowToVanillaKernelWithRealtimePreemption }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/af | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Afrikaans| [[::HowToVanillaKernelWithRealtimePreemption/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ar | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|العربية| [[::HowToVanillaKernelWithRealtimePreemption/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/az | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|azərbaycanca| [[::HowToVanillaKernelWithRealtimePreemption/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/bcc | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|جهلسری بلوچی| [[::HowToVanillaKernelWithRealtimePreemption/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/bg | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|български| [[::HowToVanillaKernelWithRealtimePreemption/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/br | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|brezhoneg| [[::HowToVanillaKernelWithRealtimePreemption/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ca | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|català| [[::HowToVanillaKernelWithRealtimePreemption/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/cs | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|čeština| [[::HowToVanillaKernelWithRealtimePreemption/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/de | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Deutsch| [[::HowToVanillaKernelWithRealtimePreemption/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/el | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Ελληνικά| [[::HowToVanillaKernelWithRealtimePreemption/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/es | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|español| [[::HowToVanillaKernelWithRealtimePreemption/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/fa | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|فارسی| [[::HowToVanillaKernelWithRealtimePreemption/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/fi | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|suomi| [[::HowToVanillaKernelWithRealtimePreemption/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/fr | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|français| [[::HowToVanillaKernelWithRealtimePreemption/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/gu | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|ગુજરાતી| [[::HowToVanillaKernelWithRealtimePreemption/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/he | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|עברית| [[::HowToVanillaKernelWithRealtimePreemption/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/hu | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|magyar| [[::HowToVanillaKernelWithRealtimePreemption/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/id | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Bahasa Indonesia| [[::HowToVanillaKernelWithRealtimePreemption/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/it | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|italiano| [[::HowToVanillaKernelWithRealtimePreemption/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ja | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|日本語| [[::HowToVanillaKernelWithRealtimePreemption/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ko | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|한국어| [[::HowToVanillaKernelWithRealtimePreemption/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ksh | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Ripoarisch| [[::HowToVanillaKernelWithRealtimePreemption/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/mr | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|मराठी| [[::HowToVanillaKernelWithRealtimePreemption/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ms | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Bahasa Melayu| [[::HowToVanillaKernelWithRealtimePreemption/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/nl | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Nederlands| [[::HowToVanillaKernelWithRealtimePreemption/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/no | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|norsk| [[::HowToVanillaKernelWithRealtimePreemption/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/oc | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|occitan| [[::HowToVanillaKernelWithRealtimePreemption/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/pl | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|polski| [[::HowToVanillaKernelWithRealtimePreemption/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/pt | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|português| [[::HowToVanillaKernelWithRealtimePreemption/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ro | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|română| [[::HowToVanillaKernelWithRealtimePreemption/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/ru | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|русский| [[::HowToVanillaKernelWithRealtimePreemption/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/si | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|සිංහල| [[::HowToVanillaKernelWithRealtimePreemption/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/sq | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|shqip| [[::HowToVanillaKernelWithRealtimePreemption/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/sr | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|српски / srpski| [[::HowToVanillaKernelWithRealtimePreemption/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/sv | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|svenska| [[::HowToVanillaKernelWithRealtimePreemption/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/th | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|ไทย| [[::HowToVanillaKernelWithRealtimePreemption/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/tr | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Türkçe| [[::HowToVanillaKernelWithRealtimePreemption/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/vi | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|Tiếng Việt| [[::HowToVanillaKernelWithRealtimePreemption/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/yue | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|粵語| [[::HowToVanillaKernelWithRealtimePreemption/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/zh | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|中文| [[::HowToVanillaKernelWithRealtimePreemption/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/zh-hans | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|中文(简体)| [[::HowToVanillaKernelWithRealtimePreemption/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | UbuntuHelp:HowToVanillaKernelWithRealtimePreemption | {{#if: | :}}HowToVanillaKernelWithRealtimePreemption}}/zh-hant | • {{#if: UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|中文(繁體)| [[::HowToVanillaKernelWithRealtimePreemption/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:HowToVanillaKernelWithRealtimePreemption|:HowToVanillaKernelWithRealtimePreemption|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :HowToVanillaKernelWithRealtimePreemption/zh | | {{#ifexist: HowToVanillaKernelWithRealtimePreemption/zh | | {{#ifeq: {{#titleparts:HowToVanillaKernelWithRealtimePreemption|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:HowToVanillaKernelWithRealtimePreemption|1|-1|}} | zh | | }}
Please note: This is an outdated HowTo. Current versions of Ubuntu have the Realtime Kernel in the repositories, and no patching is required. Simply do sudo apt-get install linux-rt
to install the current realtime kernel, or sudo apt-get install ubuntustudio-audio
to get the realtime kernel along with a suite of audio applications.
To get to the goal of true real-time, low-latency audio work under Linux, you will absolutely require Realtime-Preemption. Ingo Molnar, who currently works for Red Hat, wrote a patch that will apply to the the official vanilla kernel sources. This patch gives you roughly 95% preemption, as compared to about 50% preemption without the patch. If you don't think you need the extra preemption, you can stick with Dapper's default kernel.
Take note that if you follow this tutorial, you may lose some of the Ubuntu-specific features that are not supported by the official Linux kernel (generally device driver modules). This should only affect a small group of users, but if you find that a particular piece of hardware stops working with this kernel, you may require additional manual patching.
Firstly, get the latest patch from http://people.redhat.com/mingo/realtime-preempt/. At the time of writing, the latest patch listed there is patch-2.6.16-rt26. We also will want the bd-claim.patch as well, which fixes EVMS (one of the things Ubuntu's patched kernel fixes).
sudo su cd /usr/src wget http://people.redhat.com/mingo/realtime-preempt/older/patch-2.6.16-rt26 apt-get install kernel-patch-evms gunzip kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch.gz
Now download the latest matching official kernel source from http://www.kernel.org/. At the time of writing, the latest kernel is 2.6.16 (do not use the 2.6.16.x kernels, they will cause issues when patching!).
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2 tar jxf linux-2.6.16.tar.bz2 mv linux-2.6.16 linux-2.6.16-rt26 mv linux linux.old ln -s linux-2.6.16-rt26/ linux
If you use the NVIDIA module for your video, you can prepare to make the deb package for this as well:
apt-get install nvidia-kernel-source tar zxf nvidia-kernel-source.tar.gz
There are other modules that you may require as well. Please add them to the wiki here if you have the package names. If you require assistance, post on the discussion page of this wiki and one of the editors will hopefully be able to assist you. Now, let's patch the kernel source.
cd linux/ patch -sp1 < ../patch-2.6.16-rt26 patch -sp1 < ../kernel-patches/diffs/evms-bd-claim/2.6-bd-claim.patch
For other patches, test them first without making changes using the --dry-run option. If the test applied cleanly, successfully, then apply your extra patch. If you like the fancy Ubuntu screen while booting, you can apply the bootsplash patch.
cd .. wget ftp://ftp.bootsplash.org/pub/bootsplash/kernel/bootsplash-3.1.6-2.6.15.diff cd linux/ patch -p1 < ../bootsplash-3.1.6-2.6.15.diff
Now, copy the config from Ubuntu's default kernel, install libncurses-dev dependency and run menuconfig.
cp /boot/config-`uname -r` .config apt-get install libncurses-dev build-essential make menuconfig
If you have never used menuconfig before, you should learn. Look around, change the settings that you are certain you want to change. In this step, you must change the following settings:
- Enable Processor type and features > High Resolution Timer Support
- Set Processor type and features > High Resolution Timer resolution (nanoseconds) to 1000.
- Set Processor type and features > Processor family to the type of CPU in your system.
- Set Processor type and features > Preemption Mode to Complete Preemption (Real-Time).
- Set Processor type and features > Timer frequency to 1000 Hz.
- Disable Kernel Hacking > Kernel debugging
Once you have done that, Exit from menuconfig and select Yes to save your kernel configuration. Now build the kernel and module debs. This step will take a very long time (possibly in the hours range, depending on your hardware). You will need kernel-package installed for this:
apt-get install kernel-package make-kpkg clean make-kpkg modules_clean make-kpkg --revision 1 --initrd kernel_image kernel_headers modules_image
Once that is complete with no errors, you can then install the new deb packages:
cd .. dpkg -i *2.6.16-rt26*.deb exit
Now you probably want to tell GRUB to remember your default kernel choice. This is optional though, if you don't want to set this, you'll just have to always select your kernel from the GRUB menu at every boot.
nano /boot/grub/menu.lst
Change the line that says default 0 to say default saved located near the top of the file. Next, find the line that says something similar to kernel /vmlinuz-2.6.16-rt26 root=/dev/hda2 ro quiet splash located nearer the bottom of the file, and remove the word splash from the end of the line. This will prevent your screen from being blank as your system boots the realtime kernel. Exit nano, saving the changes, and then restart your computer. At the GRUB prompt, hit Esc and choose the kernel from the menu. You will boot into the new kernel with realtime-preemption, allowing you to be as close as currently possible to true, low-latency real-time audio. If something goes wrong, just choose the original kernel from the GRUB menu during bootup, and then remove the kernel packages:
sudo apt-get remove kernel-image-2.6.16-rt26 kernel-headers-2.6.16-rt26
If you installed modules, you can remove them as well:
sudo apt-get remove nvidia-kernel-2.6.16-rt26