PipeWire: Hardware latency compensation?
Moderators: MattKingUSA, khz
PipeWire: Hardware latency compensation?
I gave Pipewire a shot and I am really impressed so far, will certainly switch my production system soon. One thing I could not bring over from JACK however is to account for extra-latency coming from hardware. Jack provided the option to pass down extra latency to Ardour, I could not find a way to do that in Pipewire. So when I record the click, the recording is late by a constant 11ms, no matter what I set as buffersize.
Ardour tells me the audio latency is 42.7ms, I/O latency is reported as 53.67ms, the difference being a suspicious 11ms. So it seems Ardour actually knows about it...
Any ideas how I can align those recordings?
-
- Established Member
- Posts: 2325
- Joined: Sat Jun 21, 2014 8:37 pm
- Been thanked: 256 times
Re: PipeWire: Hardware latency compensation?
There is lots of info available, and common settings to configure. My out-of-the-box zero-config latency with AVLinux, based on debian MX Linux, is under 6 ms. It's an i7 3.4 ghz quadcore cpu, with mAudio pci soundcard, and an old pcie 9400 GT nVidia video card. If you're an Arch user, there is an excellent guide topic at the linux Reaper forum, aimed at Manjaro Arch spinoff, but with lots of info applying to linux audio in general:
https://forum.cockos.com/showthread.php?t=255313
Re: PipeWire: Hardware latency compensation?
5ms unhandled latency might not seem much, but it escalates quickly with many tracks...
P.S.: I'm totally fine with ~50ms latency now and then, either for mixing, or as long as its compensated for and I'm recording and using hardware monitoring
-
- Established Member
- Posts: 27
- Joined: Wed Apr 05, 2023 9:11 am
- Has thanked: 12 times
- Been thanked: 9 times
Re: PipeWire: Hardware latency compensation?
This an old topic but I was recently trying to find out myself so I'll post here, as information seems to be scattered all around and is sometimes confusing or outdated.
Latency compensation is perfectly possible in pipewire and it can be done globally through wireplumber ~/.config/wireplumber/main.lua.d/50-alsa-config.lua file as described here: https://pipewire.pages.freedesktop.org/ ... properties
It's also possible to put that setting in particular interface config.
My entry looks like this:
["latency.internal.rate"] = 120,
and it's important to add that coma at the end, as default config file had that omitted for some reason, otherwise wireplumber won't start. Maybe it's my system only, but I also had to do a reboot as restarting pipewire and wireplumber wouldn't register the change. (Although, pw-cli s <ID> ProcessLatency '{ rate = 120 }' works immediately and it's best for testing or quick adjustment).
Latency can also be set in nano seconds as explained in the above article.
Setting can be verified with:
pw-cli e <ID> ProcessLatency
Different DAWs deal with latency compensation differently so it's important to find value that works well in the DAW used. Reaper allows offsetting latency in options > preferences > recording so it not necessary to set it with latency.internal.rate at all. Different story with Ardour. It has a nice tool to set latency for Alsa back-end but not for jack or pipewire. It's where jack's -I/-O switches and pipewire's latency.internal.rate come in handy.