JACK Audio Connection Kit

From ArchWiki
Jump to navigation Jump to search


If you know anything about JACK, please expand this article. I've uninstalled it, so I can't really expand it any further.

Install

Multiprocessor implementation (soon: JACK2)

Here's a mp version of JACK which will also be used as base for JACK2. However, I couldn't figure out how to use it - if you do, please edit the wiki.

AUR package: jack-audio-connection-kit-mp

JACK

Alternatively, there is the normal version from the extra repository, install it with:

pacman -S jack-audio-connection-kit

Jack for a multi-user system

So, you have a descent multiuser system as it was designed more than 20 years ago, and now some developers decided that sound is only for a mono-user system... No I can not believe it !

Fortunately some time ago someone convinced the developers to allow jack to run as a system wide daemon. Here is the procedure to follow:

Create a /etc/profile.d/jack.sh file containing:

export JACK_PROMISCUOUS_SERVER=""

Replace /etc/rc.d/jack-audio-connection-kit with the following content

#!/bin/bash 

. /etc/rc.conf
. /etc/rc.d/functions

# source application-specific settings
[ -f /etc/conf.d/jack-audio-connection-kit ] && . /etc/conf.d/jack-audio-connection-kit

PID=`pidof -o %PPID /usr/bin/jackd`

[ -n "$JACKUSER" ] && HOME="/home/$JACKUSER"
[ -z "$JACK_PARAMS" ] && JACK_PARAMS=$(sed 's:/usr/bin/jackd ::' $HOME/.jackdrc)

case "$1" in
  start)
    stat_busy "Starting JACK"
    if [ -z "$PID" ]; then
      if [ -n "$JACKUSER" ]; then
        su - $JACKUSER -c 'export JACK_PROMISCUOUS_SERVER="" && . /etc/conf.d/jack-audio-connection-kit && umask 0000 && /usr/bin/jackd $JACK_PARAMS &> /dev/null &'
      else
	export JACK_PROMISCUOUS_SERVER=""
	umask 0000
        /usr/bin/jackd $JACK_PARAMS &> /dev/null &
      fi
    fi

    if [ ! -z "$PID" -o $? -gt 0 ]; then
      stat_fail
    else
      add_daemon jack
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping JACK"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon jack
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {sta

Where my /etc/conf.d/jack-audio-connection-kit is

# Configuration for starting JACK at boot

# Uncomment this to run as user (recommended)
#JACKUSER="root"

# Uncomment this to not source ~/.jackdrc
JACK_PARAMS="-R -P89 -dalsa -dhw:1 -r48000 -p512 -n3"

Related Articles

Pro Audio