Change Sample Rate of Pipewire

Typically, most Linux sound servers run at 48000 Hz by default. This is a sane choice as most digital audio is 48 kHz.
However, when I'm recording, I want Pipewire (and the Jack compatibility) to run at 96 kHz.
Similarly when playing music, you might want to switch to 41000 - though I don't think I can hear the difference in that caseā€¦

Anyhow, if you do want to change it before launching a DAW to 96 or reset to 48 afterwords, it's really simple:

pw-metadata -n settings 0 clock.force-rate 96000

You can also confirm this since QJackCtl should now show all JACK systems running 96 as well. To reset to 48 kHz, just replace the 96000 with 48000.

I'm pretty sure this is for buffer size as well - something useful if you want lower latency OR want to avoid buffer underruns.

pw-metadata -n settings 0 clock.force-quantum <size>

I haven't double checked if there's side effects of that one though. Use with caution.

Audiophiles Beware

Setting your sound card or audio interface to 96 kHz will not make you hear up to 48000 Hz. Human hearing only goes up to ~20000. There is no need for you to use higher sample rates like 192 kHz for fun unless you literally have CPU power to burn. When recording, it makes sense to use 96 kHz at 24 bit to give headroom for VST and LV2 effects, etc. For playback, it's not going to make your music sound better, and will probably waste CPU cycles for nothing. Of course, that is for the average user - and if you're about to comment below, no, you don't fit in that, since you probably do have a reason (I mean, I used to use 96k recording and playback as a cheap 48k oscilloscope and signal generator - until I blew the preamp on my motherboard that is. Do be careful about mic and line level inputs as well as low and high impedance outputs before you do this!)

  • scripts/media/change_pipewire_sample_rate.txt
  • Last modified: 2023-04-02 04:22
  • by Tony