M-Audio Quattro

From LQWiki
Jump to navigation Jump to search

Introduction

The M-Audio Quattro USB Audio Interface allows you to plug in up to 4 (externally preamped) mics or instruments and record them each on a separate track. By keeping audio in separate tracks rather than downmixing before going to the computer, you are then free to tweak levels and effects and rerecord individual tracks later to create a professional sounding mix.

Working with professional audio in linux is just now (as of early 2005) becoming a reality with free and open source software. The combination of Real-Time kernel patches, Jack, Alsa, and Ardour makes for a powerful and useful digital production station on a shoestring budget.

Purchasing

Caveat Emptor

First, I must mention that there are better products for this. If you have the room in your PC, pci-card based solutions by M-Audio are better supported under linux. Although you can get the quattro working, it is not always reliable and does not currently support hardware acceleration. The result is that there will always be a delay between playback and recording, which can be quite bothersome when recording a synced track, such as a vocal over an instrumental.

Where to get it

The M-Audio Quattro retails for ~$350, but can be acquired on e-bay for significantly less, as the Firewire solutions from M-Audio are becoming much more desirable for those working on Macs and PCs. Due to the incredibly sparse documentation on the web regarding these new firewire products and linux, it is difficult to say whether they will work under linux at all at the moment.

Be aware that while the Quattro is a nice little device, it does not include pre-amps for the inputs, so you'll need to purchase preamps for your mics and run your instruments through their amplifiers before plugging them into the quattro.

Preparing your system

Setting your system up as a Digital Audio Workstation is not a small undertaking, but thanks to the hardworking people at Planet CCRMA, there is an easy way to prepare everything you'll need.

The CCRMA (pronounced karma) packages include a realtime kernel, up-to-date alsa and jack, and hundreds of audio and video applications. Built on top of Red Hat Linux and now Fedora Core, installing the CCRMA pages is as simple as editing your /etc/apt/sources.list file to include the CCRMA repository and then install the neccessary pages. Please refer the Planet CCRMA documentation for more details.

This step is not absolutely necessary, but without installing the Real-Time Kernels and other CCRMA software, you may be missing essential programs and the quattro will perform poorly, generating long xruns.

Ensuring the quattro gets the same "device identifier" at each boot

In alsa, the first device to be configured is referred to as hw:0, the second as hw:1, and so forth.

When you first plug in the quattro, it will be recognized and autoconfigure as hw:1 . Unfortunately, at your first reboot, the snd-usb-audio module will load before the pci or integrated soundcard, making the quattro hw:0 .

To avoid this problem, edit /etc/modprobe.conf (this may be /etc/modules.conf in older/other distros)

alias snd-card-1 snd-usb-audio
options snd-usb-audio index=1

The quattro will now always be hw:1

Configuring Alsa with /root/.asoundrc

Alsa can be configured to reference complex hardware in a simple way by editing the .asoundrc file in your home directory. Since we will be starting jack and ardour as root, we will want to edit /root/.asoundrc . If this file doesn't exist, please create it.

Thankfully, someone has gone to the trouble of figuring out the hardware of the quattro and has created a suitable .asoundrc file.

# quattro1 is pcm0 which has a maximum sample rate of 44100 and 16
# bit stereo

   	pcm.quattro1 {
             	type hw
                card 1
		device 0
     	}
 
      	ctl.quattro1 {
             	type hw
             	card 1 
     	}
	
# quattro2 is pcm1 which has a maximum sample rate of 96000 and 24
# bit stereo

     	pcm.quattro2 {
             	type hw
                card 1
		device 1
     	}
 
      	ctl.quattro2 {
             	type hw
             	card 1 
     	}


#----	

#
# compose 4 channels from two channel x two devices, hw:2,1 and 
# hw:2,2
# assuming that hw:2,1 and hw:2,2 give the same condition, 24_3LE/96k
#

pcm.quattro {
        type multi;

        slaves.a.pcm "hw:1,0";
        slaves.a.channels 2;
        slaves.b.pcm "hw:1,1";
        slaves.b.channels 2;

        bindings.0.slave a;
        bindings.0.channel 0;
        bindings.1.slave a;
        bindings.1.channel 1;
        bindings.2.slave b;
        bindings.2.channel 0;
        bindings.3.slave b;
        bindings.3.channel 1;
}

