How to replace Pulseaudio with Jack, Jack and PulseAudio Together as Friend

first check if the loopbacks have actually closed with:

aplay -l

it is possible that the loopbacks are still there, just not responding after suspend/hibernate.
If they are not shown they can be reloaded with;

sudo modprobe snd-aloop

For audio work it is recommended to disable suspend or hibernation. Surprised you did not get major issues with JACK as well.
This is a pc hardware issue, not just a Linux issue. lot of Windows audio applications can get very temperamental after resuming from suspending

There is a way to permanently enable the loopback device(snd_aloop) but i haven't used alsa loopbacks for years and can't find a link to any useful info about it

1 Like

Nice, but I can't even get PulseAudio to work properly.

This is an awesome tutorial :sunglasses:. Wish I had this available year ago when i was struggling to get JACK and Pulse to play nice together

I use QJackCtl as it has lot more features than Cadence, but some of my friends prefer Cadence. The QJackCtl patchbay is difficult to get used to, but once all the connections are set, patchbay persistence reconnects anything I break if i do something stupid. I also installed Patchage. whichthis has same gui layout of audio connections to Catia. QJackCtl is better for me as I switch between 4 different patchbay setups and 3 different jack-post-start.sh scripts

You say to install Jack2 and Jack2-dbus, but trying to install one will require removal of the other other. I found that Jack2 works fine with d-bus support, but of course YMMV

One of your QJackCtl images shows 'Force 16-bit' enabled. I accidentally enabled this a couple of weeks ago and it caused huge extra DSP load and lot of x-runs. All settings in the new version advanced settings tab are best left unchanged

With D-Bus enabled in QJackCtl, changing audio device from Pulse to JACK should be handled automatically - you may not need the scripts jack-pre-start.sh. jack-pre-stop.sh and jack-post-stop.sh. I had used all 4 scripts and only discovered i didn't need 3 of them by accident when i started jack before setting them up

If Pulse config needs editing, I copy the file /etc/pulse/default.pa to ~/.config/pulse/default.pa. I add "connect=no" option to module-jackdbus-detect, this stops the Pulseaudio sink/source default connection to system input/output. I can then add 'jack_connect' commands to the jack-post-start.sh script to make the connections I want. I am still working on disabling some Pulse modules for performance and often break Pulse functions, but I can just delete the modified default.pa then reboot to load the original config retained in /etc/pulse and start over

I had issues with Pulseaudio v7.0 where sound out via Pulseaudio Jack Source didn't work. Thanks to the wonderful AUR, i found 'pulseaudio60' so could use working v6.0. This may not be an issue now v8.0 is out, just not had time to check yet

If an audio application is silent or appears to freeze, is nearly always showing in pavucontrol as set to default sound device. change to Jack sink and it should start working again

Apologies for such a lengthy post, but hopefully more folks can get JACK running without problems and enjoy using the great audio applications.

2 Likes

The force 16 bit is not my setting, I left a note before the qjackctl screenshots that I'm not using qjackctl right now. :slight_smile:
Thanks for the lengthy post, I appreciate it, really :slight_smile:

