Hotplugging and Jack, persistent configuration per device

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
progwolff
Established Member
Posts: 44
Joined: Tue Sep 27, 2016 9:08 am
Location: Lübeck, Germany

Hotplugging and Jack, persistent configuration per device

Post by progwolff »

Hi,

I am a student of computer science and a semi-professional keyboard player and singer.
As such I use my notebook for daily work, music playback and sometimes gaming, but also live on stage.
Reconfiguring Jack each time I plug in my USB audio interface seemed a little wasteful and error-prone to me.
As far as I know, there is no existing solution for handling multiple audio interfaces with jack in a reasonable way, so I wrote one myself.

For those who have similar requirements, here are two repositories where you can find a collection of scripts that help managing mutiple interfaces ( https://github.com/progwolff/jackman )
and a KDE systemsettings module for easy configuration ( https://github.com/progwolff/jackman_kcm )

Arch Linux users can find PKGBUILDs in both repositories.

With these scripts you can
  • Save persistend jack configurations for each device, easily switch between multiple devices.
  • Hotplug USB devices (currently ALSA only). Based on priorities the Jack master device will automatically be switched when a device with higher priority was plugged in. When the current master is unplugged, a new master will be set automatically.
  • Restore your settings after suspend/hibernate.
  • Attach alsa_in/alsa_out for all non-master devices.
It also works great in combination with libflashsupport-jack and pulseaudio-jack. With most applications, audio just continues playing when the master device changes.

Read the scripts before trying it. It is still a little hackish, but runs stable for me.

This is in no way a replacement for Cadence/QJackCtl/... and I don't want to create a new solution for things that already exist. As hotplugging devices is probably something only few users really want, I think this is best done seperately. In fact, I use it together with Cadence and especially Catia, doing the initial jack configuration with Cadence and using Catia and my kcm-module to assign audio sources to audio devices.

So, I just wanted to show this. Maybe it helps someone. Probably Arch/KDE users in particular.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: Hotplugging and Jack, persistent configuration per device

Post by CrocoDuck »

Wow! Pretty Hot! Thanks for sharing!
Post Reply