For whatever is worth, in addition to what James said, some audio-oriented distributions such as Ubuntu Studio come with the bridge already installed (that is, when you start JACK from QJackCtl, the Pulse Audio bridge starts automatically and it all just works).
B
On Fri, Jan 18, 2019 at 1:00 AM <aw@xxxxxxx> wrote:
> How do I route Supercollider through JACK so that I can also patch in other audio applications in Linux? Basically I'm trying to have Supercollider server running while being able to watch and listen to YouTube tutorials at the same time. Whenever I run SuperCollider, it takes over the audio and I'm unable to play YouTube videos..
>
> Any resource on how to mix JACK with multiple audio sources? I'm looking at qjackctl at the moment, but I'm not sure what I'm doing exactly.
This page is a few years old, but looks reasonable.
https://urldefense.proofpoint.com/v2/url?u=https-3A__askubuntu.com_questions_572120_how-2Dto-2Duse-2Djack-2Dand-2Dpulseaudio-2Dalsa-2Dat-2Dthe-2Dsame-2Dtime-2Don-2Dthe-2Dsame-2Daudio-2Ddevice&d=DwIFaQ&c=iVyFbx9TtkoGWXYs40w9MA&r=mSv1zL8QgVlQIHn9KwDD-g&m=ipugRFdvIZFFIKp3VVeOnXn_1esWHy0yi8Q-qmRsYA8&s=vcFbqrnudUbXpp4gCLH7sCxfeS4jQ-LTrgGTDwfbRbI&e=
You'll probably get some support for this question on the mailing
list, because a lot of SC users have dealt with the same problem. But
it isn't really a SuperCollider problem. The problem is between JACK
and PulseAudio. You're encountering it with SC because SC requires
JACK, and it might be the first JACK app you ever used.
BTW "Whenever I run SuperCollider"... are you starting the JACK server
before booting scsynth? It is very, very, extremely, strongly
recommended to start the JACK server first. It *might* work if you
just boot the server within SC, but it might not.
What is *supposed* to happen is that you start JACK, and D-Bus is
supposed to tell PulseAudio to release control of the sound card, and
then after JACK is up, D-Bus should tell PulseAudio to connect its
inputs and outputs to JACK.
This doesn't happen if you have not installed "pulseaudio-module-jack."
The answers on the page suggests various things you may need to put in
as JACK post-startup scripts... I've read different accounts. For some
people, it's easy. For others, it can get tricky.
FWIW, I found that D-Bus made it impossible to choose the JACK audio
device in qjackctl. So I don't use the above approach. Instead, I turn
off D-Bus in qjackctl, and set up PulseAudio so that it does not
automatically start on boot/wake: in /etc/pulse/client.conf,
autospawn = no
daemon-binary = /bin/true
(That is, don't automatically start, and even if something wants to
run Pulse as a daemon, redirect that to a dummy binary.)
Then I create ~/.pulse/default.pa:
load-module module-native-protocol-unix
load-module module-jack-sink channels=2
load-module module-jack-source channels=2
load-module module-null-sink
load-module module-stream-restore
load-module module-rescue-streams
load-module module-always-sink
load-module module-suspend-on-idle
set-default-sink jack_out
set-default-source jack_in
Then I create a couple of scripts (you need to set 'x' permission on these):
~/share/pulse-jack-scripts/start-pulse.sh:
#!/bin/bash
pulseaudio --start
pacmd set-default-sink jack_out
pacmd set-default-source jack_in
~/share/pulse-jack-scripts/stop-pulse.sh:
#!/bin/bash
pulseaudio --kill
Then in qjackctl, said "Execute script after startup" to the
start-pulse.sh path, and "Execute script on shutdown" to
~/blah/blah/stop-pulse.sh.
So then, when I start my system, I have no audio at all, but when I
click "Start" in qjackctl, then JACK connects to the audio hardware,
start-pulse runs, and PulseAudio connects to JACK. It looks like a
lot, but you do it once when you install the system, and it stays that
way until you upgrade.
That's an unconventional solution, but I've been using it for years
with no problems. Someone might reply to my message here and tell me
"but you can use xyz JACK configuration tool and D-Bus and everything
will be fine," but I don't see any reason to fix what isn't broken ;)
hjh
_______________________________________________
sc-users mailing list
info (subscription, etc.): https://urldefense.proofpoint.com/v2/url?u=http-3A__www.birmingham.ac.uk_facilities_ea-2Dstudios_research_supercollider_mailinglist.aspx&d=DwIFaQ&c=iVyFbx9TtkoGWXYs40w9MA&r=mSv1zL8QgVlQIHn9KwDD-g&m=ipugRFdvIZFFIKp3VVeOnXn_1esWHy0yi8Q-qmRsYA8&s=SgYqwdGdPnK22Pcx62vcfGGRo_xnRJUb1tX4dLU5NH4&e=
archive: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.listarc.bham.ac.uk_marchives_sc-2Dusers_&d=DwIFaQ&c=iVyFbx9TtkoGWXYs40w9MA&r=mSv1zL8QgVlQIHn9KwDD-g&m=ipugRFdvIZFFIKp3VVeOnXn_1esWHy0yi8Q-qmRsYA8&s=V04YWgjuAG4aCbDfTqqz9GovY6D878eov6ibdhrI9xY&e=
search: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.listarc.bham.ac.uk_lists_sc-2Dusers_search_&d=DwIFaQ&c=iVyFbx9TtkoGWXYs40w9MA&r=mSv1zL8QgVlQIHn9KwDD-g&m=ipugRFdvIZFFIKp3VVeOnXn_1esWHy0yi8Q-qmRsYA8&s=KpXdOuCuLAzsEXTejr-GL5WndBCCBaVUP7rDhVC5iEU&e=