Howto use Jack and PulseAudio at the same time

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
Bas King
Level 1
Level 1
Posts: 17
Joined: Mon Jan 20, 2014 2:38 am

Howto use Jack and PulseAudio at the same time

Post by Bas King »

I wanted to have Jackd and PulseAudio working together, to be able to play youtube (through pulseaudio), vlc, renoise + midi keyboard, and effects, all at the same time.
Here is how I did it on a fresh installed linux-mint-qiana:

Install with software manager:
jackd, when asked about realtime, dont use it: semi-realtime is very fast, and can never lock up your computer.

qjackctl, in the setup, select the input (microphone) and output (loudspeaker) device you want to use.
Then you can optimize for your situation. You want a low latency (20 milliseconds is fine to play midi-instruments without noticable delay), but you also want a low RT(=cpu-load) percentage, this should be at about 2 percent when not playing sounds at all. 20+ percent is insane: as soon as you play sounds, your cpu-load will be at 100 percent very quickly, and soundframes will get dropped.
-SampleRate (frames per second), higher means less latency & higher cpu-load. 44100 is ok, 48000 is nice, 96000 is for purists, higher values are not noticable better for humans with normal ears.
-Frames/Period, lower means less latency but higher cpu-load. Put as low as you can, without the cpu-load going through the roof.
-Periods/buffer should normally be 2 or 3, lower is less latency but higher cpu-load. If your soundcard only supports 3 (or 2), you should keep it at 3 (or 2).
You can leave the rest of the settings on default.
Save, stop and start qjackctl to check the RT(aka cpu-load) each time you tinker with the settings.
For me, it is 2 periods/buffer, 48000 framerate, 512 frames/period, giving me a latency of 21.3 milleseconds and a RT of 2.3 percent (when playing no sounds).

Adding soundstreams and effects to soundstreams will increase RT, try to always keep it under 100 percent, or you will get dropped soundframes. You know you are pushing it when the dropped-soundframes-counter below 'active' in the qjackctl screen starts rising. Zero is very good. One or a few is no real problem, but in the hundreds or more and rising means your system cannot handle your load. You should then either tinker with the settings, or reduce the number of soundstreams and/or effects.

pulseaudio-module-jack, edit setting:

Code: Select all

sudo gedit /etc/pulse/default.pa
search for #load-module module-alsa-sink, add below that line these two lines:

Code: Select all

load-module module-jack-sink
load-module module-jack-source
optional:
vlc-plugin-jack, to have each vlc you start work as an individual jack-device (sound source). You will have to set the output to jack, and allow more then one vlc's to run at the same time, then restart vlc to have it use the new settings.

patchage, visual patchbay to route soundstreams any way you like.

jack-rack, to add ladspa-effects like echos, equalizers, and such to soundstreams. Run one or more, then use patchage to connect any stream you want to effect to the ins and outs.
In the software manager you can find many ladspa effect libraries you can install like ladspa-sdk, swh-plugins, tap-plugins, fil-plugins, omins, rev-plugins, autotalent, cmt, etc etc.
To edit the ladspa enviroment path, in a terminal type:

Code: Select all

export LADSPA_PATH=$LADSPA_PATH:/usr/local/lib/ladspa:/usr/lib/ladspa
Reboot or restart pulseaudio with

Code: Select all

pulseaudio -k
Enjoy!
Post Reply

Return to “Tutorials”