个人工具

“UbuntuHelp:UbuntuStudioPreparation”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第3行: 第3行:
 
Setting up your system for an audio workstation currently requires several steps. This was written with Ubuntu 7.10 (Gutsy) in mind.
 
Setting up your system for an audio workstation currently requires several steps. This was written with Ubuntu 7.10 (Gutsy) in mind.
 
For most users, this steps are to be done if you want to setup multimedia production with a standard Ubuntu installation (means without installing Ubuntu Studio)
 
For most users, this steps are to be done if you want to setup multimedia production with a standard Ubuntu installation (means without installing Ubuntu Studio)
 
 
However, user with Firewire hardware, pci professional sound card, even on Ubuntu Studio 7.10, or simply having questions may find tips on this page.
 
However, user with Firewire hardware, pci professional sound card, even on Ubuntu Studio 7.10, or simply having questions may find tips on this page.
 
 
=== Install the "must have "applications ===
 
=== Install the "must have "applications ===
 
 
If you prefer to install the packages with Synaptic, you can.
 
If you prefer to install the packages with Synaptic, you can.
 
 
==== The basics ====
 
==== The basics ====
 
 
If you are still unsure of which you would like to use, or where to start, a sane set of defaults can be installed by doing this:
 
If you are still unsure of which you would like to use, or where to start, a sane set of defaults can be installed by doing this:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install ardour-gtk hydrogen jackd jack-rack qjackctl seq24 vkeybd zynaddsubfx patchage
 
sudo apt-get install ardour-gtk hydrogen jackd jack-rack qjackctl seq24 vkeybd zynaddsubfx patchage
 
</nowiki></pre>
 
</nowiki></pre>
 
 
ardour-gtk is a very good audio recorder and sequencer, seq24 is a midi sequencer, vkeybd is a virtual midi keyboard, zynaddsubfx a very good modular synth, hydrogen is a drum kit and sequencing application, jackd is the sound daemon and qjackctl is to setup it well with a GUI, patchage is a very usefull application to patch audio/midi applications and the I/O.
 
ardour-gtk is a very good audio recorder and sequencer, seq24 is a midi sequencer, vkeybd is a virtual midi keyboard, zynaddsubfx a very good modular synth, hydrogen is a drum kit and sequencing application, jackd is the sound daemon and qjackctl is to setup it well with a GUI, patchage is a very usefull application to patch audio/midi applications and the I/O.
 
 
==== Specific pci and usb hardware ====
 
==== Specific pci and usb hardware ====
 
 
First of all, check on this page if your card is supported : http://alsa-project.org/main/index.php/Matrix:Main
 
First of all, check on this page if your card is supported : http://alsa-project.org/main/index.php/Matrix:Main
 
 
If your card is said to be supported, but you know is it a low latency sound card, do:
 
If your card is said to be supported, but you know is it a low latency sound card, do:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install alsa-firmware-loaders alsa-tools alsa-tools-gui
 
sudo apt-get install alsa-firmware-loaders alsa-tools alsa-tools-gui
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If your card is still not supported, you may find the alsa-firmware package on this repository :  
 
If your card is still not supported, you may find the alsa-firmware package on this repository :  
 
<pre><nowiki>
 
<pre><nowiki>
第34行: 第24行:
 
</nowiki></pre>
 
</nowiki></pre>
 
It is now compiled for i386 and amd64
 
It is now compiled for i386 and amd64
 
 
 
==== Firewire (ieee1393 / raw1394) sound cards ====
 
==== Firewire (ieee1393 / raw1394) sound cards ====
 
 
If you can't get your Firewire sound card working with Freebob and Jack, please first of all have a look at http://freebob.sourceforge.net/index.php/List_of_Supported_Devices and check if your sound card is supported. If it is, simply do that:
 
If you can't get your Firewire sound card working with Freebob and Jack, please first of all have a look at http://freebob.sourceforge.net/index.php/List_of_Supported_Devices and check if your sound card is supported. If it is, simply do that:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo adduser <username> disk
 
sudo adduser <username> disk
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Think to change <username> below with the concerned user name. So you will have the access to raw1394 without being root.
 
