Everything you ever needed to know about latency
This lecture provides a comprehensive introduction to latency: what it is, where it comes from, and what you can do about it. It includes two approaches to measuring latency, the first using a bench-top oscilloscope and function generator, and the second an automatic latency tester running on Bela.
Table of contents
- What you’ll learn in this lecture
- What you’ll make in this lecture
- Code examples
- Recommended parts
- Further reading
Lecture 10: Latency
What you’ll learn in this lecture
- What latency is, and why it matters
- Sources of latency
- How to measure latency
What you’ll make in this lecture
- An automatic latency tester
latency-tester: Project which sends a regular pulse to the audio output and measures how long it takes to return, providing an estimate of the latency of Bela and any external audio device.
Running the examples in this course assumes that you have a Bela Starter Kit or Bela Mini Starter Kit. Note that the analog outputs are only available on the original Bela board, and not on Bela Mini.
This lecture also presents a demo with an oscilloscope and a function generator. You don’t need to have these to follow along with the example, but if you do, you can repeat the test for yourself.
To use the automatic latency tester project, you will need a loopback cable: either a 3.5mm stereo audio cable or socket wires to connect between Bela’s audio input and audio output.
Here are further papers on latency in digital audio and interactive systems:
- A. McPherson, R. Jack and G. Moro. Action-sound latency: are our tools fast enough? Proceedings of the International Conference on New Interfaces for Musical Expression, 2016.
- R. Jack, T. Stockman and A. McPherson. Action-sound Latency and the Perceived Quality of Digital Musical Instruments: Comparing Professional Percussionists and Amateur Musicians. Music Perception. Vol. 36, Issue 1, 2018.
- D. Wessel and M. Wright. Problems and prospects for intimate musical control of computers. Computer Music Journal, Vol. 26, Issue 3, 2002.