Thursday, June 16, 2011

M-Audio Fast Track Pro for Debian Linux @ 24 bit with RT Kernel

PART I - INTRODUCTION


The Fast Track Pro by M-Audio is a really nice USB Audio interface, although small, it can perform well in a professional environment. I was given one of these a while back by one of my best web design clients and good friend.

The basic specs on this device are:
  • 24-bit/96kHz audio interface with dual mic/instrument preamps
  • Balanced/unbalanced analog I/O
  • S/PDIF coaxial; MIDI I/O
  • ¼” headphone output with level control and A/B source switch

Front and Back Views of the Fast Track Pro


This device is recognized by ALSA and works ok (class compliant mode) out of the box on linux since it's a USB1 class device. So it will only capture or playback in 16 bit mode up to a sample rate of 48000 KHz. To be able to capture @ 24bit with it under linux you will have to patch and compile your own kernel. Once you do that you will be able to capture/playback in 24 bit (Big Endian) up to a sample rate of 96000. Do notice that still, above 48000 KHz this device will only work either in capture or playback modes (not both or full Duplex) because it is a USB1 audio device and that is how it's designed and because of the limitation of USB1 speeds, for more information check the M-Audio website for the full specs, still I post below the way it works in mac or windows with and without the drivers. Also the digital input/output can be enabled this way, I have kind of tested the digital in myself but do get some predictable xruns, so I try to go "naturally" analog with it as possible. Besides, the preamps and converters in this thing are quite descent and silent. So in other words when compiling a patched kernel for this device you should get pretty much the results as if you had the drivers installed.


I/OBit DepthSample Rate (kHz)
-------------------------------------------------------------------------------------------------------------------------------
With Drivers 4 x 41644.1/48
2 x 4 2444.1/48
2-in OR 2-out 2488.2/96
-------------------------------------------------------------------------------------------------------------------------------
Class compliant2x41644.1/48



A little bit of boring history and technical explanation (that you should read):

I found a patch for this specific device at the ALSA wiki page but it was quite outdated, it corresponded to kernel 2.6.22, so I downloaded it and readjusted it for a newer kernel (2.6.29 at the time I started experimenting). Then someone uploaded a newer patch for kernel version 2.6.31. So I re-adjusted it again for kernel version 2.6.31.4 which is what this guide is intended for, I have just updated it for kernel 2.6.33.7 (patch submitted by YomGuy) with the realtime patch verion 30, I am still testing and as soon as I see all is well, then I will update this guide for it, so check back soon, but I will release it when I'm 100% sure it's working properly, don't think you are behind technologically just because you are using an older version of the kernel, things should work just fine with the current version.

This guide used to be aimed mostly for the ubuntu distribution. But this is not the case anymore.

I will explain...

Ubuntu is a great distro for many things, I still use it for my normal everyday desktop use like web browsing, e-mailing, skyping, listening to music, 3D and Graphics, Virtualization and writing boring blogs like this one, but when it comes to Pro Audio where you have to set up the machine to run at its best performance without latencies and drop outs, well....., that's where it starts staying behind. Newer versions of ubuntu have been harder and harder for me to set up and configure for Real Time Audio and run the Fast track pro at 24 bit mode. The reason is simple, the ubuntu developers have been working on a linux distro that is easy, fast and reliable for normal desktop users and new ones also, so it has gotten to the point where compiling a patched kernel with Real Time capabilities and to make this device run at 24 bit has been almost impossible now, so now I use another partiton with Debian just for Pro Audio and boot back up to my ubuntu for normal "every day" use. I don't have time for further testing on other distros like ubuntu, I have to focus on my music, so if I got it working finally under Debian, then that's why this guide is written for Debian.

So my advice now is, If you have the extra drive space you should create a pure Debian installation. Please, try to understand that just because ubuntu is a derivative of Debian it doesn't mean that it's the same thing, IT'S NOT.  If you use another Debian derivative like 64studio or any other similar distro then configuring and setting it all up is under your own responsibility and I really can't guarantee that it will work then, if you succeed I congratulate you, but I don't want to know how you did it, you can create your own blog about it if you like, all I ask is that you give me proper credit under this license terms for whatever information you extract from this guide; you also have to remember that some linux distros are derivatives of other Debian derivatives, for example Linux Mint, which is a derivative of ubuntu, try to keep away from those if possible. So the current STABLE version of Debian is "Squeeze" (or the current "stable" release of the moment you are reading this tutorial), please try to stick to that "current" version, it is very stable, and also try to stick with a 32 bit version, if you have more than 4 GB of RAM this is no problem, since we will be building our custom kernel with support for up to 64 GB of RAM, even if you are running a 32 bit version of linux.

