Make pipewire play bitperfect audio / Linux

If you are like me,

and have always wondered why PulseAudio had a fixed setting for sample rate,

but thought that that situation would improve when PipeWire got established,

and then learning that PipeWire STILL had a fixed sample rate?

So that everything was resampled to 48000, or whatever setting was the default?!

Fear no more.

THIS is how to make PipeWire always choose the best sample rate when playing audio. So that a 44100 Hz files will play with a 44100 sample rate, and a HiRes 96000 file will put the soundcard at 96000.

  1. open, or create, ~/.config/pipewire/pipewire.conf and put this in:
    context.properties = {
       default.clock.allowed-rates = [ 44100 48000 88200 96000 ]
    }

    if required, add extra sample rates that your files and/or your soundcard supports.
  2. That’s it! Maybe need to log out/in, or kill PipeWire, whichever you choose
  3. check the result with
    # pw-mon
    R   52   4096  96000  83,3us  16,5us  0,00  0,00    0    S32LE 2 96000 alsa_output.usb-Focusrite_Scarlett_2i2_USB-00.HiFi__hw_USB__sink
    R   72   7200  96000  41,0us  22,4us  0,00  0,00    0    F32LE 2 96000  + LibreWolf
  4. Both the hardware (Focusrite) and the program (LibreWolf) are playing audio at 96000.
  5. I found that in order for Qobuz (and probably other streaming services as well) to really play at native bit rate, LibreWolf will do the trick, NOT the ‘native’ linux flatpak client for Qobuz.
    So use the url: ‘https://play.qobuz.com/’

Leave a Reply

Your email address will not be published. Required fields are marked *