You are here

Inconsistent session sample rates

If I have jackd and Qjackctl running with session sample rate set to 44100Hz, and I then create a new Qtractor session, it also shows a session rate of 44100 as I would expect.

But if I save and then reload the Qtractor session, I get an error message saying that "The original session sample rate (44100Hz) is not the same as the current audio engine (48000Hz)."

I have tried starting Qjackctl, starting Jack from there, and starting Qtractor, in various sequences, and I can't detect any consistent behaviour. I don't change the session sample rate from 44100Hz in Qjackctl, yet I (sometimes) get this 48000Hz rate reported by Qtractor with the relevant error message.

Why might this be happening, and how can I solve the problem?

Forums: 
rncbc's picture

current sample rate should be always the one set in qjackctl, iif you're using it to start the genuine jackd(bus) server, so that it shows "Started" in qjackctl main display panel.

if you're with pipewire-jack then qjackctl shows "Active" and you have no control on the running sample-rate whatsoever; depending on the pipewire/wireplumber configuration, parts of the graph may run on disparate sample-rates, not always necessarily the one you once had showing before.

if that's the case, please review and edit your pipewire.conf, most specially jack.conf, and set a fixed sample-rate for all jack applications; on the same vein, buffer-size (or quantum in pw parlance), should also be maintained to a fixed amount in frames per period.

assuming that's your case, you may try to take steps to get away from pipewire's default dynamic behavior regarding sample-rates and buffer-sizes, like issuing the following on the command line (or a shell script):

pw-metadata -n settings 0 clock.force-rate 44100
pw-metadata -n settings 0 clock.force-quantum 1024

hth.
cheers

The information about "Started" and "Active" is very useful: I hadn't noticed these different indicators, but I can now make sure that I always start Qjackctl first and that it says "Started".

Are there any other problems with Pipewire? A few months ago I installed a recent version of Ubuntu-Unity on another computer and couldn't get any sound at all. Then I found (online) an item saying that Pipewire was not yet sufficiently developed to use with Jack etc.; it also gave instructions for removing Pipewire entirely. I followed these instructions (even though I don't usually use Jack, Qtractor etc. on that computer), and I got my sound back. Unfortunately I can no longer find this online item, so I don't know its date or its particular instructions.

Would you recommend removing Pipewire altogether, or have all or most of the problems been resolved?

rncbc's picture

no, I don't recommend to remove pipewire, at all!

pipewire is working here for more than a year now; it replaced pulseaudio entirely ever since and I personally have no regrets about that; besides, on my watch, I do have genuine jackd(bus) and pipewire-jack substitution all the time for work and fun; of course, when working with genuine jackd(bus) only jack-applications may use the designated sound device, all olhers desktop applications go silent; but when using pw-jack all jack-applications and all other desktop applications can co-exist and even get inter-connected as usual, via qjackctl or qpwgraph--in fact that's one real biggest advantage to pipewire on the Linux desktop.

pipewire-jack, the replacement/substitution for the jack-API has also been improving quite nicely and to my knowledge only a few quirks still remain especially regarding jack-transport/timebase reliability and under certain circumstances; imho. pipewire is pretty good enough nowadays for the general consumer desktop, trust me

as said, it still needs some polishing on the proaudio front, but overall it is ready (running v0.3.77 here).

hth.
cheers

Thank you for your advice about the reliability of pipewire.

Having tried your various suggestions about the sample rate problem, I still seemed to be getting some anomalous behaviour. I was running Ubuntu Studio 22.04, and discovered that in that release pipewire is only enabled for some functions. I decided to install Ubuntu Studio 23.04, in which pipewire is the default sound server, and everything now seems to work seamlessly. So perhaps Ubuntu Studio 22.04 is best avoided. The version of pipewire I now have is 0.3.65.

Thanks again for your help.

Add new comment