The method used here on how to compile your own Kernel (The Debian Way) is that it will leave your original Kernel intact, that means it will not mess anything with your current kernel. It will create two deb packages for you to install (one with the main kernel and the other with the headers) so you can then boot to that custom kernel, if something goes wrong with the new kernel, all you have to do is boot back to your original kernel and uninstall the custom self compiled one from synaptic. So this is straight forward easy and safe. You should leave your original kernel installed for everyday use (in case you use the same partition or system for your standard daily usage also) and only use the custom self compiled one for audio production, If you only intend to use the computer as an audio workstation, then you can remove the generic kernel to free up some space if necessary, but I really don't recommend it.

Also this guide can be used just to compile any kernel version, just change the version numbers to the ones you are compiling and don't apply the M-Audio Fast Track Pro patch since you will get errors. If you want a real time kernel just make sure to get the rt patch that corresponds to the kernel version you want to build.

If you have an Nvidia card, DO NOT try to install the official drivers, also you will have to disable the nouveau kernel module with this custom kernel and just use plain vesa or nv drivers. Nvidia does not support Real Time kernels, although the kernel version on this guide at the moment does work with Nvidia, the one I'm currently testing does not, so I use plain "vesa" on my xorg.conf, I could use the "nv" but I get a very light screen flickering when opening certain applications or when I log in to gnome (if you know how to fix that, I would appreciate it), vesa works perfectly fine for me. Just try whatever you feel more comfty with and that it works. So please don't think about any cool "spiffy" 3D Desktop effects or visual fantasy "eyecandy", remember this is a Pro Audio setup. Besides GL acceleration hogs the CPU cycles and that causes xruns too.


But..., Why a Real Time Kernel??? I have a SUPER FAST COMPUTER!!!

Yes, I know, I perfectly understand..., and I have been told (and read) many times that patching a kernel with the RT (Real Time) patch by Ingo Molnar is not necessary anymore these days for audio, with machines being so fast and powerful now, having huge amounts of RAM and multi-threads, this is true! Very true indeed! But I do, even if I have an AMD Athlon II X3 at 3.2GHz with 8 Gigs of RAM that I built specifically for Pro Audio (and some 3D), and believe me, in the linux world, this is a powerful PC; the main issue here is not the computer, but the audio device, remember?, it's a USB1 compliant device, where USB1 audio devices are not very reliable because of the USB bandwidth limitation and latency or dropouts can be very common, if it was a USB2, Firewire or PCI card then this whole guide would probably differ, maybe it wouldn't even exist. So I want you to understand that it's not about pushing the computer to its limits to make it run faster, for crazy things like laser precision cutting, or firing missiles and controlling them via RC with your computer (yes you can do that, there is a US NAVY ship DDG 1000 Zumwalt Class Destroyer that uses Linux with real time kernel for these type of things), our purpose is different, it's to be able to prioritize the IRQ's in our box, and this can only be done with a Real Time kernel, and that's what we'll do with our USB IRQ's, we are going to push them up so that the Fast Track Pro runs with the highest priority possible while connected to the USB port, just below the Real Time Clock. Besides, not everyone has a fast computer, and the RT patch will be a plus for them.



THE GUIDE


PART II - KERNEL COMPILING

Note: Most text that you see formatted on a grey box:

like this

Means that it is code that you must place in a terminal window. You can easily just select it to copy and paste it to avoid any typos. If you feel like typing the code yourself, go ahead, but do recheck that you are typing everything just as is provided in this guide.

If you are a 100% ubuntu user you will find out that your user account is not added to the sudoers list, it can be enabled if you wish, but we will do all this as plain root using su in the terminal.You can google up later how to enable sudo in Debian.

Please!!!

Don't use other kernel versions or patches than the ones I'm pointing here, I have seen so many posts on the web about people using my guide with different kernel versions and then have problems booting to that specific kernel. Try to understand that the patches here are specifically for kernel 2.6.31.4, in other words, don't mix your drinks!


