Core Audio is the digital audio infrastructure of macOS: a layered set of frameworks, a system daemon and a driver model that move sound between applications and hardware with low, predictable latency. Every beep, music player, video call and professional recording session on a Mac passes through it, which makes Core Audio one of the quieter but most important parts of macOS fundamentals.
Unlike older designs that relied on separate mixing layers, Core Audio was built into Mac OS X from the start, with floating-point processing, multichannel support and sample-accurate timing as native features. It sits above the Darwin kernel and XNU drivers and below user-facing tools such as Audio MIDI Setup and the sound controls in Control Center.
How Core Audio moves sound through the system
Core Audio works as a pipeline of buffers driven by the hardware clock. An audio device, such as built-in speakers or a USB interface, requests a new block of samples at a fixed interval, and Core Audio calls each client through a real-time I/O callback to fill or read that block before the deadline passes.
The central broker is the Hardware Abstraction Layer (HAL), which runs inside the coreaudiod daemon launched by launchd. The HAL presents every device through one uniform model of devices, streams and properties, so an application can query sample rate, channel count or volume without knowing whether the device is a Bluetooth headset or a Thunderbolt interface.
Internally, samples travel as 32-bit floating-point linear PCM, which gives generous headroom and avoids clipping during mixing. Conversion to the integer formats that hardware expects happens at the edge of the pipeline, ideally only once.
The following table shows the main stages a sound passes through on its way to the speakers.
| Stage | Component | What happens |
|---|---|---|
| Generation | Application or audio unit | Samples are produced or decoded |
| Processing | Audio units and AVAudioEngine | Effects, mixing and format conversion |
| Brokering | HAL in coreaudiod | Clients are scheduled against the device clock |
| Driver transfer | Audio Server plug-in or kernel driver | Buffers are copied to device memory |
| Playback | Hardware codec or DAC | Digital samples become an analog signal |
Frameworks and layers in the Core Audio stack
Core Audio is not a single API but a family of frameworks at different levels of abstraction. Developers choose the highest level that meets their timing needs, because lower levels offer more control at the cost of considerably more code and stricter real-time rules.
| Framework or service | Level | Typical use |
|---|---|---|
| AVFoundation and AVAudioEngine | High | Playback, recording and effect graphs |
| Audio Toolbox | Middle | Audio queues, file and format services |
| Audio Units (AUv2, AUv3) | Middle | Plug-in instruments and effects |
| Core MIDI | Middle | MIDI devices, networks and timing |
| Core Audio HAL API | Low | Direct device access and properties |
| AudioDriverKit and Audio Server plug-ins | Driver | Custom or virtual audio devices |
Audio Units deserve special mention: they are the native plug-in format of macOS, used by digital audio workstations for synthesizers and effects. The newer AUv3 model packages a plug-in as an app extension, which runs it in a separate, sandboxed process for better stability and security.
Latency, buffer size and sample rate
Latency in Core Audio is mainly determined by the I/O buffer size divided by the sample rate, plus fixed converter and driver delays. A smaller buffer reduces delay but gives the processor less time per cycle, which raises the risk of dropouts, clicks and glitches when the workload is heavy.
The table below gives approximate buffer durations at 48 kHz, excluding hardware safety offsets, which usually add one to a few milliseconds depending on the device.
| Buffer size | Approximate delay | Typical use |
|---|---|---|
| 32 frames | About 0.7 ms | Live monitoring on capable hardware |
| 128 frames | About 2.7 ms | Recording with software instruments |
| 512 frames | About 10.7 ms | Default playback and general use |
| 1024 frames | About 21.3 ms | Mixing large sessions with many plug-ins |
Core Audio also handles sample rate conversion when an application and a device disagree, for example a 44.1 kHz song played through a 48 kHz output. The converter quality is high, but matching rates avoids extra processing and is preferred in professional work.
Aggregate devices, multi-output devices and routing
Core Audio can combine several physical devices into one virtual device, configured in the Audio MIDI Setup utility. This lets a recording app see the inputs of two interfaces as a single device, or lets the system send identical sound to speakers and headphones at once.
| Device type | What it does | Main caveat |
|---|---|---|
| Aggregate device | Merges inputs and outputs of several devices | Needs a clock source and drift correction |
| Multi-output device | Plays one stream to several outputs | Volume control is often unavailable |
| Virtual loopback device | Routes audio from one app to another | Requires a third-party Audio Server plug-in |
Because independent devices run on separate clocks that drift apart slowly, an aggregate device designates one clock source and applies drift correction to the others. Without it, buffers slowly overflow or underrun, producing periodic clicks over long sessions.
Common problems and how to diagnose them
Most Core Audio faults come from real-time deadline misses, misconfigured devices or a stuck daemon rather than from defects in the frameworks themselves. A structured approach usually finds the cause quickly.
- Crackling under load: increase the buffer size, freeze plug-in tracks or close heavy background apps.
- No sound or a missing device: restarting the
coreaudiodprocess from Terminal forces the HAL to rebuild its device list. - Wrong pitch or speed: check that the sample rate in Audio MIDI Setup matches the session rate.
- Bluetooth quality drops during calls: opening the microphone can switch a headset to a low-bandwidth profile.
- Plug-in crashes in a host: AUv3 isolation and validation with the
auvaltool help locate the faulty component.
A frequent developer mistake is allocating memory, taking locks or logging inside the render callback. These operations can block for an unpredictable time, so the real-time thread misses its deadline and the listener hears a glitch.
Explained without jargon
Core Audio is the sound system built into every Mac. Think of it as a busy traffic controller for audio. Apps hand it the sounds they want to play, and it decides how to mix them and which speaker or headphone should receive them.
It works on a strict timetable. Every few milliseconds, the speakers ask for the next small slice of sound, and Core Audio makes sure it arrives on time. When everything keeps up, playback is smooth. When the computer is too busy to deliver a slice in time, you hear a click or a short gap. The key idea is reliable timing, and that reliability is why many musicians choose the Mac.
A typical use case
A podcast producer records a two-person interview in a small home studio. Each host has a microphone connected to a separate USB interface, so the producer opens Audio MIDI Setup and creates an aggregate device that combines both interfaces, choosing the first one as the clock source and enabling drift correction for the second.
In the recording app, the producer selects the aggregate device, sets the sample rate to 48 kHz and the buffer to 128 frames so the hosts hear themselves in their headphones without a distracting echo. During editing, when many noise-reduction plug-ins are active, the producer raises the buffer to 1024 frames. The result is a clean, synchronized two-track recording with no clicks, captured without any dedicated mixing hardware.