Hello dear community,
I recently have got a new audio interface with a microphone and want to start to record some tracks. I have tried to do so in Audacity first but when I saw Ardour in a video, I thought this could be a much better solution. Until… Well I have tried to set up Ardour for days now. I tried JACK, ALSA, pipewire. Independent of this choice, it still segfaults sometimes, doesn’t play sound, etc. Lots and lots of trouble. Most of it I could solve by now. But not the latency compensation. It seems to do whatever it wants. Later more about that.
My setup: I am running an up-to-date Arch linux (6.1.4-arch1-1) with an AMD Ryzen 7 1700 CPU, having an onboard sound card (Mainboard Asus Prime X370-PRO) and a Focusrite Scarlett 4i4 audio interface. I currently use the 4i4 for recording, my mic is connected to it, and the on-board sound card via optical wires to my amplifier for output to some loudspeakers. I read, that it might be a bad idea, to use two different sound cards and on-board sound cards in general, but the 4i4 doesn’t have optical output. My headphones will arrive soon, there is currently a delay, so I am stuck with the speakers for now. I am fine with it in general - and so is Audacity (with pipewire), after manually setting up latency compensation. So I can get a pretty fixed latency that can be corrected for in other tools.
Also, I installed the realtime package, added my user account to the “audio” and “realtime” group. And I set the CPU governor to performance, disabled multithreading, did not run any other software during my tests. Not using the realtime kernel.
So, now to my experimentation with ardour (Ardour 7.2.0) and the latency problems: I tried ALSA directly, JACK and pipewire. I recorded the metronome clicks and compared the start of the peaks of the recordings to the bars. With JACK2 only, I couldn’t really get rid of xruns, even with big buffer sizes (1024, 2048). I didn’t bother too much, because I wanted to try pipewire anyways. The first few tries were, if I remember correctly, spot-on. But because of the xruns, I decided to switch to PW. With PW, I got rid of kind of all xruns, even with a much smaller buffer size (down to 128)! Impressive. But then there are constant delays or latencies. I tried to fiddle with the PW configs, including ~/.config/pipewire/jack.conf. I locked quantums, specified the quantum to, for testing purposes, 512/48000. I also tried to set node.latency there, to no avail.
I couldn’t find a solution to this for days, so I decided to try the alternatives (again…): ALSA and JACK2. Both of these show a strange similar behavior at the moment. The first recording of the metronome is still delayed, like not (enough) compensated. But if I record multiple tracks after one another, the delay becomes smaller and smaller. At some point, the latency is “corrected” perfectly but… It continues to get smaller and smaller with time, so it ends up being over compensated, the record was BEFORE the bar after that. It’s the same with both, ALSA and JACK. So, after not even getting it to a constant offset, I decided to switch back to pipewire (which seems to be a nicer way of dealing with sound nowadays anyways).
I would be happy to be able to just record with proper latency compensation, also if I had to use ALSA or JACK, but preferably pipewire. Because Audacity has no issues at all, after manually setting up the latency correction, I am wondering - how can I configure this in Ardour? Or should I setup the configuration in pipewire(-jack) to be heeded by Ardour? It really seems to be an Ardour issue, but is it? Or should I check with the pipewire folks (too)?
Thanks in advance, if you need more details, please let me know. I am new to this audio world, but not new to Linux I can also provide logs, configs, or whatever is necessary.