What's the purpose of PipeWire's dynamic quantum setting?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
mcord
Established Member
Posts: 38
Joined: Mon Jul 03, 2023 10:32 am
Has thanked: 21 times
Been thanked: 8 times

What's the purpose of PipeWire's dynamic quantum setting?

Post by mcord »

I see that PipeWire can change the buffer size for applications dynamically, and you can set the minimum and maximum as well as the default quantum as mentioned here.

My question is, when does this dynamic change actually happen? My understanding is that when the default quantum is set and a JACK application is started, the application uses that buffer size as long as it is running. So, does PipeWire change the buffer size only for non-JACK applications?

This thread is what prompted me to ask this question. (I thought it would be better to start a separate thread.) In that thread, I noticed that default.clock.quantum was used in ~/.config/pipewire/pipewire.conf.d, while in my own configuration, I've been using node.latency = 1024/48000 and node.lock-quantum = true in ~/.config/pipewire/jack.conf.d. So, I'm wondering if there's any benefit for me to use the setting default.clock.quantum instead, and to also set default.clock.min-quantum and default.clock.max-quantum.

User avatar
Largos
Established Member
Posts: 638
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: What's the purpose of PipeWire's dynamic quantum setting?

Post by Largos »

The quantum/buffer can change whilst an application is running and it should change to that setting. Pipewire is designed that applications will themselves request a quantum and Pipewire will use the last lowest requested value. JACK applications generally don't do this so they will follow the value of default.clock.quantum unless this is overridden by other settings such as what you use or the force, upper and lower quantum setting. So in current practicality there are 3 times (that I know of) when a JACK application's buffer will change whilst it's open

  1. When the force quantum command is used and it's different.
    2 When max buffer command is used and max buffer is lower that what the JACK application is connected too.
  2. When min buffer command is used and min buffer is higher that what the JACK application is connected too.

IMO (and this is just opinion), you should not use force settings by default because in the future, presumably, applications will be setting their own quantums and it seems to me a bad habit to get into because of that.

folderol
Established Member
Posts: 2083
Joined: Mon Sep 28, 2015 8:06 pm
Location: Here, of course!
Has thanked: 232 times
Been thanked: 400 times
Contact:

Re: What's the purpose of PipeWire's dynamic quantum setting?

Post by folderol »

This is going to cause havoc for those Jack programs that set their internal buffers to match the one received from Jack if it can arbitrarily change while they are running :shock:

The Yoshimi guy {apparently now an 'elderly'}
User avatar
Largos
Established Member
Posts: 638
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: What's the purpose of PipeWire's dynamic quantum setting?

Post by Largos »

folderol wrote: Mon Jan 01, 2024 4:23 pm

This is going to cause havoc for those Jack programs that set their internal buffers to match the one received from Jack if it can arbitrarily change while they are running :shock:

Which programs are those? I tried changing the quantum setting whilst Ardour and MusE are playing and it causes no problem, just a momentary cut out of midi.

folderol
Established Member
Posts: 2083
Joined: Mon Sep 28, 2015 8:06 pm
Location: Here, of course!
Has thanked: 232 times
Been thanked: 400 times
Contact:

Re: What's the purpose of PipeWire's dynamic quantum setting?

Post by folderol »

Largos wrote: Mon Jan 01, 2024 5:17 pm
folderol wrote: Mon Jan 01, 2024 4:23 pm

This is going to cause havoc for those Jack programs that set their internal buffers to match the one received from Jack if it can arbitrarily change while they are running :shock:

Which programs are those? I tried changing the quantum setting whilst Ardour and MusE are playing and it causes no problem, just a momentary cut out of midi.

Well, losing MIDI even just for one note would be totally unacceptable for me!

The Yoshimi guy {apparently now an 'elderly'}
User avatar
Largos
Established Member
Posts: 638
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: What's the purpose of PipeWire's dynamic quantum setting?

Post by Largos »

folderol wrote: Mon Jan 01, 2024 8:39 pm

Well, losing MIDI even just for one note would be totally unacceptable for me!

It wouldn't realistically be a situation that would be happening though. You wouldn't be running commands that will change the quantum whilst working on a song.

Post Reply