Bug 1390043

Summary: pulseaudio doesn't work while jackd is running
Product: [Fedora] Fedora Reporter: J. Bruce Fields <bfields>
Component: pulseaudioAssignee: Lennart Poettering <lpoetter>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: jorti, lpoetter, rdieter, wtaymans
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 19:04:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description J. Bruce Fields 2016-10-31 02:30:01 UTC
When I start jackd (using qjackctl), other audio (e.g. from totem or firefox) stops playing.

I believe that module-jackdbus-detect is supposed to handle this.  I have it installed (from pulseaudio-module-jack).  And it looks like it should load by default, since /etc/pulse/default.pa has:

  .ifexists module-jackdbus-detect.so
  .nofail
  load-module module-jackdbus-detect channels=2
  .fail
  .endif

According to https://fedoraproject.org/wiki/JACK_Audio_Connection_Kit#Integrate_JACK_with_PulseAudio "JACK uses D-Bus to gain control of the sound card from PulseAudio. PulseAudio should grant control, giving JACK control of it. However this does not work at the time of writing."

That text was added in 2012, so there may be a longstanding known bug?  I haven't been able to find anything else about it.

Comment 1 J. Bruce Fields 2016-11-03 02:25:33 UTC
Also "pactl list" says:

Module #7
        Name: module-jackdbus-detect
        Argument: channels=2
        Usage counter: n/a
        Properties:
                module.author = "David Henningsson"
                module.description = "Adds JACK sink/source ports when JACK is started"
                module.version = "8.0"

Comment 2 J. Bruce Fields 2016-12-26 19:46:38 UTC
While testing I noticed errors in the log like "module-jack-sink.c: JACK error >Cannot use real-time scheduling (RR/15)(1: Operation not permitted)<".  I'd already raised the relevant ulimit.  It appears pulseaudio was setting the RESET_ON_FORK code and then jack code was attempting to clear it, so sched_setscheduler() calls without RESET_ON_FORK were failing with EPERM.  So the errors went away after removing the code that set RESET_ON_FORK (see below).  That doesn't actually fix the problem, so was just a distraction.  (But seems like a bug itself, whether this is the right fix or not).

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 873f86a0e5b2..15d55b5fec26 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -713,12 +713,6 @@ static int set_scheduler(int rtprio) {
     pa_zero(sp);
     sp.sched_priority = rtprio;
 
-#ifdef SCHED_RESET_ON_FORK
-    if (pthread_setschedparam(pthread_self(), SCHED_RR|SCHED_RESET_ON_FORK, &sp) == 0) {
-        pa_log_debug("SCHED_RR|SCHED_RESET_ON_FORK worked.");
-        return 0;
-    }
-#endif
 
     if (pthread_setschedparam(pthread_self(), SCHED_RR, &sp) == 0) {
         pa_log_debug("SCHED_RR worked.");

Comment 3 J. Bruce Fields 2016-12-27 02:16:35 UTC
Ugh, this is just user error.  I missed that there's some manual configuration required, either to choose the new Jack sink/source audio devices in the gnome sound settings dialog, or make the right connections in jack, I'm not quite clear which.  It's annoying that this isn't more automatic, but this was basically my fault.

The issue in comment 2 still looks like a bug, though.

Comment 4 Fedora End Of Life 2017-07-25 23:40:54 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2017-08-08 19:04:11 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.