Hi
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 would like to mimick the OSX behaviour as close as possible.
thanks,
Miguel Negrão
Miguel Negrão
[1]
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
do
run "ffado-test" ["BusReset"]
run "sleep" ["5"];
run "sh" ["-c", "qjackctl -s -p firewire" ]
else
do
run "sleep" ["5"];
run "sh" ["-c", "qjackctl -s -p alsa" ]
exit 0
#!/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
do
run "ffado-test" ["BusReset"]
run "sleep" ["5"];
run "sh" ["-c", "qjackctl -s -p firewire" ]
else
do
run "sleep" ["5"];
run "sh" ["-c", "qjackctl -s -p alsa" ]
exit 0
[2]
var jack_device = if("jack_lsp | grep firewire".systemCmd == 0){
"firewire_pcm"
}{
"system"
};
"SC_JACK_DEFAULT_INPUTS".setenv(jack_device);
"SC_JACK_DEFAULT_OUTPUTS".setenv(jack_device);
_______________________________________________ Linux-audio-user mailing list Linux-audio-user@xxxxxxxxxxxxxxxxxxxx http://lists.linuxaudio.org/listinfo/linux-audio-user