JACK Audio Server

Here are some tips for Fedora on how to make JACK and Pulseaudio work together:
JACK & Pulseaudio

2.3.3. Integrating PulseAudio with JACK
The default configuration of PulseAudio yields control of the audio equipment to JACK when the JACK server starts.PulseAudio will not be able to receive input or send output of any audio signals on the audio interface used by JACK. This is fine for occasional users of JACK, but many users will want to use JACK and PulseAudio simultaneously, or switch between the two frequently. The following instructions will configure PulseAudio so that its input and output is routed through JACK.
  1. Use PackageKit or Apper to install the pulseaudio-module-jack package.
  2. Approve the installation and ensure that it is carried out properly.
  3. You'll need to edit the PulseAudio configuration file to use the JACK module.
    1. Be careful! You will be editing an important system file as the root user!
    2. Run the following command in a terminal: sudo -c 'gedit /etc/pulse/default.pa'
    3. Add the following lines, underneath the line that says
      Code:
      #load-module module-alsa-sink
      :
      load-module module-jack-sink
      load-module module-jack-source
  4. Restart PulseAudio by running the following command in a terminal: killall pulseaudio PulseAudiorestarts automatically.
  5. Confirm that this has worked by opening QjackCtl. The display should confirm that JACK is "Active".
  6. In the "Connect" window, on the "Audio" tab, there should be PulseAudio devices on each side, and they should be connected to "system" devices on the opposite sides.
  7. Open QjackCtl's "Setup" window, then click on the "Options" tab. Uncheck "Execute script after Shutdown: killall jackd". If you did not make this change, then QjackCtl would stop the JACK server from running every time the program quits. Since PulseAudio is still expecting to use JACK after that, you shouldn't do this any more.
  8. When PulseAudio starts JACK, it uses the command found in the ~/.jackdrc file. QjackCtl automatically updates this file when you change settings, but you may have to restart both PulseAudio and JACK in order to get the new changes to take effect. If they refuse to take effect, you can edit that file yourself.
  9. Be careful about using a very high sample rate with PulseAudio, since it will tend to use a lot of CPU power.
 
Thanks for the info, although I just got everything working like I wanted. However, I had such a nasty crash right now thanks to video cards drivers that it killed my X and audio thrown into chaos. The crash corrupted KDE configuration files, blah.
 
UGH, that really sucks!
That is my worst-fear because I don't know how to fix corrupted anything... I only know how to re-install Linux to fix something like that.
 
@ThunderRd

This is weird... I'm actually not getting realtime scheduling: MPC complains that it can't lower volume because jack_output can't acquire realtime sched.

I checked my configs:
limits.conf

#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
david - rtprio 99
david - memlock unlimited
david - nice -10
# End of file

$ cat /etc/security/limits.d/audio.conf
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd

@audio - rtprio 95
@audio - memlock unlimited
@audio - nice -19

It's a no-go. Gonna do something pretty overkill... (such as using a realtime kernel for the hell of it). I have another neutral solution...
 
You don't need a realtime kernel to achieve what you want. This is made crystal clear in the JACK FAQ.

I also don't think that MPC is 'JACK-aware' the same way that vlc is, for example. It's not listed as such: http://jackaudio.org/applications/ You might want to consider vlc, it is a fine player.

For apps that aren't jack-aware you can set up a generic connection in the patchbay. I have a poker app that wouldn't play the sound, so I set up a connection and defined it to connect to the system input socket. Now, it can access the sound card at the same time as the media player. You can see this in my screenshot earlier in this thread as 'other: non-jack-compat'.

I question the @audio, and think it should be @realtime. You could try changing that. Is your user in the realtime group? Do you actually have a realtime group? If you don't, create it and add your user to it (you need to be in realtime as well as the audio group.)

I don't have that file in /etc/security/limits.d/audio.conf. Instead, I have 40-realtime-base.conf, most likely generated by the settings in limits.conf:

Code:
# Start of 40-realtime-base.conf from realtime-base-0.1

@realtime    -    rtprio    99
@realtime    -    memlock    unlimited

# End of 40-realtime-base.conf from realtime-base-0.1

If you are still using pulseaudio, you *must* have rtkit installed. rtkit is a dbus service that allows the per-application privilege escalation that you need with pulse. I don't know what the precise package name is in your distro, but in Gentoo it's sys-auth/rtkit. Since my system is finally purged of all things pulseaudio, it uses only sys-auth/realtime-base (a package in the JACK family that is compiled as a dependency of the media-sound/jack-audio-connection-kit package). Again, IDK what the exact package names are in your distro, but you probably should make sure they are there before doing anything else.

If none of this stuff solves your issue, I'll try to find some time to reproduce your problem on my 'siduction' box (Debian Sid), but I don't know when that will be.
 
Last edited:
@ThunderRd

Thanks for the reply. I'm aware that I don't need the rt kernel, I just did it for the hell of it :P. I think I've come to the conclusion that maybe MPD's JACK driver isn't that solid, it works, but it outputs realtime issues in the logs which baffled me. I sat on the issue for a while and things just doesn't make sense.

Most of the things you mentioned are already done. audio, realtime group has been added. I've added them in my user. JACK verbose mode doesn't output anything related to realtime thus I think I'm gonna call it an isolated issue with MPD. mplayer, vlc, flash videos in browsers all works fine on both jack and alsa plugin (by routing ALSA to JACK).

I'm using Debian sid. Actually @audio is the default that gets added by doing dpkg-reconfigured -p high jackd, at least to me.

So yea, unless there's a noticeable issue with the audio I think I'm done with JACK's configuration. Realtime works, that's my verdict on it.

Now I'm just fixing some issues with ALSA routing non-aware apps (hello, linux Steam games!). I'm gonna have to report it soon. Super Hexagon works completely fine under my native environment (downloaded from GOG). But for some reason, under the Steam environment it just fails to use ALSA default (which is routing to JACK). I think it's time for a break haha, I'll report it to Valve and see what they say, I'm pretty sure they are doing breaking something.
 
Back
Top