Think to change <username> below with the concerned user name. So you will have the access to raw1394 without being root.
 
 
NB: it may cause a security problem if you are using ieee1394 for other than hard disk, camera or sound card connection, for exemple with network
 
NB: it may cause a security problem if you are using ieee1394 for other than hard disk, camera or sound card connection, for exemple with network
 
 
==== Effect Plugins and Instruments ====
 
==== Effect Plugins and Instruments ====
 
 
Install the LADSPA plugins so you get some effect plugins for your audio applications to use:
 
Install the LADSPA plugins so you get some effect plugins for your audio applications to use:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install blop caps cmt fil-plugins ladspa-sdk mcp-plugins omins swh-plugins tap-plugins vcf-plugins
 
sudo apt-get install blop caps cmt fil-plugins ladspa-sdk mcp-plugins omins swh-plugins tap-plugins vcf-plugins
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Install the DSSI host and plugins:
 
Install the DSSI host and plugins:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install dssi-host-jack dssi-example-plugins dssi-plugin-fluidsynth dssi-plugin-hexter dssi-plugin-xsynth
 
sudo apt-get install dssi-host-jack dssi-example-plugins dssi-plugin-fluidsynth dssi-plugin-hexter dssi-plugin-xsynth
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Real Time Kernel & Xruns ===
 
=== Real Time Kernel & Xruns ===
 
 
Xruns. What are they? Well, simply put, either they are buffer underruns or buffer overruns.
 
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 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.
 
* 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.
 
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.
 
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.
 
 
The better way to avoid X-Runs is to install a real time kernel, optimized for audio production with low latency. You can simply do:
 
The better way to avoid X-Runs is to install a real time kernel, optimized for audio production with low latency. You can simply do:
 
<pre><nowiki>
 
<pre><nowiki>
第74行: 第51行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Then follow the advice below under 'Real-Time Support' and you should be set up to run jackd and other applications in real time low latency mode. You need to reboot after you've installed the low-latency package and made the changes below. Make sure you reboot into the right kernel - it will come up in the list on the boot screen, but may not be set as the default option.
 
Then follow the advice below under 'Real-Time Support' and you should be set up to run jackd and other applications in real time low latency mode. You need to reboot after you've installed the low-latency package and made the changes below. Make sure you reboot into the right kernel - it will come up in the list on the boot screen, but may not be set as the default option.
 
 
=== Real-Time Support ===
 
=== Real-Time Support ===
 
 
After you've got the kernel you still need to set up real-time access for your applications.
 
After you've got the kernel you still 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:
 
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:
 
<pre><nowiki>
 
<pre><nowiki>
第85行: 第59行:
 
sudo su -c 'echo @audio - nice -10 >> /etc/security/limits.conf'
 
sudo su -c 'echo @audio - nice -10 >> /etc/security/limits.conf'
 
</nowiki></pre>
 
</nowiki></pre>
 
 
And that is it! You're all set for real-time acces!
 
And that is it! You're all set for real-time acces!
 
 
=== ALSA Sequencer ===
 
=== ALSA Sequencer ===
 
If you can not have midi sequencing enabled, or if you have midi error message, the Alsa midi sequencer module of the kernel may not be loaded. Try that:
 
If you can not have midi sequencing enabled, or if you have midi error message, the Alsa midi sequencer module of the kernel may not be loaded. Try that:
第93行: 第65行:
 
sudo modprobe snd-seq
 
sudo modprobe snd-seq
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If it works, to have your system load it at bootup, you have to add it to the /etc/modules file, do:
 
If it works, to have your system load it at bootup, you have to add it to the /etc/modules file, do:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo su -c 'echo snd-seq >> /etc/modules'
 
sudo su -c 'echo snd-seq >> /etc/modules'
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== USB MIDI Keyboard/USB Secondary Sound Card Fix ===
 
=== 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:
 
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:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo su -c 'echo options snd-usb-audio index=-2 >> /etc/modprobe.d/alsa-base'
 
sudo su -c 'echo options snd-usb-audio index=-2 >> /etc/modprobe.d/alsa-base'
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Configuration of more than one sound card ===
 
