JACK (JACK Audio Connection Kit) and related tools

Vicente González Ruiz

December 3, 2014

Contents

1 The server
 1.1 What is JACK?
 1.2 Functions
 1.3 Installation
 1.4 JACK graphical front-end: qjackctl
  1.4.1 Server configuration
 1.5 Minimizing the number of XRUNs
2 Living with PulseAudio
 2.1 What is Pulseaudio?
 2.2 Functions
 2.3 Daemon control
 2.4 Pulseaudio and ALSA tools
 2.5 Bypassing PA server (and JACK)
 2.6 Sound system usage
 2.7 Configuration
 2.8 Volume control
 2.9 Module pulseaudio-module-jack
3 Media players
 3.1 Media player: MPlayer
4 Meters
 4.1 A VU (Volume Unit) meter: meterbridge
 4.2 Japa (JACK Perceptual Analyzer)
5 Effects
 5.1 JAMin (JACK Audio Mastering interface)
 5.2 JACK Rack
 5.3 Rakarrack
 5.4 Freqtweak
 5.5 FMIT (Free Music Instrument Tuner)
6 Edition
 6.1 Audacity: capture and edit audio
7 Capture
 7.1 JACK Timemachine: capture audio
8 Synthesis
 8.1 The Hydrogen drum machine
 8.2 ZynAddSubFX
 8.3 TiMidity
 8.4 JACK Keyboard and AMSynth
9 Remember

Chapter 1
The server

1.1 What is JACK?

1.2 Functions

1.3 Installation

  1. Install the program qjackctl. This a graphical front-end for controlling the audio server jackd2. During the installation of jackd you must decide to enable the realtime process priority (necesarry for real-time processing in slow systems). The priority is defined in the file:
    $ cat /etc/security/limits.d/audio.conf  
    # Provided by the jackd package.  
    #  
    # Changes to this file will be preserved.  
    #  
    # If you want to enable/disable realtime permissions, run  
    #  
    #    dpkg-reconfigure -p high jackd  
     
    @audio   -  rtprio     95  
    @audio   -  memlock    unlimited  
    #@audio   -  nice      -19

1.4 JACK graphical front-end: qjackctl

1.4.1 Server configuration

1.5 Minimizing the number of XRUNs

Chapter 2
Living with PulseAudio

2.1 What is Pulseaudio?

2.2 Functions

  1. Software mixing of multiple audio streams, bypassing any restrictions the hardware has.
  2. Network transparency, allowing an application to play back or record audio on a different machine than the one it is running on.
  3. Sound API abstraction, alleviating the need for multiple backends in applications to handle the wide diversity of sound systems out there.
  4. Generic hardware abstraction, giving the possibility of doing things like individual volumes per application.

2.3 Daemon control

2.4 Pulseaudio and ALSA tools

2.5 Bypassing PA server (and JACK)

pasuspender mplayer -ao alsa * &

2.6 Sound system usage

$ fuser -v /dev/snd/*  
                     USER        PID ACCESS COMMAND  
/dev/snd/controlC0:  vruiz      2201 F.... pulseaudio  
                     vruiz      3810 F.... alsamixer  
/dev/snd/pcmC0D0p:   vruiz      2201 F...m pulseaudio

2.7 Configuration

PA is configured by modifiying the files:

/etc/pulse/daemon.conf  
/etc/pulse/default.pa

2.8 Volume control

$ pavucontrol &

2.9 Module pulseaudio-module-jack

# Install the PulseAudio’s module for Jack  
sudo apt-get install pulseaudio-module-jack  
 
# Go to:  
cd /etc/pulse/  
 
# Make a backup of the file:  
sudo cp default.pa default.pa.old  
 
# Edit it:  
sudo gedit default.pa  
 
# Add:  
#  
# load-module module-jack-source  
# load-module module-jack-sink  
#  
# after "load-module module-pipe-sink".  
#  
# Remember to remove the ’#’ of these lines!!  
 
# Kill and reload JACK.  
pulseaudio --kill

PIC PIC

Chapter 3
Media players

3.1 Media player: MPlayer

$ mplayer -ao jack * &

PIC PIC PIC

Chapter 4
Meters

4.1 A VU (Volume Unit) meter: meterbridge

  1. Run:
    $ meterbridge -t vu alsa_pcm:capture_1 alsa_pcm:capture_2 &  # Or ...  
    $ meterbridge -t ppm alsa_pcm:capture_1 alsa_pcm:capture_2 & # Or ...  
    $ meterbridge -t dpm alsa_pcm:capture_1 alsa_pcm:capture_2 & # Or ...  
    $ meterbridge -t jf alsa_pcm:capture_1 alsa_pcm:capture_2 &  # Or ...  
    $ meterbridge -t sco alsa_pcm:capture_1 alsa_pcm:capture_2 & # Although this is preferable

    PIC

  2. Connect (route) it:

    PIC

  3. But, I don’t listen myself! Of course, you have to route the system readable client in the Connections/Audio window towards the system writable client in order to provide this functionality. But be careful with the output volume of the speakers (Master and PCM) and the microphone gain (Mic and Mic Boost) mixer controls, specially is you are done this in a laptop, because the microphone can be feedbacked by the speakers, producing an annoying sound coupling. See below:

    PIC PIC PIC PIC

4.2 Japa (JACK Perceptual Analyzer)

Chapter 5
Effects

5.1 JAMin (JACK Audio Mastering interface)

$ jamin &

PIC PIC

5.2 JACK Rack

$ jack-rack &

PIC PIC

5.3 Rakarrack

$ rakarrack &

PIC PIC

5.4 Freqtweak

$ freqtweak &

PIC PIC

5.5 FMIT (Free Music Instrument Tuner)

fmit &

PIC PIC

Chapter 6
Edition

6.1 Audacity: capture and edit audio

# Note: usually audacity establish the connections when playing.  
$ audacity &

PIC PIC

Chapter 7
Capture

7.1 JACK Timemachine: capture audio

$ timemachine &

PIC PIC

Chapter 8
Synthesis

8.1 The Hydrogen drum machine

$ hydrogen &

PIC PIC PIC

8.2 ZynAddSubFX

zynaddsubfx &

PIC PIC

8.3 TiMidity

timidity ~/Downloads/teddybear.mid

PIC PIC

8.4 JACK Keyboard and AMSynth

jack-keyboard &  
amsynth &

PIC PIC PIC PIC

Chapter 9
Remember