Site icon Audio Recording

How to Set your Firewire Audio Interface as Default Sound Device in Linux

By default, if you have an on-board sound card or PCI soundcard installed; it would be very easy to get that working in Linux. As long as you have correctly installed the hardware on your motherboard, Linux would take care of the audio drivers itself and it would run without any hassle after installation. These drivers can be using ALSA and they are included with your distribution packages by default.

But things are very different if you are using an external Firewire audio interface. Typically, these are professional audio recording interface that are often used in music production. To get this to work; there are some things to be done so that you can use your audio interface as a default sound device. Default sound device would mean you can use it in all of your PC audio tasks. This includes the following:

a.) Playback and listen to MP3 files (also WAV files, CD audio, etc) in your Linux PC using your preferred multimedia player.
b.) Watch movies and use the audio interface as the sound device.
c.) Record and playback music with your Firewire audio interface in your digital audio workstation software.
d.) Route the audio from your browser to your Firewire audio interface. This is useful if you are listening to music or watching movies in the Internet.

This tutorial is written using Ubuntu 11.10 distribution in Linux but would also apply in other distributions such as Linux Mint.

Step1: Configure your Firewire Audio Interface to work in Recording

Since your external Firewire audio interface is primarily used for recording, the first step is configuring it to work with recording. The objectives of this step are the following:

a.) Enable Linux to detect your installed Firewire audio interface.
b.) Install the necessary Firewire audio drivers for it to work.
c.) Install JACK, a low latency sound server that can be used with Firewire audio drivers.
d.) Record through your audio interface using a digital audio workstation.

To accomplish the above steps, you can read this tutorial on the installation guide of Saffire Pro40 in Ubuntu 11.10. Take note that the illustrated Firewire audio interface is Saffire Pro 40 although you can try using the steps on that tutorial to install any Firewire audio interface.

Unlike in Windows where the manufacturer supplies the drivers; in Linux there is only generic Firewire audio driver called as FFADO. These drivers are designed to work with many Firewire audio interfaces. You can find out if your hardware is supported here.

Do not proceed to step two until your Firewire audio is fully working and attained the objectives set previously.

Step2.) Configure your Audio Interface to Accept Non-Jack audio streams

In Step1, your Firewire audio interface communicates with JACK daemon. However, by default, you cannot use JACK to accomplish the rest of the audio task below without additional configuration.

a.) Listen to MP3 using your favorite multimedia player.
b.) Watching movies.
c.) Use audio along with your browser.

Outside the JACK world, there is ALSA; an audio driver designed for general consumer and multimedia applications. These are the ones used by your multimedia MP3 players, movie streamers, browsers, etc. except for serious music production/recording where JACK is used.

To make your Firewire audio interface work with ALSA, you need to route the audio from ALSA (coming from your audio client) to JACK. Once in the JACK, it will be easily communicated with your Firewire audio interface through FFADO.

Below are the detailed steps on how to do this:

1.) Install the ALSA-JACK PCM plug-in. Go to Ubuntu software center and type: libasound2-plugins

You need this installed. Once it is properly installed you see a green marked below the plug-in, see screenshot below:

ALSA JACK PCM plugin

2.) Open up your terminal by pressing Control – Alt – T. Type this command (take note of the dot before asoundrc):

$ pico .asoundrc

Assuming its empty, copy the code from here to the .asoundrc file. This is how it looks like after copying the code:

Code ALSA JACK

To save, click Control- O, and then type Control X to exit.

Step3.) Configure JACK for non-recording streams

In non-recording related application, you do not need the real time priority or strict buffering. Instead, for best playback performance the following is the most recommended setting for JACK. Make sure to save it as different preset name, as this is for playback/non-recording related application only:

Jack presets for MP3 playback

If you encounter problems with playback (annoying pops, clicks, etc.), you can either:
a.) Change the sample rate from 44100 to 48000.
b.) Slowly increase the frames/period or periods/buffer until the playback is OK.

Step4.) Test your ALSA and JACK configuration

Now everything has been set, turn on your audio interface (make sure studio monitors are connected also) and reboot your PC. Follow the testing procedures below:

a.) Prepare any wav file, 16-bit/44.1KHz WAV save it to your desktop.
b.) Open 4 terminal windows. (Control – Alt -T).
c.) In the first terminal, run the FFADO dbus server.

$ ffado-dbus-server

d.) In the second terminal, run the ffado mixer:

$ ffado-mixer

c.) In the third terminal, run JACK:

$ qjackctl

Make sure the playback preset is ready. Hit start, you should not see any XRUNS. See screenshot below:

Jack audio no xruns

d.) In the fourth terminal, run this command to play the test wav file in your desktop:

$ aplay -D pcm.jack /home/your_Ubuntu_username/Desktop/filenameofyourwav.wav

Replace the parameters above with your Ubuntu username and the name of the test wav file. When you run the command, there should be sound coming out of your monitors. If it plays the audio wav file, you have correctly enabled your Firewire audio interface to work with ALSA applications. If there is no sound, there should be an error. You might need to install alsa-utils from the Ubuntu software center.

Proceed to Step5 if it’s working.

Step5.) Install Gnome MPlayer

The most recommended audio and video player would be Gnome Mplayer. Although not perfectly stable; it is found out to work with ALSA to JACK implementation. Simply install it from Ubuntu software center.

Once installed, launch Gnome MPlayer and go to Edit – Preferences. You need to configure the player to output via ALSA and in stereo. See screenshot below:

Gnome player configuration

UPDATE June 26, 2012: For those that are using Ubuntu 12.04 LTS, you can try setting the “Audio Output” to use “JACK” instead of “ALSA” to see if it works on your side. It works for me after I upgrade to 12.04.

UPDATE July 11, 2012: You can read this tutorial to find out some troubleshooting steps when there is no sound output from your Firewire audio interface. You need to follow the procedures first in this tutorial before troubleshooting the problem.

As a summary; to play MP3 or movies with Gnome MPlayer and using your Firewire audio interface:

1.) Enable FFADO DBUS server.
2.) Enable FFADO mixer
3.) Enable JACK (qjackctl). Start it using the Jack settings provided earlier.
4.) Launch Gnome Mplayer and load some MP3 or play some movies.
5.) Optionally, you can tweak your JACK settings until the playback sounds perfect.

Content last updated on July 23, 2012

Exit mobile version