How to have Focusrite Saffire working on Ubuntu Gutsy

December 20, 2007

When upgraded Ubuntu from Feisty to Gusty, the newer freebob audio-firewire driver broke the support of Focusrite Saffire Pro. I have not tested the non-pro versions (Saffire and Saffire LE), but I guess it applies also to them.

Freebob/ffado main developer quickly identified the problem and proposed a provisional patch, which is what I’m gonna explain in this post. For a more definitive solution we’ll probably have to wait to the next ffado release. Hopefully soon.

First, the symtoms: This is how Gutsy freebob complains when starting jack with a Saffire Pro.

$ jackd -d freebob
jackd 0.103.0
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
Freebob using Firewire port 0, node -1
unexpected response received (0x9)
Error (bebob_light/bebob_light_avdevice.cpp)[1679] setSamplingFrequencyPlug: setSampleRate: Could not set sample rate 48000 to IsoStreamInput plug 0
Error (bebob_light/bebob_light_avdevice.cpp)[1696] setSamplingFrequency: setSampleRate: Setting sample rate failed
FreeBoB ERR: FREEBOB: Error creating virtual device
cannot load driver module freebob

The problem is related to the sample rate interface. The quick solution is not using that interface. Just a matter of commenting out a piece of code.

Update 9th March:
Pieter Palmer makes me notice that from version 1.0.9 there is a ./configure switch that does what the below patch does. So you can safely skip the part of this blog about downloading 1.0.7 version and applying the patch.

Instead you should download the svn trunk

svn co https://freebob.svn.sourceforge.net/svnroot/freebob/trunk/libfreebob libfreebob

and then use –disable-samplerate at the ./configure step.

Begin deprecated:

Apply the following patch. If you don’t know how to do it, follow these steps: copy-paste the following patch into a file (i.e. /tmp/saffire.patch).


Index: src/libfreebobstreaming/freebob_streaming.c
===================================================================
--- src/libfreebobstreaming/freebob_streaming.c	(revision 449)
+++ src/libfreebobstreaming/freebob_streaming.c	(working copy)
@@ -154,7 +154,7 @@
 	 * This should be done after device discovery
	 * but before reading the bus description as the device capabilities can change
	 */
-
+#if 0 //disabled for Focusrite Saffire
    if(options.node_id > -1) {
        if (freebob_set_samplerate(dev->fb_handle, options.node_id, options.sample_rate) != 0) {
            freebob_destroy_handle(dev->fb_handle);
@@ -178,8 +178,8 @@
			return NULL;
		}
	    }
-
	}
+#endif

	/* Read the connection specification
 	 */

Then change dir to the checked out repository and apply the patch:

cd libfreebob-1.0.7
patch -p0 < /tmp/saffire.patch

End deprecated:

Now, the building phase. Get the build dependencies.

sudo apt-get build-dep libfreebob0

There is a problem here. For some reason libtool (or some package that includes it) is missing in the debian/control file. This seems to me a packaging bug that makes autoreconf give errors like this one:

possibly undefined macro: AC_ENABLE_STATIC

So, install libtool:

sudo apt-get install libtool

And build:

autoreconf -f -i -s 
./configure
make
sudo make install

To make sure that jack will take the new libfreebob (in /usr/local) we will hide the current freebob libs to jackd. I mean the ones installed by the debian package.

cd /usr/lib
sudo mkdir freebob_hidden
sudo mv libfreebob.* freebob_hidden/

That’s all.
As always check that raw1394 module is ready. Else do this:

sudo modprobe raw1394
sudo chmod a+rw /dev/raw1394

Now jack should work without complaining:

 jackd -d freebob

How to compile freebob with optimizations

CFLAGS="-march=core2" ./configure --enable-optimize --enable-mmx --enable-sse

Or use this for 64bits enabled cpus:

CFLAGS="-march=nocona" ./configure --enable-optimize --enable-mmx --enable-sse

References:

I’m very thankful to Pieter Palmer for the quick help at #ffado irc channel.

My next posts will talk about the reason I needed audio-firewire in linux. It was related to a real-time 3D audio exhibition developed with CLAM. It just happened yesterday and I’m very happy that it all worked really well.

Advertisements

11 Responses to “How to have Focusrite Saffire working on Ubuntu Gutsy”

  1. Mark Says:

    Thanks for the post! Btw. the patch already seems to be obsolete. My Saffire LE is apparently not working because of another reason.

  2. David Says:

    Thanks for the post! I am running Gutsy with a standard Focusrite Saffire! After much wrestling (I am a Linux novice) I have successfully installed libfreebob and jack. And running:

    jackd -d freebob

    and

    qjackctl

    from respective terminal windows seems to work… hallelujah! I see the qjack control panel, all the Saffire inputs and outputs, and I even hear the telltale click of the saffire when starting up Jack.
    However, I cannot seem to get Gutsy or any other application to recognize Jack or the Saffire.

    Help!
    David

  3. Defunkid Says:

    hey Pau, no idea you have a blog!
    still alive and kicking, right?

    ciao

  4. soundBringer Says:

    Hi,

    Got it all working with the saffire LE, using gusty and ardour and then installed ubuntu studio on top, seemed to do the trick.
    As a complete novice to linux in general but pretty good at computers, I spent two days flat installing and compiling and reinstalling but the result is worth it.
    Very good sound in and out, no clicks and freezes so far, nice! Ubuntu Rules…
    SdB

  5. Goooxuuu Says:

    The new SVN has fixed this problem with a new prefix. so the pach here is now not an option as the SVN version has changed and the patch its not aplieble anymore, you will just get errors.

    Ask at freenode #ffado about it if you are in deep shit. I had the same error with my Phonic Firefly 302. It is now fixed. Im not skillful with linux so it could be that i messed up stuff earlier with my firefly card, so dont take my words as Absolute Eternal Flawless Truth or something. Good luck

  6. Pierre Says:

    Hello, I’m a french and novice user of Linux, I have a Ubuntu studio distribution and I’m trying to install a Phonic Helixboard 24 firewire MKII on my PC.
    It seems to be difficult … ;o)

    The mixer is well detected in linux, I can see it, but I have the same error message you’ve describe when I start Jack :

    $ jackd -d freebob
    jackd 0.103.0
    Copyright 2001-2005 Paul Davis and others.
    jackd comes with ABSOLUTELY NO WARRANTY
    This is free software, and you are welcome to redistribute it
    under certain conditions; see the file COPYING for details
    JACK compiled with System V SHM support.
    loading driver ..
    Freebob using Firewire port 0, node -1
    unexpected response received (0x9)
    Error (bebob_light/bebob_light_avdevice.cpp)[1679] setSamplingFrequencyPlug: setSampleRate: Could not set sample rate 48000 to IsoStreamInput plug 0
    Error (bebob_light/bebob_light_avdevice.cpp)[1696] setSamplingFrequency: setSampleRate: Setting sample rate failed
    FreeBoB ERR: FREEBOB: Error creating virtual device
    cannot load driver module freebob

    So, could you help me please, I’m trying for 2 weeks … no results …

    sorry, Idon’t speak english very well !

    Pierre

  7. Ernie Says:

    Pierre, have a look here:

    http://ffado.org/?q=node/493

    These instructions are for a Helix 24mkII. I successfully applied this method toward my 18mkII.

  8. caminante Says:

    Hey, I can’t intall FFADO here. Installed all the dependencies, but at the moment of doing “scons install” the check says libiec61883 is not installed. I tryed reinstalling libiec61883 and it behaves the same way. The version is correct (libiec61883-1.1.0).
    Any clue?
    Thanks in advance!

  9. jenny Says:

    Hi, have you upgraded to Ubuntu 8.04 yet, I was looking to get the Focusrite Sapphire with it, can you tell me if it works and how I would go about installing it, I’m a complete newbie.


  10. sgarealestates is the best website who offers you best deal of property in chandigarh, property in panchkula, property in zirakpur and property in mohali on reasonable rates.

  11. Omas ficken Says:

    What a nice post, really quality content my friend!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: