Does changing interfaces in JACK have to be so difficult?

Talk about your MIDI interfaces, microphones, keyboards...

Moderators: MattKingUSA, khz

Post Reply
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Does changing interfaces in JACK have to be so difficult?

Post by wolftune »

So, I've been messing around with different options. I got a pair of portable USB-powered speakers that take audio from USB only, I have an interface now, but I was playing around with using the built-in sound card too.

I don't understand the various options and settings, but I get the idea about using also_in and alsa_out to make multiple devices show up in JACK, that's great (though I need to learn more to master it).

I have the impression also that if I don't use JACK then ALSA on its own makes it simple enough to just change interfaces. ALSA seems more like my Mac: I can plug and unplug different inputs and outputs and I may need to restart an app to get it to recognize the change, but it's easy to just choose from the list whatever inputs and outputs I want for any given program.

But JACK seems really fussy. I can't seem to have JACK set to (e.g.) the USB interface and then easily change to the built-in sound card when I am doing something later without the USB. I want it to be simple: stop JACK, choose the other interface, start JACK again. Or when I switch back to USB, it should be just stop JACK, plug in the USB, choose the USB, start JACK. However, I seem to have to do a force-restart on JACK to get it to recognize changes of which cards are available, and this is annoying also because it starts then, so then I have to stop it and start it again. And there's been other glitches.

The question is: how do I switch back and forth between built-in vs USB when I plug and unplug the USB… It isn't so bad if I leave everything plugged in and need to switch, but it seems hard to get JACK to refresh to see what is available. Is there some specific order of stopping, unplugging, refreshing, starting that will make things smooth?

For reference, I'm using KXStudio and I was doing this under Cadence's drivers settings (which makes it all that much more tedious because it is several clicks to get to the right menu…
Last edited by wolftune on Wed May 09, 2012 5:20 pm, edited 1 time in total.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
SR
Established Member
Posts: 218
Joined: Wed May 07, 2008 6:01 pm
Location: Houston, Tx

Re: Does changing interfacing in JACK have to be so difficul

Post by SR »

Qjackctl will allow you to have different profiles you can switch to quickly. I use it when I switch from firewire to the builtin audio on my laptop. It's just a matter of saving the profile with a unique name in the settings dialog. When you want to switch you just stop jack, right click qjackctl, pick the different profile and then start jack again.
wolftune
Established Member
Posts: 1350
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Been thanked: 2 times
Contact:

Re: Does changing interfacing in JACK have to be so difficul

Post by wolftune »

Thanks, SR.

So these alternate profiles, they will still work, won't get messed up, by the interfaces being plugged and unplugged?

Do I still need to be absolutely sure to stop JACK before unplugging the interface when currently using it?

Can I be using built-in sound and then plug in my interface without stopping JACK and still switch later by just stopping JACK and then loading the profile for the interface and restarting?

I'm hoping for a situation in which regardless of any previous status, I can have JACK stopped, choose the interface I want (assuming it is plugged in) and start JACK, as simply as possible. But if I need to be careful about when I plug in / unplug and when I stop JACK, I'd like to know.
Aaron Wolf
Music teacher, scholar
http://wolftune.com
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: Does changing interfacing in JACK have to be so difficul

Post by Pablo »

Afaik, Jack was not designed with "desktop integration" in mind. However, there is a hope. Robin Gareous called it "backend-switching". There is even a video demo. In the last part of it, you can see that the sound changes automagically from the onboard to the USB card.

http://rg42.org/start?first=5

You probably run a jackdbus version recent enough but you will need the something more explained there. I don't know if these hacks are included in KXstudio, but who knows. At least it works in Robin's computer. I haven't tested it myself.
It isn't so bad if I leave everything plugged in and need to switch,
.

In this case, I suggest you should decide beforehand on what audio card(s) you will use and, if needed, launch alsa_in/out from qjackctl (options, script after the server starts).
Post Reply