Close

Log #18: puredata latency

A project log for lalelu_drums

Gesture controlled percussion based on markerless human-pose estimation with an AI network from a live video.

lars-friedrichLars Friedrich 04/11/2025 at 19:301 Comment

In the last log entry, I presented a measurement of the latency of the system for the case of MIDI output and sound generation with a standalone MIDI sound generator device. Since the flexibility and lower cost of a programmable sound generation based on puredata is desirable, I repeated the measurement for this scenario.

The setup is basically the same, but the backend is now outputting open sound control (OSC) messages via ethernet instead of MIDI messages via serial port. The OSC messages are received by a puredata instance running on a raspberry pi 4. A Mackie Onyx Artist 1.2 device is used for sound output.

The puredata patch and the audio settings are shown in the following screenshot. With this audio output device, it was possible to set the 'Delay' to 3ms without disturbances.

The course of the measurement is shown in the following video. The mean latency is 30ms.

I also ran the experiment with the raspberry pi onboard audio output device. In this case, I needed to set the 'Delay' parameter to 23ms to avoid disturbances in the audio output. The mean latency was 54ms for this setting.

I found this page on audio latency for various audio devices. It lists 10.3ms for the Onyx Artist and minimum value of 3.1ms for a HifiBerry based system. So I expect that I could further reduce the latency by switching to a HifiBerry.

Discussions

Lars Friedrich wrote 04/20/2025 at 19:15 point

I happened to get a presonus AudioBox iTwo in my hand and I repeated the puredata latency test with this device instead of the Mackie Onyx Artist 1.2. The result has no significance difference from the measurement with the Onyx Artist:

min: 23ms

max: 37ms

mean: 30ms

std: 3.2ms

number of measurements: 165

  Are you sure? yes | no