=== Configuration of more than one sound card ===
 
 
When having more than one soundcard, it often appears that one card is one time the default device, other times it's an other one.  This has led to a lack of output because the "System/Preferences/Sound" control panel seems to only consider card "0" to be the default, even if you change it.
 
When having more than one soundcard, it often appears that one card is one time the default device, other times it's an other one.  This has led to a lack of output because the "System/Preferences/Sound" control panel seems to only consider card "0" to be the default, even if you change it.
 
 
So, to make a long story short, you can ensure that one of your sound-devices is always "0" with this small modification:
 
So, to make a long story short, you can ensure that one of your sound-devices is always "0" with this small modification:
 
 
Edit the following file with your favorite editor, e.g:
 
Edit the following file with your favorite editor, e.g:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo gedit /etc/modprobe.d/alsa-base
 
sudo gedit /etc/modprobe.d/alsa-base
 
</nowiki></pre>
 
</nowiki></pre>
 
 
and append this to the bottom of the file, making adjustments as required for your setup, see example below:
 
and append this to the bottom of the file, making adjustments as required for your setup, see example below:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
options snd_hda-intel index=0
 
options snd_hda-intel index=0
第126行: 第89行:
 
#etc...
 
#etc...
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Where "foo" is the name of the alsa driver for the soundcard.
 
Where "foo" is the name of the alsa driver for the soundcard.
 
 
 
=== Getting it All Going ===
 
=== Getting it All Going ===
 
 
First, you will want to launch Qjack``Ctl by itself, and configure it for your soundcard. Follow the [[UbuntuHelp:HowToJACKConfiguration]] page if you need help.
 
