ovenwerks / studio-controls

A helper for setting up a system for audio work
GNU General Public License v2.0
73 stars 10 forks source link

Option to not add USB devices to JACK #64

Closed marksumm closed 2 years ago

marksumm commented 3 years ago

Is there any way to prevent Ubuntu Studio Controls from connecting all USB audio devices to JACK? With QJackCtl, I'm able to continue using my webcam (for example) with PulseAudio while having my main audio interface connected to JACK.

ovenwerks commented 3 years ago

It depends on the version. In older version on the extra devices tab there is a check box: Bridge USB Devices to JACK When Plugged in. This can be unchecked. In newer versions you may need to turn each one off individually in the same tab. I am thinking right now I need to test that and see what does happen and make sure it is consistent. The other thing you can do on a device basis is to check: Hide this device. Hiding a device will not allow it to be bridged or become a master device.

marksumm commented 3 years ago

I installed studio controls from the studio-controls package version 2.2.0-0ubuntu1~ubuntu20.04.1~ppa1 and "Bridge USB Devices to JACK When Plugged in" was already unchecked. It seems that as soon as jack is started from studio controls, there are no longer any selectable input devices for pulseaudio. Hiding the webcam device didn't help.

marksumm commented 2 years ago

@ovenwerks I looked into this a bit more and it will simply never work. The only pulseaudio modules being loaded by autojack are module-jack-sink and module-jack-source. Therefore, the only way to restore the usability of a USB device with pulseaudio with jack running is to explicitly load module-udev-detect via pactl or restart pulsaudio via pulseaudio -k

ovenwerks commented 2 years ago

AH, I misunderstood your concern.

USB devices should never be detected by pulse if jack is being bridged to pulse. When jack is stopped, however, pulse is restarted which reloads module-udev-detect. If this module is loaded at the same time as either of the jack bridges, the usb device will cause xruns in jack. For anyone doing profesional audio, xruns are not acceptable. Therefore having module-udev-detect loaded while pulse is bridged to jack is not acceptable and will never get added to studio controls for this reason.

Thankfully, pulseaudio's days are numbered and it will soon be replaced by pipewire which deals with pipewire/jack bridging correctly... That is the jack media clock becomes the master clock. When studio-controls is able to use pipewire then perhaps things will work as you expect.

In the mean time, USB devices will be loaded via jack and extra pulse-jack bridges can be setup to allow those devices to be seen in pulse. As such this issue will be closed.