Skip to content

Keeping Latency under control

lathoub edited this page Feb 13, 2021 · 5 revisions

To have latency visible in the MacOS MIDI Network Setup, make sure the TimestampRtpPackets is set to true in the AppleMIDI_Settings.h

https://github.com/lathoub/Arduino-AppleMIDI-Library/blob/bba15666b0e340c7a48adfbc61a4e898a28c23fd/src/AppleMIDI_Settings.h#L33-L35

Wi-Fi

This library will run on WIFI hardware (WIFI Shield or ESP32 Wifi), but when low latency is needed, go for wired Ethernet.

Latency in the MacOS MIDI Network Setup on an ESP32:

ESP32Wi-Fi

Ethernet

ESP32 & W5500

Wired Ethernet is better to reduce latency. Here is the same ESP32, but using an W5500:

ESP32W5500

The latency is very close to 0ms.

SAMD

SAMD21 has low latency using the W5500

samd21

ATMEGA

A slower ATMEGA2560 has a fixed latency around 3 ms.

atmega2560

(All above measurements done using the Ethernet3 library with an W5500 chip)