How to Get Your M-Audio ProjectMix I/O Working in Linux

**UPDATE**

As of Linux Kernel 3.19, Takashi’s work (GitHub) has been merged in. This means that on any recent Linux installation, installing the drivers shouldn’t be necessary. You can skip right to installing FFADO from source and setting up a jack sink in pulseaudio.

Introduction

This is something that I wanted to do for quite a while. I’ve never really used Linux for music production because I prefer Windows and OSX software such as Pro Tools, but it’s nice to be able to listen to music while I code. And Linux is so much nicer to develop code for than Windows. This tutorial will focus on setting the desk up on a Linux Mint/Ubuntu environment.

So first off, what we are going to do is install a new kernel module which allows our Linux system to communicate with the ProjectMix (thanks to Takashi Sakamoto for that), then create a Jack sink into which we feed all of our PulseAudio sound. We’ll also be using FFADO (http://www.ffado.org/) to control the internal mixer in the ProjectMix.

Prerequisites

We’re going to need several things installed before we even begin to set this up. First off, you’ll need the latest version of “Git”. Open up a terminal and install it with the following command:

 sudo apt-get install git 

We’ll also need to set up some build dependencies for FFADO. This is going to involve adding some source repositories. Open up /etc/apt/sources.list as root with the following:

 sudo gedit /etc/apt/sources.list 

Add the following lines to it. On Ubuntu, replace “saucy” with whatever version you are using. On Mint, I’ve found that it really doesn’t matter as far as FFADO build dependencies go.

deb http://us.archive.ubuntu.com/ubuntu/ saucy universe

deb-src http://us.archive.ubuntu.com/ubuntu/ saucy universe

Finally, you’ll want to update aptitude and install the build dependencies:

sudo apt-get update
sudo apt-get install build-dep libffado2
sudo apt-get install scons

Getting the Source Code and Building

We’ll start by grabbing the code for the ProjectMix driver module from GitHub and the FFADO source code from ffado.org. I’d also recommend that you create a “ProjectMix” folder to keep everything tidy.

git clone https://github.com/takaswie/snd-firewire-improve.git
wget http://www.ffado.org/files/libffado-2.2.1.tgz
tar -xvzf libffado-2.2.1.tgz

Okay, now that we have the source code and it’s extracted. We have to build and install it. We’ll start with the driver module:

sudo ln -s $(pwd)/snd-firewire-improve/ /usr/src/alsa-firewire-3.11
sudo dkms install alsa-firewire/3.11

That’s the main step complete. ALSA can now communicate with the ProjectMix. You can actually test this by rebooting your machine, and you will hear “pops” coming from the speakers as the driver sets the sample rate of the sound card.

This would now be a good opportunity to install qjackctl, as you will need it to configure the sample rate and routing of the sound card in future.


sudo apt-get install qjackctl

And with that, it’s time to install FFADO. It will have nothing to do with streaming audio to the device, but it is necessary for controlling the ProjectMix internal mixer. You can build and install it with the following commands.


cd libffado-2.2.1

sudo scons install

At this point it would be a good idea to check that you can stream audio to your device. Reboot and start up qjackctl. Go into settings and select ProjectMix as your interface under ALSA, then press the start button. Open up ffado-mixer, either in a terminal window or just click the icon in your menu, then set your output to “Aux 1/2”. Make sure your speakers are plugged into outputs 1 and 2 on the device and put the volume fader in ffado-mixer to a reasonable level. You can test the audio output by opening up any audio software that supports Jack and playing some audio through it.

Hear some sound? Great, let’s continue and set up your Jack sink for PulseAudio (this will allow desktop applications to send sound to the card). Don’t hear anything or are you having any other issues? Leave a comment below and I’ll do my best to help.

PulseAudio and Jack

Admittedly this isn’t the most ideal way to do things, but until Linux has something like CoreAudio for OSX, it will have to do. We’ll start by killing the PulseAudio service until we finish setting everything up or else it will just get in the way. This is quite simple to do.

Start by opening your PulseAudio client configuration as root:


sudo gedit /etc/pulse/client.conf

Add the line “autospawn = no”. Save it, but don’t close it yet.

Open another terminal window/tab and enter the following command:


pulseaudio --kill

This will stop the service while we install the jack-sink module. Install it with the following command:


sudo apt-get install pulseaudio-module-jack

You’ll now need to edit your PulseAudio configuration to load the new module when it starts. Open up your configuration file:


sudo gedit /etc/pulse/default.pa

Add the following line:

load-module module-jack-sink

Save it and close. Finally, go back to your “client.conf” and erase the “autospawn=no” line that we added earlier, save it and then close.

The Moment of Truth

That’s the setup completed. Close everything and reboot your computer.

Don’t panic if you don’t hear any sound immediately. Make sure you go into your sound settings and set the output to the jack sink that we installed. It should appear just like any other soundcard that you have. Also, make sure that you open ffado-mixer and set the output to “Aux 1/2”.

Test the sound output by loading up any application that uses PulseAudio. Even playing a YouTube video will do. Hopefully this will be all that you need to do. It’s also worth noting that if you do wish to use your ProjectMix for audio recording/mixing on Linux, applications like Ardour will work just fine alongside your PulseAudio sink.

If you have any issues or concerns, comment below and I’ll do my best to help.

Hope this has been of some use!