|
|
6eabaff |
USING ALSA DIRECTLY
|
|
|
6eabaff |
|
|
|
6eabaff |
Switch to root account.
|
|
|
6eabaff |
|
|
|
6eabaff |
Install the required packages:
|
|
|
6eabaff |
yum install alsa-plugins-jack
|
|
|
6eabaff |
|
|
|
6eabaff |
Add yourself to the jackuser group.
|
|
|
6eabaff |
usermod -a -G jackuser "<your username>"
|
|
|
a64fdde |
Now you will need to log out and log back in, or simply restart the system.
|
|
|
6eabaff |
|
|
|
6eabaff |
Start the jack daemon (your parameters may be different):
|
|
|
6eabaff |
jackd -R -P4 -dalsa -r44100 -p512 -n4 -D -Chw:0 -Phw:0
|
|
|
6eabaff |
or use
|
|
|
6eabaff |
qjackctl -s
|
|
|
6eabaff |
if you have it installed and configured.
|
|
|
6eabaff |
|
|
|
6eabaff |
|
|
|
84586ae |
INTEGRATE JACK WITH PULSEAUDIO
|
|
|
a64fdde |
*** Note that this section is outdated ***
|
|
|
84586ae |
|
|
|
84586ae |
The original text is placed at:
|
|
|
84586ae |
http://www.harald-hoyer.de/linux/pulseaudio-and-jackd
|
|
|
84586ae |
|
|
|
84586ae |
Switch to root account.
|
|
|
84586ae |
|
|
|
84586ae |
Install the required packages:
|
|
|
6eabaff |
yum install pulseaudio-module-jack alsa-plugins-jack
|
|
|
84586ae |
|
|
|
84586ae |
Add yourself to the pulse-rt and jackuser groups.
|
|
|
4bee82a |
usermod -a -G pulse-rt,jackuser "<your username>"
|
|
|
84586ae |
|
|
|
84586ae |
Switch to your normal user account.
|
|
|
84586ae |
|
|
|
84586ae |
Create ~/bin subdirectory if absent:
|
|
|
84586ae |
mkdir -p ~/bin
|
|
|
84586ae |
|
|
|
6e8b94c |
Copy the pulseaudio start file:
|
|
|
a8e113a |
cp /usr/share/doc/jack-audio-connection-kit-*/jack.pa ~/bin/jack.pa
|
|
|
6e8b94c |
chmod 755 ~/bin/jack.pa
|
|
|
84586ae |
|
|
|
84586ae |
Close all your sessions and relogin to get the new group permissions and
|
|
|
84586ae |
limits.
|
|
|
84586ae |
|
|
|
84586ae |
Kill the current pulseaudio daemon:
|
|
|
dbd1fcf |
pulseaudio -k
|
|
|
84586ae |
|
|
|
84586ae |
Start the jack daemon (your parameters may be different):
|
|
|
84586ae |
jackd -R -P4 -dalsa -r44100 -p512 -n4 -D -Chw:0 -Phw:0
|
|
|
dbd1fcf |
or use
|
|
|
dbd1fcf |
qjackctl -s
|
|
|
dbd1fcf |
if you have it installed and configured.
|
|
|
84586ae |
|
|
|
84586ae |
Start the pulseaudio daemon:
|
|
|
4bee82a |
~/bin/jack.pa
|
|
|
84586ae |
|
|
|
84586ae |
Now everything should work.
|
|
|
84586ae |
|
|
|
84586ae |
|
|
|
84586ae |
RUNNING JACK SERVER IN REALTIME MODE
|
|
|
9612371 |
|
|
|
6eabaff |
NOTE: This chapter explains why you have done the above changes in more detail.
|
|
|
6eabaff |
It is kept for informational purposes.
|
|
|
4bee82a |
|
|
|
9612371 |
The JACK server jackd has the capability to run in a real-time mode
|
|
|
9612371 |
which greatly decreases the chance of audio glitches. The real-time mode
|
|
|
9612371 |
is enabled by passing the -R or --realtime option to jackd when starting
|
|
|
9612371 |
the server. It is only possible to run jackd in real-time mode as a
|
|
|
9612371 |
non-root user by modifying your PAM configuration, PAM stands for
|
|
|
9612371 |
Pluggable Authentication Modules and is the primary authentification
|
|
|
9612371 |
mechanism used on Fedora. The primary source of PAM documentation can be
|
|
|
9612371 |
found at the following at http://www.kernel.org/pub/linux/libs/pam/
|
|
|
9612371 |
|
|
|
9612371 |
The specific PAM configuration file that needs to be modified is
|
|
|
9612371 |
/etc/security/limits.conf and it controls the system resource limits. It
|
|
|
9612371 |
is important to understand that modifying the resource limits
|
|
|
9612371 |
configuration files can decrease the security of your system.
|
|
|
9612371 |
Documentation specific to the resource limits PAM module can be found at
|
|
|
9612371 |
http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam-6.html#ss6.12
|
|
|
9612371 |
|
|
|
6eabaff |
Alternatively, one can create a new file
|
|
|
6eabaff |
/etc/security/limits.d/<priority>-<name>.conf
|
|
|
6eabaff |
that contains the resource limits for individual users and/or groups. The
|
|
|
6eabaff |
jack-audio-connection-kit package that comes with Fedora contains the file
|
|
|
6eabaff |
/etc/security/limits.d/99-jack.conf
|
|
|
6eabaff |
that does this job for you.
|
|
|
6eabaff |
|
|
|
9612371 |
The resource limits that need to be changed to allow jackd to run in
|
|
|
9612371 |
realtime mode are named rtprio and memlock. To increase the limits for a
|
|
|
9612371 |
specific user named fred you would add the following to
|
|
|
9612371 |
/etc/security/limits.conf
|
|
|
9612371 |
|
|
|
9612371 |
fred - rtprio 20
|
|
|
9612371 |
fred - memlock 50000
|
|
|
9612371 |
|
|
|
9612371 |
The value of rtprio can be set in the range 0 - 99 where any value
|
|
|
9612371 |
greater that 0 will allow the user to change the scheduling policy to
|
|
|
9612371 |
"real-time". By default the JACK server requires a minimum rtprio
|
|
|
9612371 |
setting of 20 but jackd will accept a command line parameter -P or
|
|
|
9612371 |
--realtime-priority which will change the minimum required value of
|
|
|
9612371 |
rtprio that is needed, but the default of 20 is nearly always
|
|
|
9612371 |
sufficient.
|
|
|
9612371 |
|
|
|
9612371 |
The appropriate value for memlock is dependent on the amount of memory
|
|
|
9612371 |
present in the system but a minimum value of 50000(50MB) and a maximum
|
|
|
9612371 |
value of half the available memory can be used as a rough guideline.
|
|
|
9612371 |
|
|
|
9612371 |
To verify that the resource limits have been modified you can use the
|
|
|
9612371 |
bash built-in ulimit command, for example:
|
|
|
9612371 |
|
|
|
9612371 |
$ulimit -a
|
|
|
9612371 |
core file size (blocks, -c) 0
|
|
|
9612371 |
data seg size (kbytes, -d) unlimited
|
|
|
9612371 |
max nice (-e) 0
|
|
|
9612371 |
file size (blocks, -f) unlimited
|
|
|
9612371 |
pending signals (-i) 8191
|
|
|
9612371 |
max locked memory (kbytes, -l) 50000
|
|
|
9612371 |
max memory size (kbytes, -m) unlimited
|
|
|
9612371 |
open files (-n) 1024
|
|
|
9612371 |
pipe size (512 bytes, -p) 8
|
|
|
9612371 |
POSIX message queues (bytes, -q) 819200
|
|
|
9612371 |
max rt priority (-r) 20
|
|
|
9612371 |
stack size (kbytes, -s) 10240
|
|
|
9612371 |
cpu time (seconds, -t) unlimited
|
|
|
9612371 |
max user processes (-u) 8191
|
|
|
9612371 |
virtual memory (kbytes, -v) unlimited
|
|
|
9612371 |
file locks (-x) unlimited
|
|
|
9612371 |
file locks (-x) unlimited
|
|
|
9612371 |
|
|
|
6eabaff |
Keep in mind that you may have to re-login before changes to limits.conf,
|
|
|
6eabaff |
or additions to the limits.d/ directory to take effect.
|
|
|
9612371 |
|