JACK with Pulseaudio

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
Retro Banana
Established Member
Posts: 41
Joined: Thu Feb 07, 2013 5:39 pm

JACK with Pulseaudio

Post by Retro Banana »

I use Ubuntu 12.10 64-bit and getting Pulseaudio to behave with JACK is pretty hard without these three tips.

1. Use pulseaudio-module-jack. This package makes JACK look like an audio device to Pulseaudio, so JACK can take control of your sound card. Just run sudo apt-get install pulseaudio-module-jack
2. Enable JACK dbus interface. This will allow the above to work, but below is a problem you might encounter.
3. Wait until an audible click, or 5 seconds, after starting the JACK server, to start it up again.
Shadow_7
Established Member
Posts: 175
Joined: Tue Jun 08, 2010 3:35 pm

Re: JACK with Pulseaudio

Post by Shadow_7 »

There's a .asoundrc configuration that goes along with the pulse over jack thing. I've run it that way. But it wasn't to my liking. The newer versions strive to address the issue I had. When I tried it pulse always used 48kHz even when jack is run at 44.1kHz. So you have a relatively high latency since it's always doing the sample rate conversion. In the case of something like fluidsynth with 44.1kHz samples it likely does 44.1 -> 48 -> 44.1 resampling. It worked, but kind of annoying and not suited for live performance since it had a relatively high latency.

Code: Select all

pcm.pulse {
  type pulse
}
ctl.pulse {
  type pulse
}
pcm.!default {
  type pulse
}
ctl.!default {
  type pulse
}
I'm not sure if that's the ~/.asoundrc that I used for it, but you might give it a try.

http://jackaudio.org/pulseaudio_and_jack

I use option 4. Disable pulse while jack runs.

in /etc/pulse/client.conf you need a line:

Code: Select all

autospawn = no
and then you can use the --kill option for pulseaudio and it doesn't try to start up again.

$ pulseaudio --start
$ pulseaudio --kill
(NOTE: --stop isn't a valid option)
User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: JACK with Pulseaudio

Post by bluebell »

I was doing similar stuff and wanted to use skype with my webcam's mix instead of my Foucusrite Scarlet 2i2's input:

http://www.marzen.de/Holger/pulseaudio_and_jack/

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

gazpacho
Established Member
Posts: 41
Joined: Wed Aug 15, 2012 1:49 am
Location: Mallorca

JACK and Pulseaudio separated

Post by gazpacho »

I have an onboard card and another one for audio work. The onboard card goes to its own dedicated speakers and uses pulseaudio. The "audio work" one is wired to another better speaker system and is managed by cadence with jack. To have them working together but apart my settings are the following:
Use "autospawn = no" inside "/etc/pulse/client.conf"
Use ALSA>jack (plugin) in cadence
Disable check in "Autostart jack or ladish at login" in cadence

When I boot, I start (if I want it) pulseaudio on a terminal with:

Code: Select all

pulseaudio --start
In case the card pulseaudio uses is not the correct one, run "pavucontrol" and choose the correct one, in my case the onboard card (press the green check). Then stop pulseaudio with:

Code: Select all

pulseaudio -k
and re-start it again. Now the onboard card is running pulseaudio itself, apps sound there by default.

Now fire up cadence (Jack status shows server status stopped), open "configure" and choose the "audio work" card and its parameters. Once set, click on "start" to start jack for that card.
Apps that are jack aware via their settings are sent to the "audio work" card, or sent to the onboard card if you choose pulseaudio.
If I want to use the onboard card also for audio work alongside the one managed in cadence (or several cards if installed), I stop pulseaudio for it and use the procedure mentioned here:
http://www.linuxmusicians.com/viewtopic ... 47&t=10940
Use "alsamixer" in a terminal to set parameters of all cards, F6 is used to choose the card you want to tweak. It may be ugly but it is the best mixer.

In cadence I dont choose the other options because I prefer to keep audio work separated from other audio:
The ALSA>Pulseaudio>Jack (plugin) setting adds possible complications if pulseaudio misbehaves.
The ALSA>loop>Jack setting permits to have a dedicated alsa output/input option in apps without jack output/input that make them sound through jack. It uses "alsa_in/out" program to connect to jack and is "cleaner" than the preceding. These two settings enables all audio apps to go to the jack card even if they cant use jack.

In a laptop with only one card, I use pulseaudio when not doing audio work, and kill pulseaudio and start cadence if otherwise, never enable both. If I plug a usb card (or more) I can do as above.
In this way I easily choose the right configuration for the task needed.
Post Reply