30

Whenever I launch hydrogen it breaks my audio in all other applications which use Pulse, for example, I can no longer play videos in Chrome after having launched Hydrogen once, until I restart my PC or do sudo alsa force-reload. I have found people with similar issues, but no actual guide to fix this, often there are links to http://jackaudio.org/pulseaudio_and_jack (which has moved to http://jackaudio.org/faq/pulseaudio_and_jack.html ) I am using Ubuntu Studio 14.04 64bit.

ALTERNATIVELY if this is truly impossible to achieve, can someone tell me how to use Jack on one soundcard and Pulse on another? This way I could plug in a USB sound card only when I need JACK.

Please don't make me use windows.

24

As of 16.04, things become a lot simpler :)

Just install qjackctl and pulseaudio-module-jack module:

apt-get install qjackctl pulseaudio-module-jack

Then configure qjackctl to run the following command after startup. Copy it into "Setup..." > "Options" > "Execute script after Startup":

pacmd set-default-sink jack_out

And that's it. Pulseaudio will recognize (through D-Bus) that JACK started, and automatically will route audio to it. When JACK is stopped Pulseaudio will revert to normal routing and start sending audio directly to card again.

So (almost) by default Pulseaudio implements the setup detailed above by mmv-ru.

  • This is the easyiest solution I have seen so far! At last I can use jack without muting everything else! Thank you. – kapcom01 Jul 9 '16 at 9:02
  • 8
    pactl set-default-sink jack_out -> "Failure: No such entity" – Karl Morrison Aug 20 '16 at 15:46
  • 1
    this worked for me when other solutions did not, many thanks! – malte Mar 7 '17 at 20:22
  • 2
    The correct command is 'pacmd set-default-sink jack_out'. Unfortunately I can't correct the answer because an edit must be more than 6 characters! :-( – Todd Chaffee Apr 7 '17 at 17:46
  • 2
    @KarlMorrison, you probably need to execute pactl load-module module-jack-sink channels=2 and pactl load-module module-jack-source before that, see @kim-tucker answer. – naktinis Jul 13 '18 at 14:43
17

This Youtube video: "Jack and PulseAudio Together as Friends - Linux" seemed to have some answers:

The key to the solution appeared to be making sure pulseaudio-module-jack is installed with:

aptitude install pulseaudio-module-jack

then sudo editing the /etc/pulse/default.pa file to include two lines under the load audio drivers manually section:

load-module module-jack-sink
load-module module-jack-source

then - I think - restarting pulseaudio. I just restarted the PC (lazy, I know) and it worked a treat... firing up Ardour no longer killed pulseaudio, they played happily together.

  • BTW, you can also add the modules on the fly, using pactl load-module ... – 0__ Sep 21 '17 at 11:55
9

Just pased trough quest of Jack and Pulse coexistence on Fedora. Generally I happy with Pulseaudio, but sometimes need Jack audio.

My solution working on Fedora 23.

dnf install jack-audio-connection-kit jack-audio-connection-kit-dbus qjackctl

Don't touch /etc/pulse/default.pa !

Configure qjackctl

Settings

There a relevant fragment of ~/.config/rncbc.org/QjackCtl.conf

[Settings]
Server=jack_control start
Driver=alsa
InDevice="hw:PCH,0"
OutDevice="hw:PCH,0"

Options names of sink for pactl can be found by command:

pacmd list-sinks

There a one more fragment of ~/.config/rncbc.org/QjackCtl.conf to show full commands

[Options]
...
StartupScript=true
StartupScriptShell=pactl suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo 1
PostStartupScript=true
PostStartupScriptShell=pactl set-default-sink jack_out
ShutdownScript=false
ShutdownScriptShell="pactl unload-module module-jack-sink; pactl load-module module-jack-source"
PostShutdownScript=true
PostShutdownScriptShell="pactl suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo 0; pactl set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo"

Misc There, "Enable D-Bus interface" important for Qjackctl itself.

How it work

Now on boot PC work with PulseAudio only. All automatic work as without Jack.

After launch of Qjackctl,

  1. Qjackctl Startup script suspend primary audio card in Plseuaudio and allow Jackj get access to it "pactl suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo 1"
  2. Jack started over d-bus "jack_control start"
  3. Pulse automatically detect jack start over D-Bus and load jack sink and jack source.
  4. Qjackctl after Startup script change default sink in Pulse to jack_out. (I meet it not done itself) "pactl set-default-sink jack_out" (at first it look unnecessary, as all running PA clients switched to new sink, but new apps stuck on suspended sink without this command)

So system reconfigured to use "Pulse on top of Jack". (There I skip hardware input suspend, because I not use it anyway)

If "Stop JACK audio server on application exti" not checked, I can close Qjackctl and rerun it not disturbing setup.

After stop Jack by Qjackctl, all return back to plain uncluttered Pulse!

  1. Jackd stop by Qjackctl over dbus - "Enable D-bus interface" option.
  2. jack-source and jack-sink removed from Pulseaudio automaticaly by d-bus
  3. default sink in Pulse audio switched to audio card because jack-out disappear
  4. Qjackctl after Shutdown script activate audio card back in Pulseaudio "pactl suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo 1"

