nik gnomic's Linux stuff

IDJC & JACK with Pulse Sinks/Sources (for most Linux?)

Method to create two audio routings from Pulseaudio to JACK audio system for use with IDJC.

Tested on Arch, Debian and Ubuntu based ditributions, should be useable in most other versions of Linux. Not recommended for use with KXStudio because of conflicts with KX default settings

Names of folders and scripts is not critical, as long as names and locations in later setup match

Essential Packages

JACK Packages - jack2, qjackctl, patchage

Pulseaudio packages - pulseaudio, pulseaudio-jack, pavucontrol

Must have Pulseaudio v6.0 or greater for multiple jack sinks/sources

Ubuntu rebuild of Pulseaudio shows a different version number
Version can be checked in Terminal:

pulseaudio --version

Pulseaudio mixer pavucontrol is essential to select audio routing.
Panel controls on many desktop environments do not show sound routing options.

D-Bus deals with all the changes between Pulseaudio and JACK automatically

If D-Bus is problematic, there are some additional commands needed to start JACK server,
Older versions of QjackCtl setup will be linked at end of this article

Disable Pulse automatic D-Bus connections

Disabling jackdbus module allows for script loading of sinks/sources in QjackCtl start script.
Script enables use of clearer names for sinks/sources

Create user configuration for Pulseaudio, copied from original at /etc/pulse:

cp /etc/pulse/default.pa ~/.config/pulse/default.pa

Open this file to edit configuration in a text editor

nano ~/.config/pulse/default.pa

Find the lines shown below for jackdbus module and add '#' to deactivate:

### Automatically connect sink and source if JACK server is present
#.ifexists module-jackdbus-detect.so
#.nofail
#load-module module-jackdbus-detect channels=2
#.fail
#.endif

QjackCtl Startup script

All of the following can be done graphically using a file manager and text editor
To make files executable, right click file and go to 'Properties' then 'Permissions' tab.
Tickbox 'Allow this file to run as a program' is checked to make file executable

Make a new folder 'JACKscripts' in home folder using Terminal and move nto folder

mkdir JACKscripts && cd JACKscripts

Create script file and make it executable

echo '#!/bin/bash' > jack_start.sh && chmod 700 jack_start.sh

the jack_start.sh script is as follows:

#!/bin/bash
#jack_start.sh

# load voip sink/source
pactl load-module module-jack-sink sink_name=voip_in client_name=voip_in channels=2 connect=yes
pactl load-module module-jack-source source_name=voip_out client_name=voip_out channels=2 connect=yes

# load aux sink
pactl load-module module-jack-sink sink_name=aux_in client_name=aux_in channels=2 connect=yes
wait 2

#set default sink and source
pacmd set-default-source voip_out
pacmd set-default-sink aux_in

QjackCtl Setup

Setup Qjackctl start option commands and the script link as shown in diagram:

QjackCtl options1

Interface: select your sound device for Jack use

Frames/Period: 1024 is safe working value for most sound devices.
Value can be reduced to lower delay latency, but risks more x-run errors.
May also be increased to reduce x-run errors, but with more latency.

Sample Rate: 48000Hz is native Jack rate, but 44100Hz may work better on some hardware

Periods/Buffer: Usually 2 is fine for built-in sound devices,
It is suggested this should be changed to 3 for USB devices


QjackCtl options2

Execute script after Startup: This is where to link to script made earlier

Execute script on Shutdown: Close patchage before stopping JACK server
Patchage will send error alerts if still open when JACK server is stopped
Command can be omitted if patchage is not used during normal workflow.

Execute script after Shutdown: Close any remaining JACK applications


Display tab of setup is not shown as there are no required changes


QjackCtl options4

Enable D-Bus Interface and Enable JACK D-Bus Interface should be enabled
D-Bus is needed to control switching of audio hardware between JACK and Pulseaudio

1st Test Starting JACK in QjackCtl

When QjackCtl is started with this setup, Jack input and output ports will be loaded with default connections as shown below:

QjackCtl options1

Pulseaudio will start having all audio sent to default sink aux_in, including VOIP calls.
In pavucontrol Pulseaudio mixer, locate the VOIP application in playback and change sink connection to 'voip_in'

Pulseaudio will store the changed sink setting and connect correctly in future

This is default started state for JACK
Next page will deal with creating automated process of loading IDJC with all connections

Part 2 > IDJC Setup


manjaro logo
idjc tux
HTML5
HTML5 CSS3