Skip to content

Instantly share code, notes, and snippets.

@cidkidnix
Last active December 3, 2023 00:34
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cidkidnix/86a01ecf82f54eec39f27a9807b90a1b to your computer and use it in GitHub Desktop.
Save cidkidnix/86a01ecf82f54eec39f27a9807b90a1b to your computer and use it in GitHub Desktop.
Pipewire is the replacement for JACK and PulseAudio, Pipewire allows low latency compared to any pulseaudio tweaks
Here is a short list of what you should do to get the lowest latency in Osu!
Higher audio rate equals less latency always, unless you increase your quantum
to calculate node latency for your audio device take the quantum size divided by your audio rate
so 64/96000 = 0.00066666666 * 1000 = 0.6ms this is 0.6ms node latency
To check client latency use pw-top, take the quantum size and the audio rate of the client then use quantum / audio rate * 1000
to get overall latency for the client
Osu! requires either the osu-wine patch or to set PULSE_LATENCY_MSEC
1. Set max min and default quantum to the lowest value your hardware can handle in /etc/pipewire/pipewire.conf
2. Set alsa-monitor.conf props to set it to the clock.rate in /etc/pipewire/pipewire.conf
3. Use pipewire's "Pro Audio" mode to skip the software mixer completely. Note that this might not work well on onboard audio
this is due to the fact that when pipewire uses this, it relies on the hardware mixer of the device. If you're hardware mixer
is subpar to bad at best then don't use this mode
@JustSimplyKyle
Copy link

JustSimplyKyle commented Jan 6, 2023

How to set "quantum size"?

@ipg0
Copy link

ipg0 commented Jun 2, 2023

How to set "quantum size"?

Not sure if relevant, but it's a field in the pipewire config (either /etc/pipewire/pipewire.conf or ~/.config/pipewire/pipewire.conf) called default.clock.[min-, max-]quantum.

Also, setting your buffer size (quantum) to the absolute minimum might result in a lot of crackling and other sound artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment