Difference between revisions of "JACK Audio Connection Kit"

From ArchWiki
Jump to navigation Jump to search
m (Added warning for multi-user instructions)
(Introduction to dbus control of Jack2)
Line 5: Line 5:
 
=Install=
 
=Install=
 
==Multiprocessor implementation (soon: JACK2)==
 
==Multiprocessor implementation (soon: JACK2)==
[http://www.grame.fr/~letz/jackdmp.html 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.
+
[http://www.grame.fr/~letz/jackdmp.html Here's] a mp version of JACK which will also be used as base for JACK2.  
  
 
[[AUR]] package: [http://aur.archlinux.org/packages.php?ID=22488 jack-audio-connection-kit-mp]
 
[[AUR]] package: [http://aur.archlinux.org/packages.php?ID=22488 jack-audio-connection-kit-mp]
 +
 +
You can compile Jack2 with the new dbus-based control system or the 'classic' interface. Which one you have depends on whether you compiled Jack2 with the --dbus configure option or not.
 +
 +
Jack2 without --dbus executes similarly to Jack1. With --dbus, control is done using the jack_control utility. Run `jack_control` to see what it does. The important commands are listed below:-
 +
jack_control start  -  starts the jack server
 +
jack_control stop  - stops the jack server
 +
jack_control ds alsa  -  selects alsa as the driver (backend)
 +
jack_control eps realtime True  -  set engine parameters, such as realtime
 +
jack_control dps period 256  -  set the driver parameter period to 256
 +
 +
You may also need to play with the driver parameters nperiods and rate.
  
 
==JACK==
 
==JACK==

Revision as of 10:43, 13 November 2009


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.

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

You can compile Jack2 with the new dbus-based control system or the 'classic' interface. Which one you have depends on whether you compiled Jack2 with the --dbus configure option or not.

Jack2 without --dbus executes similarly to Jack1. With --dbus, control is done using the jack_control utility. Run `jack_control` to see what it does. The important commands are listed below:-

jack_control start  -  starts the jack server
jack_control stop  - stops the jack server
jack_control ds alsa  -  selects alsa as the driver (backend)
jack_control eps realtime True  -  set engine parameters, such as realtime
jack_control dps period 256  -  set the driver parameter period to 256

You may also need to play with the driver parameters nperiods and rate.

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 !

Before following the below instructions, please note that there is a security risk to any service running as root, and, more importantly, the developers for jack do not test it for running as root. In other words, it could eat your babies, data, or both.

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