Thanks Robin, that’s really helpful! I haven’t had time to look into all of your suggestions yet, but I did boot up avlinux on a USB key and got much improved, but still not great, latency on the internal sound card (~40 ms). I’m thinking this is probably an upper limit for my system, as avlinux seems to have every kernel tweak available.
To answer your followup questions, I’m running Pop_OS 19.10 (Ubuntu derivative), and the DSP load on Ardour is typically under 10-15%.
One thing I’m trying to understand is why my Scarlett 2i2, connected via USB2, has so much better latency than my internal sound card. For both cases, I gather these two steps have to be performed:
- The MIDI keystroke is received by ALSA via USB2
- The keystroke is sent from ALSA to Ardour, which converts it to a digital waveform
After this, for the Scarlett:
- The digital waveform is sent by Ardour to the Scarlett 2i2 via USB2
- Scarlett passes the digital data through a D/A converter
And for the internal sound card:
- The digital waveform is sent from Ardour to ALSA
- ALSA passes the digital data to the internal sound card
- The internal sound card passes it through a D/A converter
I’m just trying to figure out why data that never leaves the motherboard would be so much slower than the same data sent by USB - I would have expected just the opposite. But perhaps it’s as you suggested, an interrupt issue that’s not allowing the internal sound card to respond in a timely fashion. I will continue to research this.
Thanks again for your help!
Ken