Latency

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

  1. What you’ll learn in this lecture
  2. What you’ll make in this lecture
  3. Code examples
  4. Recommended parts
  5. 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

Code examples

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.

Further reading

Here are further papers on latency in digital audio and interactive systems: