[LAU] jack firewire + built in audio

Miguel Negrao mnegrao.lists at gmail.com
Wed Sep 25 16:36:20 UTC 2013


Just wanted to check if there's an official approach to my situation:

I have a macbook pro, sometimes I use the built in sound card (jack with
alsa backend) and sometimes I use a MOTU soundcard (jack with firewire
backend from ffado).

I switch from one to other all the time, multiple times per day. I have
several issues with that:

- For each sound card I need to boot jack with different settings
(basically just different backend ).
- The names for the connections are different, for alsa they appear as
'system_0', etc. for firewire they are 'firewire_pcm'.
- Going from one config to the other I need to stop jack and restart it
with the new settings.

In OSX to switch from one sound card to another, it's as simple as removing
the firewire cable and sound will migrate to the internal sound card,
plugging it back again migrates again to firewire ( I had firewire as

I would like to mimick the OSX behaviour as close as possible.

Currently I have a script at startime that checks for the existence of
/dev/fw1 and boots with the right parameters [1]

Also in supercollider I have to run this code [2] at startup to connect to
right inputs/outputs.

I was just wondering if there is a simpler solution to this, or if there is
some plan to make it easier to switch soundcard with jack in the future ?

Would there be any way to monitor firewire appearing and disappearing and
running an appropriate script ?

Miguel Negrão


The script is written in Haskell:

#!/usr/bin/env runhaskell
{-# LANGUAGE QuasiQuotes, OverloadedStrings #-}

import Shelly
import Shelly.Background
import Prelude hiding (FilePath)
import qualified Data.Text.Lazy as T
import qualified Data.ByteString.Char8 as B
import Control.Concurrent
import Data.List (isInfixOf, sort)
import Text.Shakespeare.Text (lt)
import Filesystem.Path.CurrentOS hiding (fromText, (<.>))
import Text.ShellEscape
import System.Environment

runC x xs = catchany_sh (run x xs) (\_ -> return "x" )

main = shelly.verbosely $ do
    runC "killall" ["-9", "jackdbus" ]
    runC "killall" ["-9", "jackd"]
    runC "killall" ["-9", "qjackctl.real"]
    fwExists <- test_e "/dev/fw1"
    echo [lt|Firewire detected: #{show fwExists} |]
    if fwExists then
            run "ffado-test" ["BusReset"]
            run "sleep" ["5"];
            run "sh" ["-c", "qjackctl -s -p firewire" ]
                run "sleep" ["5"];
                run "sh" ["-c", "qjackctl -s -p alsa" ]
    exit 0


var jack_device = if("jack_lsp | grep firewire".systemCmd == 0){

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20130925/78955252/attachment.html>

More information about the Linux-audio-user mailing list