MIDI controller input and lantency compensation

I’ve been trying to use Ardour to control a multitimbral hardware synthesizer, and I’m struggling with the latency compensation ardour does with the midi output.

So as far as I understand when I route MIDI through ardour it will always add latency to the MIDI events so that the audio you hear is in sync with the MIDI events or something like that.

My issue is that I need low latency to be able to play my MIDI controller with a good experience.

My suggestion is that latency compensation should only be applied to MIDI events generated by ardour (playing back a MIDI track), or applied to the recorded region after recording them or something. Applying the compensation to the MIDI output while I’m trying to record something only makes the experience bad as I get additional latency from pressing a key to hearing what I play.

Does Ardour also do latency compensation with MIDI input? Thought that was only for audio input: The Ardour Manual - Latency and Latency-Compensation
Otherwise you could try the “Disable PDC” button: The Ardour Manual - Other Toolbar Items

Thanks for the link. I didn’t know about that button. I’ll try it out.

I guess the latency is added such that output midi events are synced with the latency of played out audio from the DAW. That makes sense I think, but for playing back a midi track, not for forwarding MIDI in to MIDI out.

Edit: Unfortunately my midi events are still delayed after toggling the “Disable PDC” button.

Edit 2: I found a way to work around it though, by disabling input monitoring on the track and route the MIDI input to the output directly outside of ardour. Even using midi connections settings in ardour to route input to output causes delay.

What sound system are you using ? ALSA has given me the best results with MIDI. I have read that pipewire has a latency issue.

I use pipewire. But I only have latency issues with ardour. I can route MIDI just fine otherwise without any latency that I can tell. I switched ardour to ALSA backend and still having latency issues if MIDI is routed by ardour. The reason I think it has to do with latency compensation is that the latency seems to be based on the buffer sample count. If I increase the audio buffer size in ardour, the MIDI events are delayed for longer.

I’m thinking that this is an issue people usually don’t have because most people use VST/LV2 instruments and not monitoring hardware synthesizers.

So you are using Ardour to playback MIDI into a hardware synth, and it will not sync the Ardour audio output with the MIDI playback on the external device ?

Does the audio of the MIDI device go back into Ardour, and out to speakers? Or straight to external mixer / speakers?

That may be a bug to report. Or could it be round trip latency ?

Maybe this? but I do see that you have found a workaround.

Hi. Thanks for the replies. Sorry if I’m not being clear what I’m trying to accomplish.

I’m not trying to sync audio, I’m trying to use my midi controller and hardware synth with Ardour without the daw adding latency when I “monitor” the MIDI input. I monitor the audio of the synth in hardware, so there is no audio involved for Ardour, only MIDI.

When I play my midi controller I want the midi events to be sent immediately to my output port. But I also want the ability to play back MIDI tracks to the same port, and being able to record MIDI to a region.

My workaround I disable input monitoring so that I don’t hear anything when I play on my keyboard, but recording works and playback of a track works. Then in order to hear what I play without additional delay, I route the MIDI input directly to the output with pipewire, outside ardour (as ardour adds additional latency).

I gave this a try on my setup. Akai MPK mini USB out to MIDI Hardware synth via MIDI track. USB Audio interface with MIDI out to the synth. There was no audibly detectable latency. I increased the buffers to max and there was still no latency that I could detect with my ears and keyboard. My headphones were plugged into the hardware synth. Here are a few pictures of the setup.

Note I was using the ALSA sequencer for the MIDI system. I have disabled pipewire on my system because of extreme issues in the past with pipewire. I don’t need it. It gets in the way. I also disable Pulse Audio because it too caused issues on occasion, but no nearly as much as pipewire!

On my system, I had excessive latency when using JACK2. Using JACK, everything is as good as using ALSA, but I rarely need to use JACK.

How exactly are you routing this in Ardour ?

image

1 Like

Thanks for looking into this. I appreciate it :slight_smile: My setup is basically the same as yours now, and I still get latency that scales with audio buffer size. Do you think that just having pipewire enabled could cause this even with alsa sequencer for MIDI? I’m using ardour 8.2 btw.

I have had so many strange issues with pipewire, I could easily see that being a cause.

Do not uninstall pipewire from your system. I did that on Ubuntu 22.04 LTS, and it removed Gnome for some awful reason!

On a debian system this will temporary disable until reboot or restarted:

systemctl --user stop pipewire.socket
systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.