You are not logged in.

#1 2016-06-23 02:23:26

saponace
Member
Registered: 2015-10-09
Posts: 19

[Solved] Can't make pulseaudio run with Jack

Hi,
I decided recently to get rid of my windows my windows partition that I used until now just for my DAW.
So I want to use Bitwig Studio on Arch. For that I need Jack. Not a problem: Jack works by its own, Same for pulseaudio, but when I try to listen to some audio from any multimedia source while Jack is running, it does not work. I followed the steps described here : https://wiki.archlinux.org/index.php/Pu … rough_JACK, but Pulseaudio does not see Jack and hence can't route its audio to it.

Here is my /etc/pulse/default.pa:

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.nofail

### Load something into the sample cache
#load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/bell.oga
#load-sample-lazy pulse-hotplug /usr/share/sounds/freedesktop/stereo/device-added.oga
#load-sample-lazy pulse-coldplug /usr/share/sounds/freedesktop/stereo/device-added.oga
#load-sample-lazy pulse-access /usr/share/sounds/freedesktop/stereo/message.oga

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

# X11 modules should not be started from default.pa so that one daemon
# can be shared by multiple sessions.

### Load X11 bell module
#load-module module-x11-bell sample=x11-bell

### Register ourselves in the X11 session manager
#load-module module-x11-xsmp

### Publish connection data in the X11 root window
#.ifexists module-x11-publish.so
#.nofail
#load-module module-x11-publish
#.fail
#.endif

### Make some devices default
#set-default-sink output
#set-default-source input

(Default configurartion file. I did not cange anything)

Here is my /etc/asound.conf:

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

The problem is that Pulseaudio does not seem to see Jack as a potential sink (pacmd does only return one sink, the alsa one).

I did not find much documentation/tutorials on how to do that. And even the Arch wiki is pretty quick on that. So i guess it is supposed to be straightforward.

Also, something that may be related to this issue: When I open pasystray, the menu entries Manager, Volume meter (Playback), Volume meter (Recording), and Configure local sound server are disabled. Could this be linked to the issue ?


I never really understood how audio works in Linux, that's probably why I'm totally lost here smile

Thanks for your help !

Last edited by saponace (2016-06-26 03:16:03)

Offline

#2 2016-06-23 04:05:38

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] Can't make pulseaudio run with Jack

If you followed 'The new new way' guide, how are you starting jack?

Pulseaudio's module-jackdbus-detect only works with jack's dbus interface introduced in jack2.
For that, you need either 'jack2' or 'jack2-dbus' package. 'jack' is the older version and don't work with the dbus-detect pulseaudio module.

you can use jack_control command to start jackdbus: https://wiki.archlinux.org/index.php/JA … ACK2_D-Bus

Apart from that, everything seems to be in order, as long as you have pulseaudio-jack installed.

Alternatively, rest of the PulseAudio through JACK examples ('The new way' and 'The old way') should work with legacy jackd.

Offline

#3 2016-06-23 04:29:36

saponace
Member
Registered: 2015-10-09
Posts: 19

Re: [Solved] Can't make pulseaudio run with Jack

Oops, sorry, I forgot to mention that I use Jack2 (not Jack2-dbus) and I tried the new new way.

I also have installed the package pulseaudio-jack.

I start Jack2 via Qjackctl (jack_control start fails with

DBus exception: org.jackaudio.Error.Generic: Failed to open server

.

By the way, I can't find Jack logs. Do you know where they are ? (Jack does not seem to log to syslog ...)

Anyways, thanks for your help.

Offline

#4 2016-06-23 16:29:02

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] Can't make pulseaudio run with Jack

In qjackctl, did you enable 'Setup->Misc->Enable JACK D-Bus interface'? Otherwise it will use the legacy jackd client which has no dbus support.
Although, I'm not sure if that would work for you if you can't start jackdbus by hand with jack_control.

Apparently jackdbus writes its logs to ~/.log/jack/jackdbus.log.
jackd outputs its status messages to stdout, so you should be seeing them in systemd journal, or terminal output if you start it by hand.

Last edited by ooo (2016-06-23 16:29:29)