1.- First of all you have to download the linux kernel and the Real Time patch by Ingo Molnar that corresponds to the same kernel version. The versions we want for both are 2.6.31.4 since we will be applying the same version of the Fast Track Pro patch. You can browse the kernel site at http://www.kernel.org

It can be a bit hard to browse and find the files, since they have all the kernel versions in there all the way down to the first historic ones that used to run on calculators :) so I will point you to the right files from here.

Linux Kernel version 2.6.31.4 click here to save it to your computer.

Ingo Molnar's Real Time Preemption patch for Kernel 2.6.31.4 click here to save it to your computer.

2.- Next you will need the M-Audio USB Fast Track Pro patch to make it work like it should under this new kernel that we will build. Click here to download it.


3.- Open up a terminal and type:

su

and hit enter. Yes, as I mentioned before, we are going to do all as root.....


4.- Next we will install the necessary packages to compile a kernel. So now that you are logged in as root in your shell (terminal) do:

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 zlib1g-dev


 5.- Now we will move the downloaded files (kernel source and patches) to the /usr/src directory, so cd to where you downloaded them and do:

mv linux-2.6.31.4.tar.bz2 /usr/src

mv patch-2.6.31.4-rt14.bz2 /usr/src

mv usbaudio-ftp-2.6.31.4.patch /usr/src


6.- Then we cd to the /usr/src directory, since we will be working from there:

cd /usr/src

We extract the kernel source:

tar xjfv linux-2.6.31.4.tar.bz2

We create a symlink (symbolic link) to it:

ln -s linux-2.6.31.4 linux

and we cd to the symlink:

cd /usr/src/linux


7.- We now apply the real-time and m-audio patches:

This first command is just a test to see if the patch won't spit out any errors:

bzip2 -dc /usr/src/patch-2.6.31.4-rt14.bz2 | patch -p1 --dry-run

If you didn't get any errors (which you shouldn't) then do:

bzip2 -dc /usr/src/patch-2.6.31.4-rt14.bz2 | patch -p1

Now the kernel source is patched with the real time preemption code by Ingo Molnar.

Next is the M-Audio USB Fast Track Pro patch:

patch -p1 /usr/src/linux/sound/usb/usbaudio.c < /usr/src/usbaudio-ftp-2.6.31.4.patch

We have applied all of our kernel patches.


8.- Now the fun.... we are now ready to go into the configuration of our kernel. What we will do here first is copy the current configuration of our running kernel, this way we don't have to set too many things up in the kernel configuration from start, believe me, it can take a long time to configure it. Maybe in the future, if you feel a little adventurous, you can try it, but for now and simplicity's sake, let's just copy it so we can then just tweak it:

cp /boot/config-`uname -r` ./.config

Now we have a .config file in our kernel source tree identical to our original kernel.

Now, something quite important, if you don't have your terminal window maximized (full size), it's a good idea to do it now, since going into the configuration, it's best to view in a maximized terminal.


Now do:

make menuconfig

You are now in the configuration of the new kernel, first we load our copied .config from our current kernel, so go to the bottom where it says Load an Alternate Configuration File and select .config, now just tweak the following settings and try not to mess around with anything else, even if it looks tempting, also when you enable some options described below, it will tell you that it will enable them as modules only, don't worry, just say yes.

TIP: hitting "esc" key twice takes you back up the tree... If you accidentally hit it to many times to where the configuration asks you if you want to save your config to exit, just hit "esc" again and will take you back.

PROCESSOR TYPE AND FEATURES:

     Disable Tickless System
     Enable High Resolution Timer
     Processor Family: Select your processor type here.
     Preemption Mode: Select Complete Preemption (Real-Time)
     High Memory Support: If you have more than 4GB RAM you can select 64GB.
     Timer Frequency: 1000 Hz



POWER MANAGEMENT AND ACPI OPTIONS:

     Enable ACPCI Support
          Disable Power Management Debug Support
          Enable ACPI (Advanced Configuration and Power Interface) Support
          Disable CPU Frequency Scaling