Tools Used

  1. jackd (from package pulseaudio-utils)
  2. jack_control (from package ack-audio-connection-kit-dbus)
  3. Qjackctl (from package pulseaudio-utils)
  4. pactl to control Pulseaudio from sctipts (from package pulseaudio-utils)
  • This answer is not explicit about how the configuration is done. Is it solely done via Qjackctl? If so, what files are the config settings in, and how are they set? – Faheem Mitha Mar 11 '16 at 16:42
  • Initial configuration made via package manager. jackg start/stop reconfiguration via jack-audio-connection-kit-dbus and Qjackctl scripts. – mmv-ru Mar 11 '16 at 16:48
  • I see. Some details along those lines would be extremely helpful. These details are notably missing from other answers, and information on the net. I'd prefer not to configure things via a GUI if possible. Are you usually in AU chat? If so, we can discuss it there. – Faheem Mitha Mar 11 '16 at 16:57
  • Qjackctl can be configured via gui as screenshots show. In Reply I show parts of .config/rncbc.org/QjackCtl.conf to show full lines of script. – mmv-ru Mar 11 '16 at 16:57
  • Not enough reputation to invite to chat. Invite me. – mmv-ru Mar 11 '16 at 17:31
7
  • The problem is Hydrogen (as Ardour) launch jackd at startup but don't close it at exit:
    But you can run killall jackd in a terminal after Hydrogen exit.

  • A complicated way to use Jack and pulseaudio software at the same time is to install "pulseaudio-module-jack" (also install qjackctl (gui for jackd) and pavucontrol if not present). Restart pulseaudio pulseaudio -k.
    Now close audio apps (Jack and pulseaudio),
    run jackd using qjackctl (click start button) (dbus option must be selected in qjackctl settings last tab).
    In Pavucontrol "output device" tab, clic green "default device" button near "jack sink"
    Now pulseaudio software and Hydrogen should run at the same time.

  • Using qjackctl, in the first "settings" tab, you can change Jackd audio device .

3

It might be much easier now. What worked for me today, to satisfy my really basic needs, after a fresh install of Linux Mint 18.2 (Ubuntu 16.04 package base) was:

  1. Use Synaptic to install QSynth and QJackCtl.

  2. Copy required sound font(s) into an appropriate folder such as /usr/share/sounds/sf2/

  3. In QSynth Setup: under Audio tab change Audio Driver to pulseaudio.

  4. In QSynth Setup: under SoundFonts: Open... and select one as required.

  5. In QJackCtl Setup > Settings > Advanced:

    Server Prefix: pasuspsender -- /usr/bin/jackd

  6. In QJackCtl Setup > Options:

    Execute script after startup:

    pactl load-module module-jack-sink channels=2; pactl load-module module-jack-source; pacmd set-default-sink jack_out
    
  7. In QJackCtl Connect: ALSA: join the keyboard entry on the left to FLUID Synth on the right.

  8. In the main System Settings for Sound, select the required output device.

Now I can play the keyboard while watching a video (e.g. on YouTube using Firefox for example) - previously I could only do one of these at a time without a lot of tweaks I could seldom keep track of.

Hope that helps someone, or encourages them to try again :-).

1

The easiest way to route all system to run with jack:

Install

sudo apt-get install qjackctl pulseaudio-module-jack

Open qjackctl. In Setup>Options>

Check Execute script after Startup and paste this:

pacmd load-module module-jack-source channels=2; pacmd load-module module-jack-sink channels=2;

Check Execute script after Shutdown and paste this:

killall jackd

Now start qjack and open your sound settings. You will find Pulse Audio Jack Sink Output port. Select it and all system will sync. If you stop Jack server/qjack, sound will go back to your Default port again.

Here is the overall view

0

Of course one will want both pulseaudio and jack running if they got to the point where they need jack as most browser media players don't know jack! ..unfortunately.

I kept seeing the suggestion of having just one of them running at a time which seems to me like such a terrible compromise. It's a bit tragic in my opinion that these two services i.e. jack and pulseaudio although both functional on their own are so poorly managed by kxstudio at least which is what I'm using.

So what happens is:

  • jack cannot start while pulseaudio is running (and using the soundcard driver it wants to use which is fair enough) so it needs to be started first

  • pulseaudio needs to be pointed to jack once both up and running

Pretty simple..ey? For certain reasons, I had endless grief with it cuz..

First I think because pulseaudio 4.0 seems be buggy and mess up the alsa driver so that in some situations it leaves it locked and therefore jack cannot start even though pulseaudio is not running. (Says failed to set capture parameters or smtg like that)

What I deed in the end was

  • removed both jack and pulseaudio completely (with find and rm -rf :D after apt-get purge)
  • installed pulseaudio 11 (from sources)
  • installed jack and it's libs (libjack-dev)

in this order and then I finally got them running normally through qjackctl which makes sure they start in the correct manner (loads the jack sink in pulseaudio, and sets it as default).

Btw, I saw Cadence is recommended instead and I don't understand why as to me it seems rubbish compared to qjackctl.

Anyway, problem is starting jack using qjackctl takes a while and to avoid the waiting times at each boot you can use this life saver feature of kde which is to load previous session. Make sure you don't have qjackctl in autostart though as you will end up with one more instance at each reboot regardless of the singleton = true setting (buggy buggy all night long).

This is because I didn't feel fiddling around with it any longer such as writing a smart script that will make sure pulseaudio is down (or suspended) start jack and check that it started properly, then start pulseaudio, load jack module etc.

Otherwise relying on the OS to start the daemons and load config correctly would be the normal (healthy) scenario however it doesn't seem to be happening.

Have fun..

0

I am running Linux Mint 19.1. After trying all the various solutions, things still wouldn't work smoothly for me.

Finally, I was able to solve all my issues by following the steps/instructions in the video: Link

Basically, it installs applications from the Kxstudio repositories. and they have a script to configure everything perfectly at startup.

My end goal was to be able to record input through my interface(Scarlett solo) while being able to run/record sound from other applications (desktop, browser)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.