Audio User Guide for Ubuntu Studio 12.04 LTS
Here's a short introduction to audio on Ubuntu Studio. Shortly about what audio systems we have, and how to make use of them.
Pulseaudio - The Desktop Sound System
What is pulseaudio?
Controlling pulseaudio is done mainly from the volume control in the indicator area. But, for some cards, not everything can be adjusted from there and you will need to use the generic alsamixer or a special mixer (mentioned below) to get further control of your audio device.
Alsa provides driver support
Any device that is supported by alsa is potentially supported by Pulseaudio. Usually only pro audio multichannel cards may have problems with pulseaudio. If you find that your multichannel card is not working with pulseaudio, but is supported by alsa, it will still work perfectly with jack. To get desktop audio working for such a card, you will need to set up the pulseaudio to jack bridge mentioned below.
Firewire will only work with special configuration
Currently, firewire devices are not supported by alsa, and may only be used with jack using the ffado firewire driver. But, since we are now able to connect Pulseaudio to jack, using the pulseaudio to jack bridge, we can circumvent this problem.
Many cards are muted by default, and need to be accessed with a special mixer in order to be controlled. There is a generic alsa mixer in the main menu at menu -> Audio Production -> Mixers -> Mixer . To use it, you will first need to select the card you wish to control, and make its controls visible from Select Controls. If I for example want to raise volumes for a m-audio delta device, I will first need to make all the ADCs (Audio to Digital Converter) and DACs (Digital to Audio converter) visible to control the volume for inputs and outputs.
There are also card specific mixers. They are not actually "brand" specific, but "chip" specific, so some mixers will work with many brands that share the same internal chip. These mixers are not only needed to control your device with pulseaudio, but also with jack, since both use alsa as its' backend.
To find out which chip your pci audio device has, look up the brand here. Select it, and try to find the chipset for your model. One particularly common chipset is the envy24(ice1712).
Here's a list of mixers for pci devices that are preinstalled with Ubuntu Studio (comes with the alsa-tools package):
echomixer is the Linux equivalent of the Echoaudio console application from Echoaudio. It is a tool to control all the features of any Echoaudio soundcard. This includes clock sources, input and output gains, mixers, etc.
hdspmixer is the Linux equivalent of the Totalmix application from RME. It is a tool to control the advanced routing features of the RME Hammerfall DSP soundcard series. To handle RME Hammerfall cards you might also need the tools hdspconf and hdsploader
mudita24 - is a control tool for Envy24 (ice1712) based sound cards, and replaces the older envy24control (M-Audio Delta Series)
rmedigicontrol - is a control tool for RME Digi32 and RME Digi96 sound cards. It provides a graphical frontend for all the sound card controls and switches.
More information on supported hardware can be found here.
Jack - The Pro Audio Sound System
Jack is a sound server, and like pulseaudio, it is able to use alsa as it backend. But, jack is also able to use other drivers, such as the firewire driver developed by ffado. Commonly, those are the only two drivers used with jack for audio devices on a Linux machine.
Why use Jack?
Many audio applications will only work with jack - Applications meant for pro audio use will often only work with jack.
Jack is extremely low latency capable - Jack is able to give you extremely low latencies at the right conditions. Which is a must if you are to play a live software instrument.
Some devices will only work with jack - As mentioned above, firewire devices will only work with jack.
Jack connectability - When using jack you can connect any application to any other application just as if you were using physical cables. You are thus not restricted by the functionality of a single application. You can even route pulseaudio to jack, and make use of all of it's desktop audio capability.
The easiest way to start jack is to use qjackctl, which is the most common jack control application. Choose it from the menu, and begin by taking a look at your settings by clicking Setup.
PCI, PCI-E and USB
For PCI, PCI-E and USB devices all you need to do is choose the right device. After that, close Setup, save, and start jack by clicking Start.
For firewire devices, you will need to change the driver to firewire. Most probably you only have one firewire audio device attached, and this will be all you need set in order to get jack started.
The firewire mixer - FFADO Mixer
To control your device further, to set volumes and change internal routing, you will need to use the ffado-mixer, found in Menu -> Audio Production -> Mixers -> FFADO Mixer. For more information on firewire devices, see http://www.ffado.org/ and http://subversion.ffado.org/.
Once you are able to run jack, you might want to reduce latency at some point. Do that by reducing frames/period. Most modern systems should be able to handle 64 frames/period (if you have linux-lowlatency installed).
There is a known bug that concerns the default setup for qjackctl and jack on Ubuntu Studio 12.04. Sometimes, when quitting jack, you will get the message D-BUS: JACK server could not be stopped. Next time you try to start jack, it won't start. To fix this, you need to first kill jackdbus before attempting to start jack again. To do it in the terminal, just do: killall -9 jackdbus.
When starting fails, a message window will pop up. That will sometimes be able to tell you what went wrong, and is also valuable for troubleshooting. Copy and paste the message and keep it as reference when asking for help. All these are superb channels for that.
Sometimes it's just a matter of knowing what to do in which order. Maybe you need to start your computer with the firewire device already attached, or the other way around. Try different combinations, if you are sure the device is supported. (more info on supported devices here).
A common thing to try is to set periods/buffer to 3.
Stereo cards with additional digital outputs may need to be set more specifically in order to get them to start. Try reducing the number of inputs and outputs. Perhaps making it non-duplex, and only using outputs. Anything to see, if you can get it to work at all.
The Pulse Audio to Jack Bridge - using both at once
How do I enable it?
Make sure you have Qjackctl ready, and that you have started jack with it. Click Connect, and look for Pulseaudio JACK Sink and Pulseaudio JACK Source. They should be auto-connected to your audio device.
Set jack-sink as output for pulseaudio
Click on the desktop volume control, choose sound settings and from the output devices find Jack sink (Pulseaudio JACK SINK). To enable it as the output for pulseaudio, click the green button to the left of it, that says Set as fallback.
If all went well, you will now have all desktop sound routed to jack.
How is it made possible?
On Ubuntu Studio all of this is already set up, so this is just for reference.
The bridge only works with jackdbus, which is a part of the package jackd2. You also need to have pulseaudio-module-jack installed.
On top of that, you need to have Enable D-Bus interface Enabled in Qjackctl -> Setup -> Misc.
To enable the bridge after installing all packages you will need to log out and log in again, and restart qjackctl after enabling the dbus interface.