DEVICE DRIVERS:

     Soundcard Support
          Enable Advanced Linux Sound Architecture
               Enable Sequencer Support
               Enable Sequencer dummy client
          Enable HR-Timer Backend Support
               Enable Use HR-Timer As Default Sequencer Timer
          Enable USB sound devices
               Enable USB Audio/MIDI driver

Look for Sound Devices and enable additional audio cards that you have, if they are all selected then leave them like that, if you want to enable them all it's ok, it means your pc will have support for all those audio chips.

Still in Device Drivers section (Going back up the tree):

          Enable Real Time Clock
          Disable Staging Drivers (RT kernel compiling will halt with errors if enabled)



KERNEL HACKING:

     Enable Magic SysRq Key (Always good to have!)
     Disable Kernel Debugging (Will build a very small kernel like 20 MB, otherwise it will be > 500MB, but you won't be able to debug kernel issues)



SECURITY OPTIONS:

     Enable Different Security Models


We're done configuring our custom kernel! Exit and please do say yes to the prompt "Do you wish to save your new kernel configuration?"


9.- Now we build the kernel, type:

make-kpkg clean

Then:

fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

You can change the word custom to anything you like, just make sure it begins with - and has no spaces.

Go get a healthy snack, watch TV or take a nap.....this will probably take a good while depending on your system specs.

When you come back, you should have 2 deb packages in /usr/src named something like:

linux-headers-2.6.31.4-rt14-custom_2.6.31.4-rt14-custom-10.00.Custom_i386.deb
linux-image-2.6.31.4-rt14-custom_2.6.31.4-rt14-custom-10.00.Custom_i386.deb

Install them and boot to your new kernel to see how all is going. Remember, you can uninstall them from synaptic if not working.



PART III - SYSTEM CONFIGURATION:

Now we are going to do some main adjustments for the IRQ balancing and Fast Track Pro:

Let's first do the IRQ balancig step: We have to install a script that helps the Real Time kernel to decide which IRQ will have higher priority. In the case of audio work, we want to give the soundcard the highest priority possible. But then, in the case of M-Audio FTP, since it's a usb audio device, we want all usb audio interfaces to be at the highest possible.

So here we go:

1.- First, you have to make sure 'schedutils' is correctly installed on the system, on Debian this will be included in the 'util-linux' package, so go to synaptic and make sure you have util-linux installed (which should be since it's an essential package, but doesn't hurt to double check).

Now download and install the rtirq-init script by Rui Nuno Capela. (Taken from the Debian "sid" unstable repository, don't enable that repository, just download this file and install it)


Click here to download it.


Install it (righ click on it and select "open with GDebi Package Installer", or do:

su

enter your root password.

cd to wherever you downloaded it and do:

dpkg -i rtirq-init_20110314-1_all.deb


and we edit the configuration file for the rtirq script:

gedit /etc/default/rtirq


Look for line# 30 that should read:

RTIRQ_NAME_LIST="rtc snd usb i8042"

Change it to:

RTIRQ_NAME_LIST="rtc usb snd i8042"



And line# 44 almost at the end of the file, which should read:

RTIRQ_NON_THREADED="rtc snd"

Change it to:

RTIRQ_NON_THREADED="rtc usb snd"

Save and close the file.

Ok, in theory, every time you boot your system with the Real Time Kernel the file rtirq in /etc/init.d is supposed to execute at boot time, giving highest priority to the Real Time Clock and then to all USB audio devices.

To manually start it up, all you have to do is issue the following command as root (su):

/etc/init.d/rtirq restart

There are other commands for this script which are:

[re]start | stop | reset | status | force-reload

which I believe are quite predictable at what they do

issuing
/etc/init.d/rtirq status

will give you a nice list of what's going on and you should see that USB ehci_hcd is just below thr RTC only if you have already executed rtirq with the start or restart command, or rebooted your computer after installing it. In short it means it's running in high speed mode....

Now we have to create a file for M-Audio Fast Track Pro (suggested by unofficial ALSA wiki), this is what they say:


This will put the FastTrack Pro at device number 5 with 24bit mode, max. 48kHz sampling mode, 2 inputs and 4 outputs. According to the patch, the possible values for the device_setup parameter are the sum of the following numbers:


* 0x01 : use the device_setup parameter, always needed
* 0x02 : enable digital output (channels 3,4)
* 0x04 : use 48kHz-96kHz sampling rate, 8-48 kHz if not used
* 0x08 : 24bit sampling rate
* 0x10 : enable digital input (channels 3,4)

Recording can be done e.g. by using arecord:

arecord -c2 -t raw -fS24_3BE -d5,0 ...


I have placed the file on the server for you to download.

Click here to download it.

Now cd with your terminal (still as root) where you saved it and do:

chown root fast-track-pro.conf

chgrp root fast-track-pro.conf

mv fast-track-pro.conf /etc/modprobe.d

You can open and read the file for how to set up the Fast Track to run above 48KHz or enabling the Digital ins/outs. Just make sure to follow the instructions in the file and unload and reload the kernel usb-sound module while Fast Track pro is powered off or it won't work.


Last is setting your permission to use realtime audio on the system:

First we'll check if you are in the audio group.

So in a terminal do:

groups username

Where username is your username


You should see a list of group names where you belong to, if you do see audio in that list all is well, if not, you will have to add yourself to the audio group.

Do as root:

useradd -g audio user

Remember to substitute "user" for your username!



And last, we'll edit /etc/security/limits.conf

gedit /etc/security/limits.conf


At the very bottom of that file you are going to place the following lines:


@audio - rtprio 99

@audio - memlock unlimited


And that's all you have to insert.

A lot of people tend to put an extra line that says "@audio - nice -10". This is totally unnecessary, as Paul Davis (The main developer of JACK and Ardour) has stated: "the "nice" entry is not required. this is a mistake that has been propagated online by people who don't know what they are talking about. its very unfortunate that it has spread so far and wide."

You can see the original post here

Save and close that file.

Now reboot...... I'll wait right here for you.

We now just have to set up qjackctl for Fast Track Pro, below is a screen shot of my settings.

Maybe you want to copy these settings as a base, later you can adjust somethings and test. But this works perfectly well for me.

NOTE: I use JACK2, so under Server Path in qjackctl settings it is advisable to put jackd -S if you are also using JACK2, this makes JACK run in sync mode, which is faster.If you use JACK1 maybe you want to set your Frames/Period to 128, it's just matter of trial and error, but I have found out that with JACK1 I can barely hear a little latency at 256 which I don't with JACK2.





And the results (click for larger view):


AND SOME SCREENIES OF ARDOUR WITH MIXBUS:






A VERY IMPORTANT TIP:

It's recommended to disconnect any other USB audio devices (USB keyboards, sequencers or mixers don't count as USB audio devices) like webcams with microphones, usb mics or usb speakers from the computer since they can create some conflicts especially when attempting to change the sample rate on FAST TRACK PRO, especially since you have to issue the following commands:

modprobe -r snd-usb-audio
sudo modprobe snd-usb-audio


As stated in the fast-track-pro.conf file





SOME NOTES ON BIOS SETTINGS:

One thing you can also tweak is in your BIOS to improve your system, that is to disable the Spread Spectrum option, this is mostly used for overclocking, what it does is reduce Electromagnetic Interference when processor spikes go really high , if you find you get some interference then enable it or leave it enabled, but performance is reduced a little bit. Disabling it will improve performance in the Real Time Clock.



STRANGE STATIC NOISES:

If by any chance your FTP makes a high pink noise (like interference noise) while monitoring, this does happen once in a while, although rarely, just power it down for a few secs. and then power it on, a few people have reported this to happen once in a while, including me, nothing to worry about, this I believe happens when the 24 bit mode doesn't engage properly, so just repowering your FTP will do the work, but do wait a few seconds before powering it up again. Also remember to shut down JACK before powering down the Fast Track Pro.




WHAT TO DO WITH ALL THE STUFF IN /usr/src:

Once your custom kernel is installed you can delete the uncompressed linux-2.6.31.4 , linux-2.6.31.4.tar.bz2 , patch-2.6.31.4-rt14.bz2 , usbaudio-ftp-2.6.31.4.patch and linux symlink in /usr/src, if you have limited hard drive space, just keep a backup of the two kernel debs for future safety.


AND FINALLY:

Please don't try crazy things like installing the ALSA drivers on this new configured system, they will eventually break it all down, and you'll might even end up with no sound at all, there is a very basic rule in life, and you should stick to it:

"IF IT'S NOT BROKEN, THEN DON'T FIX IT...."

--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------


IF YOU FIND THIS INFORMATION USEFUL, WOULD YOU PLEASE CONSIDER A SMALL KIND DONATION? THANKS!

------------------------- 


IF YOU DON'T WANT TO DONATE HERE BUT YOU ARE AN ARDOUR USER THEN YOU CAN DONATE TO THE ARDOUR COMMUNITY HERE THEY REALLY NEED YOUR FINANCIAL SUPPORT TO KEEP ARDOUR GOING!


24 comments:

  1. hey! nice write-up. Just a detail, the rtirq default list contains this: i8042

    Isn't it the old PS/2 keyboard controller ? why is it in the list of IRQs to be prioritized high ?

    You may also want to mention that in terms of pure debian distros, AV-Linux is a relevant choice here. You may event want to talk to Glen (GMaq) so that this patch is included in the AV-Linux kernel.

    And a comment on semantic: the "real-time" kernel is an abuse of language. The so-called RT patch is making the kernel fully "preemptible" and brings "threaded IRQs". The latter is what makes it possible to prioritize IRQs over others. Note that vanilla kernel 2.6.39.x finally has it. And the last big thing about this kernel version: the big kernel lock is gone forever! AV-Linux 5.0 which is pure debian, has 2.6.39.1 as its default, with threaded IRQs on as well.

    ReplyDelete
  2. Hey Thorgal! You are absolutely correct I should change everything to "Fully Preemtible Kernel" I'll do that later.

    Yes I should contact Glen about AVlinux, he'll probably be interested in including my guide in his kernel and have more support for the Fast Track pro.

    I know about the i8042 in the rtirq script, I guess we'll have to ask Rui Nuno why he included it in the lines.

    Cheers! See you in Ardour....

    ReplyDelete
  3. Hey Joe, I apologize for not responding sooner and thank you for your comments. I already checked your new blog and is pretty awesome. I will update my links. Hey those are pretty nice screenshots of mixbus. I will get it pretty soon( I hope).

    ReplyDelete
  4. Hey Joe!

    Excelent job. I finally got my FTP up and running, and that without any noticeable latency!!

    I've only had one problem, but that one was quick:

    http://masetio.web.id/03-2010/compile-kernel-error-lguest-c3718-error-zlib-h-no-such-file-or-directory/

    Cheers!

    ReplyDelete
  5. About not getting rtirq to run automatically: This may be too obvious, but did you create the relevant start/stop links in /etc/rc?.d/? If not, try running

    update-rc.d rtirq defaults

    as root. See also here.

    ReplyDelete
  6. Yep, that was the very firtst thing I tried and it never runned on boot, I think I read somewhere "Squeeze" uses a new different way to do this, I'm thinking maybe webmin would assist, but I think it's a waste to install webmin server just for an individual script.

    Still thanks for your comment, we'll see what can be done...

    ReplyDelete
  7. Hi all !

    The patch for 2.6.39 has been merged into the sound kernel branch ! It will be available out of the box in Linux 3.1 :)

    The full story here.

    Thanks to all participants !

    ReplyDelete
  8. Congratulations Joe. This is a fine work, that I would like to have done myself...
    Anyway, it is a bit complex for me.
    Is there a possibility to create a bootable CD that we can boot on any computer, that has the patch and ardour, or maybe only arecord, and that allows to record FTB 24bits. I do that with a simple basic Ubuntu CD booted on any PC (currently a Windows PC...), but is works only 16 bits...

    Pierre Couderc
    pierre at couderc . eu

    ReplyDelete
  9. yomguy,

    Do I have to follow any of Joe's steps to go RT on 2.6.39?

    and how do I add "threadirqs" to the kernel boot arguments, and do

    $ sudo update-grub

    on a Gentoo system?

    ReplyDelete
  10. Sorry Bacon, I'm late !

    There are no RT patches for 2.6.39 to get it FULL preemptible whereas this one already includes most of the RT functions. So you don't need all Joe's steps but just apply the FTP patch on sources, compile and, yes, add "threadirqs" to boot args, then update-grub.

    But now new RT patches for 3.0.3 have been published. For those ones, yes, apply all Joe's steps and you will get it then FULL preemptible..

    I just tested 3.1 RC4 yesterday and the FTP mounted in 24 bits out of the box ! :-P But to tune the card, I needed to comment out all "options snd-usb-audio ..." calls in /etc/modprobe.d/alsa-base.conf not refering the FTP but this one :

    options snd_usb_audio vid=0x763 pid=0x2012 device_setup=0x0C index=-2 enable=1

    ReplyDelete
  11. Just a couple of tips that maybe you should add to this guide :-)

    1 - I tried this procedure on a clean Debian 6 installation, and i had an error about missing library (precisely zlib.h) if you got that error you have to install zlib1g-dev to avoid the problem (add an apt-get line to your guide).

    2 - Recompiling the kernel is a very cpu-expensive activity, so you might consider to use the concurrency level at compile-time. To use all your cores you have to add the "-j" options to make-kpkg with your core_number+1. For example, if you have a dual-core you might use:

    make-kpkg -j 3

    Enjoy :-)

    ReplyDelete
  12. So, just to be sure that I understand this correctly… the M-Audio Fast Track Pro should work out of the box in 24-bit/96kHz mode with the current 3.1.x kernel?
    I consider buying this interface…

    ReplyDelete
  13. Peter, yes it should !
    24 bits is OK.
    But I must say that I didn't manage to get 96 kHz now.. I think I have to fix that in the driver soon.
    I propose we could manage a list of our tests so that we can know what is working and what is not.

    Yomguy

    ReplyDelete
  14. Also, I have to get the 4 output channels together. Now, It seems we can just have one pair of output (1&2 or 3&4) for a JACK session..

    ReplyDelete
  15. Note: I was able to handle multiple usb audio device like this :

    options snd-usb-audio index=2,3 vid=0x46d,0x763 pid=0x81d,0x2012 device_setup=0x00,0x12 enable=1,1

    ReplyDelete
  16. I have no words for this great post such a awe-some information i got gathered. Thanks to Author.
    Vee Eee Technologies

    ReplyDelete
  17. Joe, first thanks so much for all the work you've done with the FTP - I've used this post more than several times for reference while getting my FTP to work on Gentoo (which I've done successfully thanks to you). Also, props to yomguy (the 2.6.39 patch worked great !).

    Just wanted to report/update to anyone that is using this device on Linux:

    I had the opportunity to build up a new box this past week, so I chose to use Gentoo 'testing' (~), which to gentoo, is more 'leading edge' on the repos, so you get very recent releases, etc. So, I did pull kernel 3.1.5 and configured the USB audio in the device settings. I can also (like yomguy) say that FTP works great 'out-of-the-box' on Kernel 3.1.5, no patches needed. Nothing to add but the one-line file 'fast-track-pro.conf' into the /etc/modules.d/ dir, and turn the device on. I used the "device_setup=0x09" to start testing. I also noticed now that the new builds of JACK add a 'realtime' group with the priorities already set in the /etc/security dir, so instead of adding the '@audio' lines into /etc/security/limits.conf, all you have to do after the jackd install is add the user the 'realtime' group and done!

    First start up of jackd on the new kernel from the commandline was periods at 256 and priority on 'default' gave 5.3ms!, 48k 24-bit Big Endian! (Duplex) Sweet !

    I ran a few checks with jack-capture both from a streaming source and from a physical input source (Microphone) and the FTP seemed to hold up just fine, no xruns, no aborts or errors that I could see. Like Yomguy, I'm going to try to get through the other 'setup' options and see how the device goes. But for basic, duplex 24-bit, 48K In/Out, looks like the stock 3.1.x kernel is supporting well.

    I noticed Avid is still promoting/selling this device under the M-Audio label and it's in a sweet price range (especially if you can find 'B-Stock' on Amazon) for the intro home studio folk so I'm guessing people are still buying it. Youtube seems to have an excessive number of 'reviews' on this device too, some good, some not-so-good ;)

    ReplyDelete
  18. 8mihi: great!

    For all new tests with 96kHz mode, please drop me an email as a copy of your messages here: yomguy _at_ parisson.com

    I hope I can submit a patch for this and better documentation for config to the Linux sound branch before the 3.2 release :)

    Cheers!

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. Hello,

    Can you please update to the latest kernel(3.1)? I really want to try it and the main difference is there is no more "sound/usb/usbaudio.c" and it seems that the functionality has split into several files. It would be great if you can update the patch.

    thanks!

    ReplyDelete
  21. It's anonymous again. My real problem is that my card is recognized as 2 devices in Jack. Basically 2in-2out or 2out options. Is there a solution for accessing all 4 outputs? I heard talks of virtualizing with alsa but I don't know what that really means? I just absolutely need 4 simultaneous outputs. Any ideas?

    ReplyDelete
  22. Hello Anonymous, first of all have you tried compiling the 3.1 kernel as yomguy has mentioned here? I believe it is supposed to run at 24 bit with 3.x kernels out of the box. I really don't have the time to do further testing at the moment, I am working in my music now which is very important for me and I really don't feel like breaking my audio workstation environment. Like I said, if it's working don't fix it. You have to remember that compiling to a newer kernel there has to be a real excuse to do so, like some fancy hardware that just wont run in your original kernel and you are absolutely sure it will with a newer one. Many people feel pressured with newer versions of things and feel the urge to upgrade to run the latest. This is not the case, and it should never be until it's absolutely necessary. The problem you have with JACK detecting the FTP as two individual devices is normal (although it shouldn't be) but I guess it's a problem with the patch or even JACK and the way JACK detects and routes things it sees, believe me I have been trying and trying to get the full 4 outs at once myself with no avail, and it will always be that way as long as JACK sees the device as two different devices.

    ReplyDelete
  23. Hi Joe,

    Have you or anyone else experienced having to reload alsa, after cycling the power on the FTP? Other than after a fresh reboot every time I power off and power back on the FTP I need to do "sudo /sbin/alsa force-reload", removing and reinserting the usb audio module by itself doesn't seem to do the trick.

    On another note, I've also experienced the pink noise (and some other very weird digital distortion) when I try to push the envelope too far with my settings... Trying to start it with in 48kHz with frames/period at 128 and periods per buffer at 2 generates this pink noise without fail--although mine seems to be more persistent, sometime I need to leave it powered off for a few minutes and/or switch the usb bus. Sometimes I'll also get pink noise or weird (non xrun, non peak) digital distortion even with slightly more conservative settings depending on the applications I'm using with it (Audacity is especially bad with this, luckily I have no reason to use Audacity over Ardour). I'd believe that these could all be problems with 24bit mode not engaging properly. It might be interesting though to have FTP users compare notes about at what settings and how consistently they run into occurrences of pink noise/digital distortion so we can map out the frontiers of where the FTP is stable and where it is less so.

    Thanks for your great tutorial! It's useful even for those who get pre-patched kernels elsewhere!

    Austin

    ReplyDelete
    Replies
    1. Hello Austin, thx for your comments.

      I think the only issue when not being able to reload the USB audio kernel modules is because you probably have another USB audio device connected into your computer, even a webcam with integrated microphone will be the culprit for this problem, so issuing "modprobe -r snd-usb-audio" and "modprobe snd-usb-audio" will problably give you an output like "fatal, usb audio modules are in use", is that your case? What I had to do is blacklist all USB audio devices at boot time that way the webcam microphone would never get a grip of it, then issuing the commands even with the Fast Track Pro powered on has been possible, although I still have to power it off sometimes mostly if I get the distorted sound or pink noise. Also this pink noise to me seems more random than by pushing it too far, I always track and mix at 44.1KHz and master at 88.2KHz and I have noticed that the noise is very random even on 88.2. Sometimes waiting a few seconds between booting, powering the device and running JACK have helped to reduce possibilities of the noise.

      You should put a value of 3 in Periods/Buffer that is mostly the value for USB devices and some firewire cards I believe. JACK2 has been much better for me, even latency wise, so I run JACK at 256 and just barely about hear a very minimal latency.

      I just compiled kernel 3.2.5 with rt patches, patching with Fast Track Pro is no longer necessary but configuration files are still needed and are the same, I must say I am surprised how well it all works, I will soon update the guide for newer kernels, if you feel a little adventurous you can give that also a try.

      Thanks and hope you find a solution to this.

      Wish you the best luck.

      Joe

      Delete

About Me

My Photo
Mexico City, D.F., Mexico
Born in Queretaro, Mexico. Originally from San Miguel de Allende, a true traveler of time and space, also a frustrated knight in search of the Holly Grail of Perfection