First, you will want to launch Qjack``Ctl by itself, and configure it for your soundcard. Follow the [[UbuntuHelp:HowToJACKConfiguration]] page if you need help.
 
 
Next, we recommend you have a read through the [[UbuntuHelp: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.
 
Next, we recommend you have a read through the [[UbuntuHelp: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: [[UbuntuHelp:HowToSeq24Introduction]].
 
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: [[UbuntuHelp:HowToSeq24Introduction]].
 
 
=== Comments ===
 
=== Comments ===
 
* It is just an update of the dapper page for Gutsy, which is now better for multimedia production. Don't hesitate to come on #ubuntustudio if you have any question, or you want to help. You will find stuff below if you want to tweak more than needed. ttoine
 
* It is just an update of the dapper page for Gutsy, which is now better for multimedia production. Don't hesitate to come on #ubuntustudio if you have any question, or you want to help. You will find stuff below if you want to tweak more than needed. ttoine
 
 
 
 
==== Timer Resolution ====
 
==== Timer Resolution ====
 
 
NB: be very careful of what you do with this section.
 
NB: be very careful of what you do with this section.
 
 
The Ubuntu kernel currently is set to 250Hz timers, which is insufficient for MIDI. We can correct this:
 
The Ubuntu kernel currently is set to 250Hz timers, which is insufficient for MIDI. We can correct this:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo sysctl -w dev.rtc.max-user-freq=1024
 
sudo sysctl -w dev.rtc.max-user-freq=1024
 
</nowiki></pre>
 
</nowiki></pre>
 
 
To make it persistent across reboots, you need to add a line to the /etc/sysctl.conf file.
 
To make it persistent across reboots, you need to add a line to the /etc/sysctl.conf file.
 
<pre><nowiki>
 
<pre><nowiki>
 
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>
 
 
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
第165行: 第114行:
 
sudo chrt -f -p 82 `pidof "IRQ-4"`
 
sudo chrt -f -p 82 `pidof "IRQ-4"`
 
</nowiki></pre>
 
</nowiki></pre>
 
 
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.
 
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).
 
chrt is part of the package schedutils (Linux scheduler utilities).
 
 
IRQs can be listed via
 
IRQs can be listed via
 
<pre><nowiki>
 
<pre><nowiki>
 
cat /proc/interrupts
 
cat /proc/interrupts
 
</nowiki></pre>
 
</nowiki></pre>
 
 
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
 
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
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 21:57的版本

Setting up your system for an audio workstation currently requires several steps. This was written with Ubuntu 7.10 (Gutsy) in mind. For most users, this steps are to be done if you want to setup multimedia production with a standard Ubuntu installation (means without installing Ubuntu Studio) However, user with Firewire hardware, pci professional sound card, even on Ubuntu Studio 7.10, or simply having questions may find tips on this page.

Install the "must have "applications

If you prefer to install the packages with Synaptic, you can.

The basics

If you are still unsure of which you would like to use, or where to start, a sane set of defaults can be installed by doing this:

sudo apt-get install ardour-gtk hydrogen jackd jack-rack qjackctl seq24 vkeybd zynaddsubfx patchage

ardour-gtk is a very good audio recorder and sequencer, seq24 is a midi sequencer, vkeybd is a virtual midi keyboard, zynaddsubfx a very good modular synth, hydrogen is a drum kit and sequencing application, jackd is the sound daemon and qjackctl is to setup it well with a GUI, patchage is a very usefull application to patch audio/midi applications and the I/O.

Specific pci and usb hardware

First of all, check on this page if your card is supported : http://alsa-project.org/main/index.php/Matrix:Main If your card is said to be supported, but you know is it a low latency sound card, do:

sudo apt-get install alsa-firmware-loaders alsa-tools alsa-tools-gui

If your card is still not supported, you may find the alsa-firmware package on this repository :

deb http://ppa.launchpad.net/tsmithe/ubuntu gutsy multiverse
deb-src http://ppa.launchpad.net/tsmithe/ubuntu gutsy multiverse

It is now compiled for i386 and amd64

Firewire (ieee1393 / raw1394) sound cards

If you can't get your Firewire sound card working with Freebob and Jack, please first of all have a look at http://freebob.sourceforge.net/index.php/List_of_Supported_Devices and check if your sound card is supported. If it is, simply do that:

sudo adduser <username> disk

Think to change <username> below with the concerned user name. So you will have the access to raw1394 without being root. NB: it may cause a security problem if you are using ieee1394 for other than hard disk, camera or sound card connection, for exemple with network

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

Real Time Kernel & 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. The better way to avoid X-Runs is to install a real time kernel, optimized for audio production with low latency. You can simply do:

sudo apt-get install linux-rt

Then follow the advice below under 'Real-Time Support' and you should be set up to run jackd and other applications in real time low latency mode. You need to reboot after you've installed the low-latency package and made the changes below. Make sure you reboot into the right kernel - it will come up in the list on the boot screen, but may not be set as the default option.

Real-Time Support

After you've got the kernel you still 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 can not have midi sequencing enabled, or if you have midi error message, the Alsa midi sequencer module of the kernel may not be loaded. Try that:

sudo modprobe snd-seq

If it works, to have your system load it at bootup, you have to add it to the /etc/modules file, do:

sudo su -c 'echo snd-seq >> /etc/modules'

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'

Configuration of more than one sound card

When having more than one soundcard, it often appears that one card is one time the default device, other times it's an other one. This has led to a lack of output because the "System/Preferences/Sound" control panel seems to only consider card "0" to be the default, even if you change it. So, to make a long story short, you can ensure that one of your sound-devices is always "0" with this small modification: Edit the following file with your favorite editor, e.g:

sudo gedit /etc/modprobe.d/alsa-base

and append this to the bottom of the file, making adjustments as required for your setup, see example below:

options snd_hda-intel index=0
options snd_indigoio index=1
options snd_hdsp index=2
options snd_foo index=3
#etc...

Where "foo" is the name of the alsa driver for the soundcard.

Getting it All Going

First, you will want to launch Qjack``Ctl by itself, and configure it for your soundcard. Follow the UbuntuHelp:HowToJACKConfiguration page if you need help. Next, we recommend you have a read through the UbuntuHelp: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: UbuntuHelp:HowToSeq24Introduction.

Comments

  • It is just an update of the dapper page for Gutsy, which is now better for multimedia production. Don't hesitate to come on #ubuntustudio if you have any question, or you want to help. You will find stuff below if you want to tweak more than needed. ttoine

Timer Resolution

NB: be very careful of what you do with this section. 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'

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:

sudo chrt -f -p 98 `pidof "IRQ-8"`
sudo 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