View | Details | Raw Unified | Return to bug 276607 | Differences between
and this patch

Collapse All | Expand All

(-)b/audio/jack/Makefile (-1 / +1 lines)
Lines 1-7 Link Here
1
PORTNAME=	jackit
1
PORTNAME=	jackit
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	1.9.22
3
DISTVERSION=	1.9.22
4
PORTREVISION=	1
4
PORTREVISION=	2
5
CATEGORIES=	audio
5
CATEGORIES=	audio
6
6
7
MAINTAINER=	dev@submerge.ch
7
MAINTAINER=	dev@submerge.ch
(-)b/audio/jack/files/jackd.in (-7 / +49 lines)
Lines 10-17 Link Here
10
10
11
: ${jackd_enable="NO"}
11
: ${jackd_enable="NO"}
12
: ${jackd_user="root"}
12
: ${jackd_user="root"}
13
: ${jackd_rtprio="NO"}
13
: ${jackd_rtprio="YES"}
14
: ${jackd_args="-r -doss -r44100 -p1024 -n3 -w16"}
14
: ${jackd_args="-r -doss -r48000 -p1024 -w16"}
15
15
16
. /etc/rc.subr
16
. /etc/rc.subr
17
17
Lines 20-34 rcvar=jackd_enable Link Here
20
procname=%%PREFIX%%/bin/jackd
20
procname=%%PREFIX%%/bin/jackd
21
start_cmd="start_jackd"
21
start_cmd="start_jackd"
22
22
23
fail() {
24
  echo "JACK failed to start: $1" >&2
25
  exit 1
26
}
27
23
start_jackd() {
28
start_jackd() {
24
  echo "Starting ${name}."
29
  echo "Starting ${name}."
25
  if [ $jackd_rtprio = "YES" ]; then
30
26
    local rt="rtprio 1"
31
  # check that jackd_user is set
32
  if [ -z "$jackd_user" ]; then
33
    fail "jackd_user has to be defined"
34
  fi
35
36
  # check that jackd_args doesn't contain -R, or -r because we explicitly set them below
37
  if echo $jackd_args | grep -qw -- "-R"; then
38
    fail "jackd_args contains -R which isn't allowed: it is set automatically only when needed"
39
  fi
40
  if echo $jackd_args | grep -qw -- "-r"; then
41
    fail "jackd_args contains -r which isn't allowed: it is set automatically only when needed"
42
  fi
43
  
44
  # enable real-time priority if requested
45
  if [ "$jackd_rtprio" = "YES" ]; then
46
    # check that mac_priority(4) is enabled
47
    if [ "$(sysctl -qn security.mac.priority.realtime)" != "1" ]; then
48
      fail "jackd_rtprio=\"YES\" but mac_priority(4) isn't enabled on this system"
49
    fi
50
    # check that the group 'realtime' exists
51
    if ! getent group realtime > /dev/null; then
52
      fail "jackd_rtprio=\"YES\" but the group 'realtime' doesn't exist"
53
    fi
54
    # check that the user is in the realtime group
55
    if ! (getent group realtime | grep -qw "$jackd_user"); then
56
      fail "jackd_rtprio=\"YES\" but the user jackd_user=$jackd_user isn't in the realtime group"
57
    fi
58
59
    # enable the real-time priority functionality in JACK
60
    jackd_args="-R $jackd_args"
61
  else
62
    echo "Warning: The real-time priority feature is disabled by jackd_rtprio=${jackd_rtprio}."
63
    echo "         For real-time priority:"
64
    echo "         (1) enable mac_priority(4) on the system by adding mac_priority_load=\"YES\" to loader.conf"
65
    echo "         (2) add the user jackd_user=$jackd_user to the group 'realtime'"
66
    echo "         (3) set jackd_rtprio=\"YES\""
67
68
    # enable the non-real-time priority functionality in JACK
69
    jackd_args="-r $jackd_args"
27
  fi
70
  fi
28
  # log the date and parameters
71
  # log the date and parameters
29
  echo -e "\n[`date`] Starting the daemon, user=$jackd_user rtprio=$jackd_rtprio args=\"$jackd_args\"" >> /var/log/${name}.log
72
  echo -e "\n[`date`] Starting the daemon, user=$jackd_user args=\"$jackd_args\"" >> /var/log/${name}.log
30
  # daemon(8) should be able to set the realtime priority, but it isn't
73
  daemon -p /var/run/${name}.pid -u "$jackd_user" %%PREFIX%%/bin/jackd $jackd_args
31
  $rt daemon -p /var/run/${name}.pid -u "${jackd_user}" %%PREFIX%%/bin/jackd ${jackd_args}
32
}
74
}
33
75
34
load_rc_config ${name}
76
load_rc_config ${name}
(-)b/audio/jack/pkg-message (-4 / +7 lines)
Lines 3-13 The new JACK server comes with a DBUS control interface: Link Here
3
$ jack_control help
3
$ jack_control help
4
$ jack_control ds oss
4
$ jack_control ds oss
5
$ jack_control dp
5
$ jack_control dp
6
$ jack_control dps rate 48000
7
$ jack_control dps wordlength 16
8
$ jack_control dps capture /dev/dsp0
9
$ jack_control dps playback /dev/dsp0
6
$ jack_control eps realtime False
10
$ jack_control eps realtime False
7
$ jack_control start
11
$ jack_control start
8
12
9
Only root can grant real-time priority to processes for now, using rtprio(1).
13
To use real-time priority for JACK server and clients, load the mac_priority(4)
10
Upcoming FreeBSD releases will have a MAC policy with a realtime user group.
14
module and add the JACK user to the realtime group.
11
15
12
Memory locking has to be allowed in /etc/login.conf or ~/.login_conf. Set the
16
Memory locking has to be allowed in /etc/login.conf or ~/.login_conf. Set the
13
resource limit ":memorylocked=unlimited:" and don't forget to run
17
resource limit ":memorylocked=unlimited:" and don't forget to run
Lines 19-26 Note that only one JACK server can be run at a time. An /etc/rc.conf example: Link Here
19
23
20
jackd_enable="YES"
24
jackd_enable="YES"
21
jackd_user="joe"
25
jackd_user="joe"
22
jackd_rtprio="YES"
26
jackd_args="-r -doss -r48000 -p1024 -w16 \
23
jackd_args="-R -doss -r48000 -p1024 -n1 -w16 \
24
            --capture /dev/dsp0 --playback /dev/dsp0"
27
            --capture /dev/dsp0 --playback /dev/dsp0"
25
28
26
Official JACK example clients and tools are available as jack-example-tools.
29
Official JACK example clients and tools are available as jack-example-tools.

Return to bug 276607