[SOLVED] Disable pulseaudio Jack source but keep Sink running.

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

[SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

By default Jack Sink and Source is loaded for pulseaudio.

I only want Sink to work with pulseaudio and I want no Jack Source connections made by pulseaudio.
the latter creates nasty feedback loops in jack with midi applications that uses pulseaudio.

At the moment I remove all jack source pulseadio connections with patchage after I started pulseaudio.

So how do I disable only Jack Source.???
Last edited by retnev on Mon Jul 27, 2020 5:33 am, edited 1 time in total.
User avatar
bluebell
Established Member
Posts: 1475
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: Disable pulseaudio Jack source but keep Sink running.

Post by bluebell »

You might remove jack-source from /etc/pulse/default.pa

But I guess it's not there but loadeddynamically by some tools that you run.

You could use pavucontrol to mute jack source in Pulseaudio.
Linux – MOTU UltraLite AVB – Qtractor – https://soundcloud.com/suedwestlicht
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

The trouble is ; that the only active code in that config is
### 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
The code that could maybe do this is inactive .
### 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
But in the latter there is no jack sink and source. So automatic seems to be the only possible connection connecting both jack sink and souirce
User avatar
bluebell
Established Member
Posts: 1475
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland & Frankfurt, Germany

Re: Disable pulseaudio Jack source but keep Sink running.

Post by bluebell »

retnev wrote: Sun Jul 26, 2020 4:48 pm The trouble is ; that the only active code in that config is
### 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
I'd try to comment out that stuff.
Linux – MOTU UltraLite AVB – Qtractor – https://soundcloud.com/suedwestlicht
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

Yes commenting out the automatic stuff is the solution but then there is no command for the jack syncs in the manual section.

However the command
load-module module-jackdbus-detect channels=2
loads both the jack source and sync.

There seems to be no way to only load one.
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

Maybe someone can help me with a command line approach rather than config files which seems like a dead end.

jack_lsp -c lists all the possible available connections.
$ jack_lsp -c
system:capture_1
PulseAudio JACK Source:aux0
system:capture_2
PulseAudio JACK Source:front-center
system:capture_3
PulseAudio JACK Source:front-left
system:capture_4
PulseAudio JACK Source:front-right
system:capture_5
PulseAudio JACK Source:lfe
system:capture_6
PulseAudio JACK Source:rear-left
system:capture_7
PulseAudio JACK Source:rear-right
system:capture_8
PulseAudio JACK Source:side-left
system:capture_9
PulseAudio JACK Source:side-right
system:capture_10
PulseAudio JACK Source:aux1
system:playback_1
PulseAudio JACK Sink:front-left
system:playback_2
PulseAudio JACK Sink:front-right
system:playback_3
system:playback_4
system:playback_5
system:playback_6
system:playback_7
system:playback_8
system:playback_9
system:playback_10
system:playback_11
system:playback_12
PulseAudio JACK Source:front-left
system:capture_3
PulseAudio JACK Source:front-right
system:capture_4
PulseAudio JACK Source:rear-left
system:capture_6
PulseAudio JACK Source:rear-right
system:capture_7
PulseAudio JACK Source:front-center
system:capture_2
PulseAudio JACK Source:lfe
system:capture_5
PulseAudio JACK Source:side-left
system:capture_8
PulseAudio JACK Source:side-right
system:capture_9
PulseAudio JACK Source:aux0
system:capture_1
PulseAudio JACK Source:aux1
system:capture_10
PulseAudio JACK Sink:front-left
system:playback_1
PulseAudio JACK Sink:front-right
system:playback_2
The connections I want to disconnect are:
system:capture_1
PulseAudio JACK Source:aux0
system:capture_2
PulseAudio JACK Source:front-center
system:capture_3
PulseAudio JACK Source:front-left
system:capture_4
PulseAudio JACK Source:front-right
system:capture_5
PulseAudio JACK Source:lfe
system:capture_6
PulseAudio JACK Source:rear-left
system:capture_7
PulseAudio JACK Source:rear-right
system:capture_8
PulseAudio JACK Source:side-left
system:capture_9
PulseAudio JACK Source:side-right
system:capture_10
PulseAudio JACK Source:aux1
system:playback_1
PulseAudio JACK Sink:front-left
system:playback_2
PulseAudio JACK Sink:front-right
However the command fails
$ jack_disconnect PulseAudio JACK Source:front-left system:capture_1
ERROR Source:front-left not a valid port
fails to be recognized.

Anyone knows how to disconnect the ports I listed above ? I must be misinterpreting the jack_disconnect command
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

I managed to get an eror free response from the command like so in the script:
#!/bin/bash

jack_disconnect "PulseAudio JACK Source:front-left" system:capture_1
jack_disconnect "PulseAudio JACK Source:front-right" system:capture_2
jack_disconnect "PulseAudio JACK Source:rear-left" system:capture_3
jack_disconnect "PulseAudio JACK Source:rear-right" system:capture_4
jack_disconnect "PulseAudio JACK Source:front-center" system:capture_5
jack_disconnect "PulseAudio JACK Source:lfe" system:capture_6
jack_disconnect "PulseAudio JACK Source:side-left" system:capture_7
jack_disconnect "PulseAudio JACK Source:side-right" system:capture_8
jack_disconnect "PulseAudio JACK Source:aux0" system:capture_9
jack_disconnect "PulseAudio JACK Source:aux1" system:capture_10

exit
However the resut is that it doesnt disconnect the jack connections I made in patchage and believes there are no connections.
$ ./jackconnections.scr
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
cannot disconnect client, already disconnected?
A bit of a ridiculous situation. Jack cannot disconnect by its own commands; jack connections which were made and clearly exists.
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

Ok, I sort of solved the problem.
I tested my script when the connections were made by jack/pulseaudio and NOT by patchage.
It works perfectly if the creator of the connection is NOT made by patchage.

Either patchage has a bug or it uses its own connection scheme invisible to jack -- I doubt.

It seems patchage has a bug.
What bothers me though is that I can make connections in patchage and they always work.

i dont know why jack operations doesnt see a patchage jack connection though.

This will remain a mystery as the developer is unreachable and the entire KXStudio thing seemed to have died.

Anyway I solved my own problem. My script works and patchage is at fault.
User avatar
sysrqer
Established Member
Posts: 2013
Joined: Thu Nov 14, 2013 11:47 pm
Contact:

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by sysrqer »

Kxstudio isn't dead at all but the dev of that would probably point you towards Catia.

I don't understand what the problem was originally, how can a midi application cause feedback? Which applications are you talking about?
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

Rosegarden picks up the pulseaudio sources for some reason, but outputs to jack sink. Creates deafening feedback through the main speakers and sends garbage as a result to my keyboards completely misprogramming it. Dangerous. It is only when I completely disable pulseaudio sources, that the problem goes away and it goes away for good when I do that. It triggers Rosegarden to do crazy things.

If Pulseaudio sources are enabled, most other midi audio programs have the same type of problem. Bitwig does similar.
So it is not the midi programs at fault as they all behave like this in some way if pulseaudio sources are enabled.
Pulseaudio Sources is the culprit.
Pulseaudio is part of the SystemD mess with no regard to other programs. Lately if I have a problem with linux, after some digging SystemD or one of its minions like Pulseaudio, is usually the culprit as it tries to take over linux by being a one application-does-all and does it pretty mediocre.

There is no need for pulseaudio sources in anything I do and will ever do it is generaly a very bad idea in a production studio as you have daws and whatnot connected to Jack. Pulseaudio Sources is an unnecessary annoyance creating extra feedback loops (seemingly invisible) as it is not designed for production services such as jack and mixbus and myriads of controllers etc etc.
Pulseaudio Sink however works great as I can use it to feed all my desktop audio to Jack. That is all I use it for. Use it only for a send-desktop-audio-to-Jack

I did solve it on my own though as you can see. Sources are now switched off after I wrote an initialization script.

Well KXStudio was on Hiatus for more than a year, and now developers dont respond. To me it is technically dead. I read the developer moved to Portugal and might resurrect KXStudio. They used to have nice applications which I use, but due to the hiatus the applications fell behind and are now bug ridden.

Catia is inferior to Patchage as it refuses to show me all the midi routings which I can do in Patchage but is non existing in Catia.
User avatar
sysrqer
Established Member
Posts: 2013
Joined: Thu Nov 14, 2013 11:47 pm
Contact:

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by sysrqer »

That sounds very strange, could you not just disconnect it from rosegarden in qjackctl or whatever you use? I've never heard of that happening with any program and I have just installed rosegarden and it doesn't happen to me with pulseaudio running and bridged.

The kxstudio developer has actually been quite busy. and generally responds on irc. How did you try to contact him? You are, of course, welcome to think what you like, but it's obviously not dead and I'm sure he would be happy to look at your bug reports.
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

No it is too many to disconnect and the feedback is deafening. Cannot risk that again.
Pulseaudio would just willy nilly connect the sources again and then I am caught unaware and the deafening screeching feedback starts.

You have to kill it at the source ... pulseaudio.
I now have a script that runs continuously and is checked to be running by cron every minute. As soo as it detects pulseaudio source active it kills it.
Pulseaudio is nice but infantile in its design. It or it's designer seemingly believes it is the only application that matters.

I contacted the KXStudio developer directly starting about a year back. No response.
Well he must be reading LinuxAudio Forum as he replied last night, after a year's worth of messages.
He confirmed one bug i posted and explained what was going on.
Nice guy .. if you get hold of him.
aicram
Established Member
Posts: 135
Joined: Wed Jan 28, 2009 2:24 am

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by aicram »

Hi retnev,

I just read through this thread. Very interesting. I have already posted about no sound in browsers even with jack pulse bridge. No answer, yet. I like patchage as well and I use cadence. It has worked for me well until the past month. Would you please let me know what the exact forum was that you learned of the bug? I have been looking but have not found it. Hoping to find some answers, too. Glad you have solved your issue.

Thank you,
aicram
retnev
Established Member
Posts: 95
Joined: Sat Mar 25, 2017 2:13 am

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by retnev »

aicram, i am just in the middle of an upgrade, so I cant really help now.
Probably will be 2 days before I can help you.
In the mean time what is the link to your LinuxMusicians Forum Post you mention ?
I will answer you there in due time.

I know this problem. it is likely a systemD/pulseaudio problem as I had that before when systemD was still running. i am running a systemD free distro so all or the majority of these annoyances disappeared.
SystemD bit me hard on a work related server just yesterday reporting a drive as faulty when it turned out to be perfect. systemD now even took over fsck on ubuntu and they call it fsckd !! Absolute malicious garbage.
Completely false reporting and refused to start a server for absolutely no reason. I uninstalled systemD (dont try that if you dont know what you do) there and it runs perfect now and fsck report the drive as normal. It is the last server I have in my business that sti9ll runs SystemD and only that one gives me trouble. Go figure.!

*Very Good Advice*
In the future take the time to build your sound server on Devuan or Antix ( these are SystemD free and even Dbus free in some cases). Only attempt it on that if you are a very good system administrator. It is not for the weak to attempt it on those two, but the result is RUGGED..
If not, your only option is MXLinux as second prize. It ROCKS! and i built a system I could never had before. It is lsystemD free so most of the annoyances disappears. Just make sure that you block systemD in apt as it can reinstall as a dependency) If you use MX, they take care of most of that.
I gave up on all the "Studio distros" and ready made Audio video distros and such. They are seemingly created by sound/video enthusiasts who generally do not understand the system administration issues in depth. The result is Multimedia distros with a a lot of gremlins like dbus selinux systemD and the likes and more running interference with a sound server.

The particular one you mention is pulseaudio problem not firefox afaik. Just send me the link and I will try and help in a few days.
aicram
Established Member
Posts: 135
Joined: Wed Jan 28, 2009 2:24 am

Re: [SOLVED] Disable pulseaudio Jack source but keep Sink running.

Post by aicram »

Hi retnev,

Thank you for your very kind and thoughtful reply. I appreciate it very much. The link I am referring to is: viewtopic.php?p=121278#p121278 . Take your time to answer. Seems like you have a lot going on there. I just may switch to mxlinux, at least try it. :)

Good luck with your upgrading.

Thanks again!

Sincerely,

aicram
Post Reply