pw-jack

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

User avatar
Impostor
Established Member
Posts: 1561
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 156 times
Been thanked: 430 times

pw-jack

Post by Impostor »

So as not to delay the inevitable, I've installed Mint 22 which uses Pipewire ootb. I needed to install pipewire-jack manually, and create a pipewire group to add myself to. Default samplerate seems 48kHz, so that's fine, but default buffer size was 1024, so changed that to 128. So far so good.

Problem is, I seem to need to run every jack application from a terminal with

Code: Select all

pw-jack <application> 

otherwise the application senses that jack is not available and throws errors (MusE, Qtractor, Pianoteq).

Am I missing something or is that indeed the way to run Jack apps with Pipewire?

From https://docs.pipewire.org/page_man_pw-jack_1.html:
"If PipeWire's reimplementation of the JACK client libraries has been installed as a system-wide replacement for JACK's own libraries, then the whole system already behaves in that way, in which case pw-jack has no practical effect."

So the question becomes: how to accomplish "PipeWire's reimplementation of the JACK client libraries has been installed as a system-wide replacement for JACK's own libraries" on a system where pipewire is installed ootb??

User avatar
sysrqer
Established Member
Posts: 2583
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 370 times
Been thanked: 165 times
Contact:

Re: pw-jack

Post by sysrqer »

You used to have to do some kind of symlinking thing and used to be detailed here https://pipewire-debian.github.io/pipewire-debian/ but it seems it's not now, this was quite a few years ago so I'm surprised you would need to but perhaps you're running a very old version if it's mint. Might be a good idea to use that, or another PPA to get a newer version of pipewire and wireplumber.

There is something like this mentioned in the debian docs https://wiki.debian.org/PipeWire#JACK but I can't remember that that's the same thing I'm thinking of. Also mentioned in the void linux docs https://docs.voidlinux.org/config/media/pipewire.html

User avatar
Impostor
Established Member
Posts: 1561
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 156 times
Been thanked: 430 times

Re: pw-jack

Post by Impostor »

sysrqer wrote: Thu Sep 19, 2024 6:26 pm

You used to have to do some kind of symlinking thing

I looked up the location of pipewire-jack's library files. They were installed in

/usr/lib/x86_64-linux-gnu/pipewire-0.3/jack

But..I also had equivalent library files in

/usr/lib/x86_64-linux-gnu/

with the difference that in the upper folder libjack.so is linked to libjack.so.0.3.1005
and in the lower folder libjack.so was linked to libjack.so.0.1.something.

So I just deleted the files in the lower folder, and copied the files from the upper into the lower folder, and behold: it works correctly now (I did a sudo ldconfig for good measure).

I guess the Mint packagers didn't test with Jack applications first..

User avatar
sysrqer
Established Member
Posts: 2583
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 370 times
Been thanked: 165 times
Contact:

Re: pw-jack

Post by sysrqer »

Impostor wrote: Thu Sep 19, 2024 6:48 pm

I guess the Mint packagers didn't test with Jack applications first..

Which version of pw do you have? I wonder if it's less of a packaging thing and more of a very early pipewire thing.

User avatar
Impostor
Established Member
Posts: 1561
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 156 times
Been thanked: 430 times

Re: pw-jack

Post by Impostor »

sysrqer wrote: Thu Sep 19, 2024 6:53 pm
Impostor wrote: Thu Sep 19, 2024 6:48 pm

I guess the Mint packagers didn't test with Jack applications first..

Which version of pw do you have? I wonder if it's less of a packaging thing and more of a very early pipewire thing.

Code: Select all

$ pipewire --version
pipewire
Compiled with libpipewire 1.0.5
Linked with libpipewire 1.0.5

So I guess version 1.0.5. Although it's rather suspicious that pipewire-jack (also given as version 1.0.5 in Synaptic), puts its libraries in a pipewire-0.3 folder...

And the plot thickens: no installed package with pipewire in the name did install those libjack.so and related files into /usr/lib/x86_64-linux-gnu/, as far as I can determine in Synaptic. And the pipewire-jack package installed them exclusively in /usr/lib/x86_64-linux-gnu/pipewire-0.3/jack/.

This is a clean installation of Mint 22 by the way, so they are no leftovers from a previous install.

Last edited by Impostor on Thu Sep 19, 2024 7:19 pm, edited 2 times in total.
User avatar
sysrqer
Established Member
Posts: 2583
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 370 times
Been thanked: 165 times
Contact:

Re: pw-jack

Post by sysrqer »

Interesting. Yeah that's what caught my attention but I've just checked and I also have it on Arch (although not the jack part) so must be normal.

User avatar
Impostor
Established Member
Posts: 1561
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 156 times
Been thanked: 430 times

Re: pw-jack

Post by Impostor »

Impostor wrote: Thu Sep 19, 2024 7:01 pm

And the plot thickens: no installed package with pipewire in the name did install those libjack.so and related files into /usr/lib/x86_64-linux-gnu/, as far as I can determine in Synaptic. And the pipewire-jack package installed them exclusively in /usr/lib/x86_64-linux-gnu/pipewire-0.3/jack/.
This is a clean installation of Mint 22 by the way, so they are no leftovers from a previous install.

Ah, I found out where those original files came from. I built MusE from source, and one dependency to build was libjack-jackd2-dev, which pulled in libjack-jackd2-0, which in turn installed those libraries. Guess I have to be more careful..

User avatar
Impostor
Established Member
Posts: 1561
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 156 times
Been thanked: 430 times

Re: pw-jack

Post by Impostor »

One other thing I had to manually set is:
@pipewire - memlock unlimited

instead of some default value, in /etc/security/limits.d/25-pw-rlimits.conf, because with the default I couldn't load more than 7 instances of Pianoteq without crashing MusE.

User avatar
Largos
Established Member
Posts: 717
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 83 times
Been thanked: 226 times

Re: pw-jack

Post by Largos »

I found the same needs to be done with MX Linux but I don't need to (and never needed to) use the pw-jack prefix on OpenSuse. So I would presume it's a debian thing. It's easiest to edit menu entries to put the prefix in commands. Or if you use the terminal, put some bashrc alias in.

User avatar
GMaq
Established Member
Posts: 2935
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 562 times
Been thanked: 635 times

Re: pw-jack

Post by GMaq »

Lol,

You're giving me a deja-vu... I had to do all that stuff for AV Linux plus add a custom metadata tool, PipeWire is a pretty abrupt stop to use for Pro Audio, many big mainstream Distros have no idea what's needed... :roll:

If you have a multi-i/o interface your next hurdle will be to assign a "Pro Audio" profile to it with PulseAudio Volume Control so it is not seen as a surround device.. :wink:

Last edited by GMaq on Fri Sep 20, 2024 12:58 pm, edited 1 time in total.
User avatar
Impostor
Established Member
Posts: 1561
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 156 times
Been thanked: 430 times

Re: pw-jack

Post by Impostor »

Next thing I need to figure out is if I need a jack.conf in addition to a pipewire.conf file

https://docs.pipewire.org/page_man_pipe ... onf_5.html

I may need to sleep on that.

User avatar
sysrqer
Established Member
Posts: 2583
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 370 times
Been thanked: 165 times
Contact:

Re: pw-jack

Post by sysrqer »

GMaq wrote: Thu Sep 19, 2024 9:56 pm

If you have a multi-i/o interface your next hurdle will be to assign a "Pro Audio profile to it with PulseAudio Volume Control so it is not seen as a surround device.. :wink:

Is that really a hurdle? On my system it that was literally a drop down menu in the audio settings. Definitely a good tip though.

User avatar
LAM
Established Member
Posts: 1011
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 145 times
Been thanked: 361 times

Re: pw-jack

Post by LAM »

Impostor wrote: Thu Sep 19, 2024 11:30 pm

Next thing I need to figure out is if I need a jack.conf in addition to a pipewire.conf file

https://docs.pipewire.org/page_man_pipe ... onf_5.html

I may need to sleep on that.

It depends.
For example, if you want to control the realtime priority (rt.prio) or the minimum buffersize/samplerate (node.latency) of JACK applications or name your ports like good old JACK (jack.default-as-system), then yes.

in mix, nobody can hear your screen

User avatar
GMaq
Established Member
Posts: 2935
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 562 times
Been thanked: 635 times

Re: pw-jack

Post by GMaq »

sysrqer wrote: Fri Sep 20, 2024 6:13 am
GMaq wrote: Thu Sep 19, 2024 9:56 pm

If you have a multi-i/o interface your next hurdle will be to assign a "Pro Audio profile to it with PulseAudio Volume Control so it is not seen as a surround device.. :wink:

Is that really a hurdle? On my system it that was literally a drop down menu in the audio settings. Definitely a good tip though.

Well, yes for me it was, I was extremely puzzled why my Presonus AR-8 was suddenly a surround device and I've had it come up more than a few times with AVL Users... How is it intuitive for people to know that a 'PulseAudio' Pro Audio profile exists at all (wait, what? Didn't we replace 'PulseAudio' on the system...?) if they've just either installed PipeWire as the Distro packaging provides it, or installed a fresh Distro without pw-jack or PulseAudio Volume control? In my experience pavucontrol is not a dependency of PipeWire so it is quite easy to end up with a PW system with no pavucontrol and then it's really confusing.

My point isn't old guy moaning that PipeWire sucks, I'm well past that...lol. But this thread demonstrates that on a huge mainstream Distro even someone well versed with Pro Audio work can be stymied pretty quickly by the incomplete state that PipeWire arrives in.

User avatar
sunrat
Established Member
Posts: 1063
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 173 times
Been thanked: 287 times

Re: pw-jack

Post by sunrat »

I've been wondering why we need pavucontrol to set profile in PW too. From a post at reddit this was suggested:

Put something like:

Code: Select all

monitor.alsa.rules = [
  {
    matches = [
      {
        node.name = "YOUR_DEVICE_NAME_AS_SHOWN_BY_'wpctl status'"
      }
    ]
    actions = {
      update-props = {
        device.profile = "pro-audio"
      }
    }
  }
]

in

~/.config/wireplumber/wireplumber.conf.d/51-set-profile.conf

I can't test it as I don't have a "Pro Audio" sound card.
Note also from Pipewire FAQ section on the Pro Audio profile:

This profile is meant to be used on audio cards with:

Code: Select all

More than 8 channels for input or output. Channel assignment is probably wrong for these cards.
Cards with many instruments connected to each input. It makes sense to handle each channel as a separate unrelated stream.
Output Cards with many unrelated outputs, like speakers on the first 2 channels, headphones on the second channel-pair, additional speakers on the other channels.

For consumer cards with stereo or surround configurations, it does not make sense to use this Profile.

Post Reply