ctl.quattro {
        type hw;
        card 1;
}


#
# Remap 4 channels as interleaved.
# Use plug instead of route here, since 24_3LE is unlikely supported
# by applications.
#
# arecord -r 44100 -c 4 -f s16_le -D q4 -d 5 /home/xxx/q4.wav 

pcm.q4 {
        type plug;
        slave.pcm "quattro";
        ttable.0.0 1;
        ttable.1.1 1;
        ttable.2.2 1;
        ttable.3.3 1;
}



ctl.q4 {
        type hw;
        card 1;
}

#
# Use route plugin for applications that do support 24_3LE
# This lowers latency which the plug plugin introduces due to 
# resampling.
#
#   arecord -r 44100 -c 4 -f s16_le -D q4b -d 5 /home/xxx/q41.wav



pcm.q4b {
        type route;
        slave.pcm "quattro";
        ttable.0.0 1;
        ttable.1.1 1;
        ttable.2.2 1;
        ttable.3.3 1;

}

ctl.q4b {
        type hw;
        card 1;
}

#----


Starting Jack

jackd -R -d alsa -d q4 -H -C -r 44100 -p 1024 -i4 -o -P hw:0

jackstart does not always allow normal users to run with realtime capabilities.

Explanation of jackd options selected

-R = run with realtime priority if possible
-d = driver, we're going to use alsa
-d = this second d tells the alsa driver to use device q4 (defined in /root/.asoundrc)
-H = attempts to use hardware accellerated communications. This doesn't work with the quattro as of now.
-C = capture settings
-r = rate, in this case 44100, CD quality. If you're using all 4 channels, you're not going to be getting any better out of the quattro.
-p = the quattro seems to only accept buffer lengths which are a multiple of 1024. (Buffer = Period length p * number of periods n)
-n = (not included here) how many periods, this will default to n2. The less of these, the shorter the delay between recording and playback, or latency.
-i4 = number of inputs to enable. The quattro's got 4, so let's use them!
-o = number of outputs to enable (defaults to the card's default, usually 2)
-P Playback settings follow this. using separate -C and -P sections allows us to route the mixed-down audio through to a second sound card.
hw:0 here tells jack to route playback through the first audio card
after startup, I get quite a few xruns and then jack settles down after about 10 seconds. Recording will be (pretty) reliable after this


Making your first multi-track recording

  • run
    • ardour
  • start a new session, name it
  • right click on the empty area of the "mixer" window
  • add 1 track
    • "manual setup" configuration
  • New track is not yet connected to any inputs
  • you can connect more than one track to each input, so be careful not to add 2 tracks listening to channel 1, as it will be loud and "clip" out
    • If you want to record more than one track from a specific input (for example overdubbing harmony on a vocal by recording a second pass,) "disconnect" the first track from the input, then create a new track and connect it to the desired input.
  • click the input button on your new track
    • edit
      • add input
      • click the alsa_pcm tab
      • select the appropriate capture port
      • I chose capture_1 (the first port on the quattro)
  • You should see a live "monitor" area light up on the track
  • If you have a mic+preamp plugged into this port, try making some noise, you should see the monitor react.
  • Now listen to the output of your pre-existing (non-quattro) soundcard.
  • Record a track by
    • Arming the track by clicking the "r" button
    • Go to "recording standby" by clicking the red-circle record button
    • Start recording by hitting play. You should see your waveforms being drawn in periodically as the recording progresses.

Bug Notice

You may have to restart alsa and the device to get the Quattro to initialize properly.

  • Stop alsa
    • /sbin/service alsasound stop
  • Reboot the device
    • Wait at least 10 seconds after turning it back on
  • Restart alsa
    • /sbin/service alsasound start

If you notice that the channels are behaving erratically or are too loud (as if they have their gain turn up much too high, and are producing a lot of hum,) try this procedure before changing any settings.

NOTE: If you've restarted alsa, it has a tendency to reset volume defaults to muted and silenced. be sure to run your mixer program to check the levels. Don't assume that the quattro's not recording if you don't hear anything coming out at this point!