特殊:Badtitle/NS100:UbuntuStudio/DapperPreparation:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第53行: | 第53行: | ||
sudo su -c 'echo dev.rtc.max-user-freq=1024 >> /etc/sysctl.conf' | sudo su -c 'echo dev.rtc.max-user-freq=1024 >> /etc/sysctl.conf' | ||
</nowiki></pre> | </nowiki></pre> | ||
Note - on the Karmic kernel this setting has moved, instead you can use: | |||
<pre><nowiki> | |||
sudo su -c 'echo 1024 >> /sys/class/rtc/rtc0/max_user_freq' | |||
</nowiki></pre>. | |||
This guy [http://tapas.affenbande.org/wordpress/?page_id=40] even recommends setting the max-user-freq to 8192. | This guy [http://tapas.affenbande.org/wordpress/?page_id=40] even recommends setting the max-user-freq to 8192. | ||
He claims that he is achieving latencies <1ms with stable zero xruns | He claims that he is achieving latencies <1ms with stable zero xruns |
2009年11月17日 (二) 20:56的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/UbuntuStudio/DapperPreparation }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/af | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Afrikaans| [[::UbuntuStudio/DapperPreparation/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ar | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|العربية| [[::UbuntuStudio/DapperPreparation/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/az | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|azərbaycanca| [[::UbuntuStudio/DapperPreparation/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/bcc | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|جهلسری بلوچی| [[::UbuntuStudio/DapperPreparation/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/bg | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|български| [[::UbuntuStudio/DapperPreparation/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/br | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|brezhoneg| [[::UbuntuStudio/DapperPreparation/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ca | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|català| [[::UbuntuStudio/DapperPreparation/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/cs | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|čeština| [[::UbuntuStudio/DapperPreparation/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/de | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Deutsch| [[::UbuntuStudio/DapperPreparation/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/el | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Ελληνικά| [[::UbuntuStudio/DapperPreparation/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/es | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|español| [[::UbuntuStudio/DapperPreparation/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/fa | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|فارسی| [[::UbuntuStudio/DapperPreparation/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/fi | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|suomi| [[::UbuntuStudio/DapperPreparation/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/fr | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|français| [[::UbuntuStudio/DapperPreparation/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/gu | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|ગુજરાતી| [[::UbuntuStudio/DapperPreparation/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/he | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|עברית| [[::UbuntuStudio/DapperPreparation/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/hu | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|magyar| [[::UbuntuStudio/DapperPreparation/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/id | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Bahasa Indonesia| [[::UbuntuStudio/DapperPreparation/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/it | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|italiano| [[::UbuntuStudio/DapperPreparation/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ja | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|日本語| [[::UbuntuStudio/DapperPreparation/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ko | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|한국어| [[::UbuntuStudio/DapperPreparation/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ksh | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Ripoarisch| [[::UbuntuStudio/DapperPreparation/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/mr | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|मराठी| [[::UbuntuStudio/DapperPreparation/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ms | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Bahasa Melayu| [[::UbuntuStudio/DapperPreparation/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/nl | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Nederlands| [[::UbuntuStudio/DapperPreparation/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/no | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|norsk| [[::UbuntuStudio/DapperPreparation/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/oc | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|occitan| [[::UbuntuStudio/DapperPreparation/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/pl | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|polski| [[::UbuntuStudio/DapperPreparation/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/pt | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|português| [[::UbuntuStudio/DapperPreparation/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ro | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|română| [[::UbuntuStudio/DapperPreparation/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/ru | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|русский| [[::UbuntuStudio/DapperPreparation/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/si | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|සිංහල| [[::UbuntuStudio/DapperPreparation/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/sq | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|shqip| [[::UbuntuStudio/DapperPreparation/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/sr | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|српски / srpski| [[::UbuntuStudio/DapperPreparation/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/sv | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|svenska| [[::UbuntuStudio/DapperPreparation/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/th | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|ไทย| [[::UbuntuStudio/DapperPreparation/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/tr | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Türkçe| [[::UbuntuStudio/DapperPreparation/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/vi | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|Tiếng Việt| [[::UbuntuStudio/DapperPreparation/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/yue | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|粵語| [[::UbuntuStudio/DapperPreparation/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/zh | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|中文| [[::UbuntuStudio/DapperPreparation/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/zh-hans | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|中文(简体)| [[::UbuntuStudio/DapperPreparation/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation | UbuntuHelp:UbuntuStudio/DapperPreparation | {{#if: | :}}UbuntuStudio/DapperPreparation}}/zh-hant | • {{#if: UbuntuHelp:UbuntuStudio/DapperPreparation|中文(繁體)| [[::UbuntuStudio/DapperPreparation/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:UbuntuStudio/DapperPreparation|:UbuntuStudio/DapperPreparation|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :UbuntuStudio/DapperPreparation/zh | | {{#ifexist: UbuntuStudio/DapperPreparation/zh | | {{#ifeq: {{#titleparts:UbuntuStudio/DapperPreparation|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:UbuntuStudio/DapperPreparation|1|-1|}} | zh | | }}
Setting up your system for an audio workstation currently requires several steps. This was written with Ubuntu 6.06 LTS (dapper) in mind.
Install the applications
If you are still unsure of which you would like to use, or where to start, a sane set of defaults can be had by doing this:
sudo apt-get install ardour-gtk hydrogen jackd jackeq jack-rack jamin qjackctl qsynth seq24 vkeybd zynaddsubfx lmms
Effect Plugins and Instruments
Install the LADSPA plugins so you get some effect plugins for your audio applications to use:
sudo apt-get install blop caps cmt fil-plugins ladspa-sdk mcp-plugins omins swh-plugins tap-plugins vcf-plugins
Install the DSSI host and plugins:
sudo apt-get install dssi-host-jack dssi-example-plugins dssi-plugin-fluidsynth dssi-plugin-hexter dssi-plugin-xsynth
Kernel Preemption & Xruns
Xruns. What are they? Well, simply put, either they are buffer underruns or buffer overruns.
- A buffer underrun happens during playback, when your sound card tries to read data from the buffer, but your software has not yet filled it.
- A buffer overruns happens during recording, when your sound card tries to write data to buffer, but your software has not yet emptied it.
The only acceptable time to receive Xruns is during application startup. Currently, for whatever reason, JACK applications usually cause a few Xruns as it connects to the JACK server, but these will not hurt you in any way. The most critical time to not receive an Xrun is during recording, because it causes a permanent glitch in your audio, which may or may not be easily heard. So now you should understand basically why you want to avoid Xruns. They will cause issues with your recordings, or cause annoyance during playback. Thankfully, you can get these down to a minimum, if not eliminate them altogether. Breezy's stock kernel didn't have any kind of preemption built in, which produced horrible latencies for decent Xrun results (few to none). Dapper's kernel has CONFIG_PREEMPT enabled, which gives better results, but still not the best results. However, some preemption support is better than none, and the current kernel has been much improved since Breezy's day. It might suffice for your purposes, so try it out, and if your latencies are good enough for your purposes and you get no Xruns during recording or playback, then you can move on to the next section. If the performance isn't good enough for you, and you really want to get true low-latency with no Xruns, you can get a vanilla kernel, patch it with Ingo Molnar's -rt patch, and compile your own kernel. To do this, you will need to know somewhat what you are doing. For example, if you have compiled a kernel before, you should be good to go with our tutorial. Ingo Molnar's patch gives us the CONFIG_PREEMPT_RT option, for realtime-preemption. This is the key to low-latency, real-time Linux audio. For a guide on compiling a vanilla kernel with Ingo's patch, read HowToVanillaKernelWithRealtimePreemption. Note that this will be missing many patches that Ubuntu uses on their kernels, unless you try to patch them yourself, so you may end up with missing drivers for your devices if they aren't supported in the mainline vanilla kernel. You might also experience stability issues while running this kernel, so we recommend you keep a copy of the default Ubuntu kernel installed for everyday work.
Real-Time Support
Now you need to set up real-time access for your applications. All you have to do for this is give your audio group permissions to access the rtprio, nice, and memlock limits. To do this, you just need to run these commands:
sudo su -c 'echo @audio - rtprio 99 >> /etc/security/limits.conf' sudo su -c 'echo @audio - memlock 250000 >> /etc/security/limits.conf' sudo su -c 'echo @audio - nice -10 >> /etc/security/limits.conf'
And that is it! You're all set for real-time acces!
ALSA Sequencer
If you are planning on using MIDI at all, you will want to load the ALSA sequencer module.
sudo modprobe snd-seq
To have your system load it at bootup, you have to add it to the /etc/modules file.
sudo su -c 'echo snd-seq >> /etc/modules'
Timer Resolution
The Ubuntu kernel currently is set to 250Hz timers, which is insufficient for MIDI. We can correct this:
sudo sysctl -w dev.rtc.max-user-freq=1024
To make it persistent across reboots, you need to add a line to the /etc/sysctl.conf file.
sudo su -c 'echo dev.rtc.max-user-freq=1024 >> /etc/sysctl.conf'
Note - on the Karmic kernel this setting has moved, instead you can use:
sudo su -c 'echo 1024 >> /sys/class/rtc/rtc0/max_user_freq'
.
This guy [1] even recommends setting the max-user-freq to 8192. He claims that he is achieving latencies <1ms with stable zero xruns There may be other useful information on this page. For example setting rtc and soundcards IRQ priorities higher than everything else using something like:
chrt -f -p 98 `pidof "IRQ 8"` chrt -f -p 82 `pidof "IRQ 4"`
where IRQ 8 is the irq of the real time clock and IRQ 4 has to be the soundcard's current irq, which may change between reboots. chrt is part of the package schedutils (Linux scheduler utilities). IRQs can be listed via
cat /proc/interrupts
I'm not sure if, when using above chrt settings, one must also change the rtprio setting in /etc/security/limits.conf accoringly, or if it can remain at 99
USB MIDI Keyboard/USB Secondary Sound Card Fix
If you use a USB MIDI keyboard or a USB sound card as your secondary device, you may run into issues with it taking priority over your PCI device as your main sound card. This tends to happen if you leave it turned on and plugged in during boot. Here is the solution:
sudo su -c 'echo options snd-usb-audio index=-2 >> /etc/modprobe.d/alsa-base'
Getting it All Going
First, you will want to launch Qjack``Ctl by itself, and configure it for your soundcard. Follow the HowToJACKConfiguration page if you need help. Next, we recommend you have a read through the HowToQjackCtlConnections tutorial, which is used to quickly connect the various applications and it should give you a grasp of the concept behind JACK and how modular the Linux audio world is. Once you understand how JACK connections work, you might like to follow a tutorial on composing a basic song with Seq24. Check that out here: HowToSeq24Introduction.