JACK

This article Article description::describes the setup of a playing sound with JACK (JACK Audio Connection Kit).

JACK is a sound server for professional audio production, that provides low-latency communication for applications that implement the JACK API (like mpv).

Installation
JACK uses ALSA for accessing the sound card hardware, be sure ALSA is working.

There are two implementations of the JACK API, both implementations are considered equivalent. JACK2 is usually the one to go for, JACK 1 is no longer under active development.

JACK is the original implementation, it uses a C API and has built-in Linux MIDI integration. JACK2 is a re-implementation in C++ that has support for SMP and DBUS, while MIDI support is handled by ALSA. Visit "what are the differences between JACK 1 and JACK2" for an in-depth comparison.

Emerge
Emerge the sound server:

The JACK 1 package is (click on link so see USE flags for JACK 1).

Global JACK USE flag
The global  USE flag enables support for JACK in other packages, so they can submit sound to a JACK server:

The command is part of.

After setting this, be sure to update the system so the changes take effect:

Sound server
JACK can be configured using the utility. A basic configuration script for JACK could look like:

To determine the appropriate playback device (instead of ):

GUI
A good JACK configuration and control software is.

Another alternative is.

Bridging
JACK can route sound which was sent to other sound systems like PulseAudio and ALSA through itself.

PulseAudio
To use PulseAudio's JACK module needs to have the   USE flag enabled.

In order to route all audio from PulseAudio to JACK, the JACK sink needs to be configured:

PulseAudio will recognize that JACK started and will bridge its audio to JACK.

"Cannot use real-time scheduling" error
Some applications may show a permission error when trying to connect to Jack, for example:

Adding the current user to the group should solve this:

Log out and log back in to apply group change.