Offline

#5 2016-06-24 10:56:29

saponace
Member
Registered: 2015-10-09
Posts: 19

Re: [Solved] Can't make pulseaudio run with Jack

Okay, I found the problem. It was totally my fault. I was enabling Jack-dbus interface in qjackctl, and restarted the jack server, but did not restart qjackctl. I don't knw why, but qjackctl needs to be restarted too for the jack server to re-read its configuration (or or qjackctl to actually write the configuration). Anyways: The problem was that I did not restart qjackctl, and I should have.


But I still have another issue that I thought was related to the first one, and apparently it is not:
I can't play audio from multimedia sources when jack is running. Youtube (chrome, html5) pauses any video running as soon as jack starts, and vlc stops playing the song (but the track keeps playing, just no sound anymore). But I can configure vlc to talk directly to jack, and it works.


I've seen a couple of tricks that make flash keep playing, even when jack is running, but it involves making alsa talking directly to jack. Same for vlc: I don't want vlc to talk directly to jack...

If I understand well, what people usually do (and what I want) is: applications->pulseaudio->jack->alsa. Is that how it is supposed to work ?


I am sorry. I really feel dumb when I ask these questions, and I know you may think the aswer of these questions are abvious.

Offline

#6 2016-06-24 18:20:45

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] Can't make pulseaudio run with Jack

Well, the whole point of any pulseaudio-jack bridge, is to be able to hear audio from pulseaudio application while jack is running.

if module-jackdbus-detect is working, the pulseaudio sink should appear as readable client in qjackctl's 'Connections' window when jack is running. If it's connected to your system input port, you should be hearing the sound from pulseaudio.

Applications that don't have pulseaudio support and use ALSA directly (e.g. flash, web browsers), should get routed to pulseaudio with pulseaudio-alsa or equivalent .asoundrc. This part should work with the asound.conf you posted earlier, unless you also have differently configured ~/.asoundrc that takes precedence over the asound.conf.

To sum it up:
jack applications: application->jack->alsa
pulseaudio applications (with pulseaudio-jack modules): application->pulseaudio->jack->alsa
alsa applications (with pulseaudio-alsa): application->alsa->pulseaudio->jack->alsa

Offline

#7 2016-06-24 21:50:42

saponace
Member
Registered: 2015-10-09
Posts: 19

Re: [Solved] Can't make pulseaudio run with Jack

I do see the pulseaudio sink in qjackctl. It is connected to the physical outputs. Jack's sink ins selected as default in pulseaudio.

Alsa->Pulseaudio works : I can see chrome in the list of playback streams in pavucontrol. I don't have a ~/.asoundrc file.

So it should work with my configuration ? I am so lost now ...

Offline

#8 2016-06-25 07:36:54

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] Can't make pulseaudio run with Jack

If you can see pulseaudio sinks in qjackctl, the jackdbus-detect module should be working, so it seems to me everything should be in order.
I must say I can remember jackdbus-detect being quite dodgy the last time I used it, although I can't remember the details.

My last ideas:

Make sure that the jack sink isn't muted from pulseaudio's side (if that's even possible, I haven't used pulseaudio for quite some time).

Double check that you've connected the pulseaudio sink to correct jack input, by playing audio from e.g. vlc to jack output and checking it's connection.

Also, the wiki page suggests:

If it still does not work, check with pavucontrol in the playback tab and make sure the relevant programs are outputting to PulseAudio JACK Sink instead of your audio card (which JACK has control of, so it will not work).

If can't get it working, you could still try using pulseaudio's module-jack{-sink,-source} ('The new way' in wiki), which is a bit more complicated way, but in my experience more robust than jackdbus-detect.

Offline

#9 2016-06-26 03:15:41

saponace
Member
Registered: 2015-10-09
Posts: 19

Re: [Solved] Can't make pulseaudio run with Jack

Okay, so once more I could have solved the issue by myself.
In pavucontrol, I forgot to set the output of every source to Jack sink.

I'm sorry I bothered you with these pointless questions ...

So yea, the new new way works well for me! Thanks for your help !

Offline

Board footer

Powered by FluxBB