Sorry for necrobumping, I just knew that these togetherness actually has issues. I test both of my guitars (to make sure that it's not the pickup to blame) connecting through USB guitar jack with rakarrack and it sounds much less sensitive than with pure jack, it seems like less frequencies (both low and high) are detected. For instance, harmonics are not audible and if I strum the whole 6 strings, the fadeout is not smooth, it's crackling. Jack settings are more or less default:

Is there anything I miss?

Yeah, I know it's not gonna be better than pure JACK. Because it will give you more latency, the point of using Pulseaudio with JACK is compatibility of applications instead of performance. But I don't have any guitar or MIDI device so I don't know. Maybe you can try installing linux-rt-manjaro on testing repository and see if it helps, if Pulseaudio is causing performance issue, then stay with pure JACK instead. It's better than using Pulseaudio with JACK for sure, and I also think tuning your /etc/pulse/default.pa and /etc/pulse/daemon.conf settings may help improving frequency issue. :slight_smile:

Agree audio quality from Pulseaudio to JACK not as good as pure JACK

Assume your usb guitar interface is not device hw:0 shown in JACK settings?
Suggest you completely disable the guitar usb device in Pulseaudio.
Then, either:

  1. Change JACK settings to use guitar usb as main input device. (may need periods/buffer setting changed to 3)
    OR
  2. Create an extra JACK input connection with
    /usr/bin/alsa_in -j Guitar -d hw:XXX -q 1 2>&1> /dev/null &
    where XXX = hw id or alias name of usb device
1 Like

Assume your usb guitar interface is not device hw:0 shown in JACK settings?

Sure, hw:0 must be my onboard card. USB guitar is hw:2 (hw:1 is HDMI).

Change JACK settings to use guitar usb as main input device. (may need periods/buffer setting changed to 3)

Done already except changing periods/buffer. Why 3?

Create an extra JACK input connection with
/usr/bin/alsa_in -j Guitar -d hw:XXX -q 1 2>&1> /dev/null &
where XXX = hw id or alias name of usb device

Done already because without this my USB guitar won't show up.

Buffer/periods of usb devices are known to work better with 3 according to Arch Wiki. The default is 2, but if yours is better with 2, then use 2. That's all I know :slight_smile:

hello champ...
@rt46, i was playing vlc on the fly, mpv does not play audio [the tutorial says i should configure once, but i cant find mpv settings ! any workaround ?

The easiest way is to use a mpv front end (I'm using smplayer), but if you want to configure mpv manually, then just create your own file in ~/.config/mpv. Then put in ao=pulse inside (we're still using pulseaudio because pulse is connected to jackaudio if you do what I do).

thanks mate...
i had gone for reboot and now i play, it plays ! though audio level is far low compared t vlc, that i dont know !
anyways, when i run mpv ao=help, it gives the following output...

EDIT: sorry for this dumb question ! whats the default naming for the conf file in ~/.config/mpv ? is it ~/.config/mpv/mpv.conf ?

@crazyg4merz, excellent tutorial, thank you!
Unfortunately, I have no real use for JACK at the moment, but who knows, maybe later :slight_smile:
Interested in doing a Manjaro "Audio Workstation" spin?

2 Likes

I don't really know. I think it will read everything ended with .conf inside that folder. Just name it whatever you want and if it works then just leave it that way. :wink:
You can still use Jack for the output but you'll need to manually connect it in your cadence/qjackctl. But I prefer to just use Pulseaudio because it will be sent to jackaudio using pulseaudio-jack-sink anyway. :slight_smile:

Thanks man, appreciate it :slight_smile:
I can't really do any respin though because my upload speed is really slow and I don't want to wait for hours to upload large files. Also, most audio applications are in AUR and our build tool doesn't support including AUR packages anyway. :slight_smile:

I just tried to make JACK work and somehow I cannot connect anything in the Claudia and/or Cadence diagram. All the sinks are registered (in particular the USB MIDI device and the Rosegarden capture) but I cannot link them together. If I try to connect them, the line between the two sinks just disappears as soon as I release the mouse button... Any idea what I might have done wrong? :slight_smile:

Have you tried using catia? same patchbay layout as claudia, but no LADISH session management

Or same patchbay layout but not KX - Patchage - in community repo

1 Like

That seems like something else is overwriting the connection. Maybe you have other application that set the connection? Or maybe like @nikgnomic mentioned you can try other program. Sorry I can't test it out for you because I'm not using Jack server anymore.

+1 for Catia! Happy to see this thread come back to life. Also would also encourage anyone with pro audio needs to check out aj-snapshot - I'm a Linux noob and resisted the command line for weeks, and couldn't believe how sweet aj-snapshot is in combo with Catia. Halfway to actually improving on the TotalMix I thought I couldn't live without, in just two lean programs.

Thanks for the awesome tutorial. Do you have any idea on how to set up PulseAudio + Jack through a Bluetooth Headset? Seems another often met challenge... Cheers!

Sorry but I don't have a bluetooth headset in hand. Maybe somebody else here have experience with it. I think you should open a new topic on that :slight_smile:

1 Like

Forum kindly sponsored by