Contents

Understanding Audio Workgroups

Learn how to optimize real-time rendering performance with the Audio Workgroups API.

Overview

The Audio Workgroups API is a new feature available in macOS 11, iOS 14.0, watchOS 7.0 and tvOS 14.0. An audio workgroup helps the OS optimize performance by providing additional information about active real-time threads, including auxiliary ones created by apps and Audio Unit plug-ins.

An audio workgroup is a collection of real-time threads that work together to produce audio by a common deadline while spanning multiple processes, including the audio server and client apps and plug-ins. The system uses the audio workgroups to observe CPU usage of real-time threads so that it can better balance the competing interests of power consumption and performance. Apps and plug-ins that create their own real-time threads for audio synthesis or signal processing should adopt this new API.

Learn About Audio Workgroups

The diagram below shows how Core Audio runs an I/O thread in the audio server as part of the audio device’s workgroup. The thread wakes up at regular intervals and calls its associated client app to retrieve its audio output. When the client finishes rendering its audio, the system writes it to the output hardware, and the I/O thread sleeps. If a client takes too long to produce audio, the thread misses its deadline, which results in an audio overload and an interruption in audio playback. The I/O thread is the primary thread of an audio device workgroup, and it informs the kernel of the beginning and end of each work cycle.

[Image]

For every audio server I/O thread, its associated app also has its own real-time render thread. The audio server wakes and waits for the app to produce its output on each I/O cycle. The system automatically joins the client app’s real-time thread to the audio device’s workgroup. By doing so, the system tells the kernel that both threads are working together with a common deadline and can better optimize performance.

If your app or Audio Unit plug-in creates and manages its own audio real-time threads, learn more about how to use the Audio Workgroup API in following articles:

See Also

Essentials