Introduction

This page is probably the most up-to-date description of how to set up FireWire audio with Ubuntu.

Ubuntu 11.04 ("Natty Narwhal") completed the migration to the new FireWire driver stack, and the legacy firewire stack was removed with the 2.6.37 kernel. Refer to FireWire Stacks Explained for more details.

Older Releases

For completeness, there is still documentation to provide ALL the steps needed to configure an older system to use a FireWire device. However, most of these extra configuration steps are no longer required, beyond what is needed to use any other soundcard with JACK in realtime mode.

Newer Releases

UbuntuStudio 12.04 LTS ("Precise Pangolin") ships with the lowlatency kernel, and the 'audio' group is preconfigured with proper security and user settings, so it should 'just work'.

If you are using Ubuntu 11.04 ("Natty Narwhal") or a later release, its configuration should be verified.

To use your FireWire device, enter the procedure at Set IRQ Priorities.

Supported FireWire Audio Devices

Refer to this list of currently supported devices.


Note: This wiki has two other entries which are relevant to Firewire:

  1. Firewire describes the use of IEEE 1394 firewire video devices.

  2. Preparing UbuntuStudio for Firewire is mostly out of date, but describes the use of IEEE 1394 firewire sound cards and cameras.


Set IRQ Priorities

Note: This step is not applicable unless you have Ubuntu 10.10 ("Maverick Meerkat") or a later release, with a realtime, lowlatency, or a kernel at 2.6.39 or later.

One of the biggest advantages of a realtime kernel is the ability to prioritize IRQ's. This feature can increase the stability of applications which need to capture data with low latencies.

UbuntuStudio 12.04 LTS ("Precise Pangolin") ships with the lowlatency kernel preconfigured to support realtime irq priorities. This feature is also available in the lowlatency kernel, as of 2.6.39, but you might need to add 'threadirqs' (without the quotes) to the boot command line to enable this feature (if not using UbuntuStudio).

The real-time IRQ priorities are set during system boot by the /etc/init.d/rtirq script. By default, sound cards and USB devices are given a high priority but firewire devices are not. If the firewire driver and jackd cannot process the incoming data quickly enough, then jackd will discard the data buffers and notify the audio application of the overrun event (usually called an xrun).

To reduce the risk of overruns, you need to change this configuration file:

sudo gedit /etc/default/rtirq

The priorities are set, in order from highest to lowest, by these two lines:

RTIRQ_NAME_LIST="rtc snd usb i8042"

RTIRQ_NONE_THREADED="rtc snd"

You need to ensure the firewire device receives higher priority for its interrupt handler than everything other than the real time clock, so you should put the name of the firewire driver second in both the lists, i.e. insert firewire in the second place of these lists, so they look like this:

RTIRQ_NAME_LIST="rtc firewire snd usb i8042"

RTIRQ_NONE_THREADED="rtc firewire snd"

Note: This assumes you are using the new firewire stack with an internal controller. If you need to use the old stack, use the ohci1394 driver instead. If your firewire card is handled by an external controller (e.g. a PC-Card), you need to code the name of the card controller module (e.g. yenta). If you are not sure, then read FireWire stacks explained for more information.

Reboot your system (or just run sudo service rtirq start) to assign your new IRQ priorities. sudo service rtirq status will show you the current status: the firewire irq should appear second on the list, probably with an RTPRIO of 85.

There are more IRQ adjustments that can be made and may be beneficial, but they are not easily automated by the rtirq script. To learn how to tweak things even further, see http://subversion.ffado.org/wiki/IrqPriorities for more detailed information.

Start Jack

Before running jackd and your audio capture application, you should stop any programs that might contend for system resources. Many users find it helpful to stop all networking activity and, in particular, polling for wireless networks can cause unexpected xruns.

  • Open the jack control gui application. On newer systems this is the QjackCtl entry in the Audio Production menu. On older systems, it is Jack Control in the Sound & Video/Audio Production menu.

  • Click 'Setup'. Here are some good settings to start with:
    • Driver: firewire (This selects the ffado driver stack)
    • Interface: hw:0
    • Audio:Duplex

    • Check Realtime
    • Priority: (default)
    • Frames/Period: 128
    • Sample Rate: 44100
    • Periods/Buffer: 3
  • Click 'OK', then click 'Start'. After a few seconds Jack Control should display CPU percentage, RT should be yellow and blinking, and x-runs should be at 0/0.

  • Note: You should adjust your Sample Rate to match the clock rate of your firewire device! e.g. 44100 for CD quality audio, 48000 for video work, higher for studio quality.

  • The default priority is claimed elsewhere to be 10, but this will usually be OK. A higher number will reduce the risk of xruns, but you need a lower priority than that of the irq driver
  • Frames/Period can be lowered as well. A lower number will yield lower latencies and use more processor power. If you start getting xruns, increase this number and accept a higher latency.
  • Setting Frames/Period to 64 and Periods/Buffer to 3 should result in a round-trip latency of just under 10ms, which is generally considered negligible.

Have Fun and Happy Audio Production!

For ideas on where to go from here, see UbuntuStudio/Audio

CategoryAudio

FireWire/DigitalAudio (last edited 2012-09-27 11:45:22 by dooitze)