PulseAudio

On this page 6

PulseAudio is a sound server for Linux and other Unix-like systems that sits between applications and the kernel audio drivers, mixing several audio streams, routing them to the right device and giving each application its own volume. For more than a decade it was the default audio layer of the Linux desktop in Fedora, Ubuntu, openSUSE, Debian and most other distributions, and many applications still talk to it through its client protocol today.

The project started in 2004 under the name Polypaudio and was led by Lennart Poettering. It solved a long-standing problem: plain ALSA hardware often allowed only one program to play sound at a time, and switching output from speakers to a USB or Bluetooth headset required manual configuration. PulseAudio made such changes dynamic and per application.

How PulseAudio processes sound

PulseAudio runs as a per-user daemon that applications connect to through a client library, usually over a Unix socket. The daemon receives each stream, resamples and mixes them in software and writes the result to the hardware through ALSA, so the kernel driver sees only one client.

Its object model uses four core concepts. A sink is an output such as speakers, a source is an input such as a microphone, a sink input is a playback stream from an application and a source output is a recording stream. Routing audio means attaching streams to sinks or sources, which can happen while the stream is playing.

ObjectRepresentsExample
SinkOutput device or virtual outputLaptop speakers, HDMI port, null sink
SourceInput device or capture pointBuilt-in microphone, monitor of a sink
Sink inputPlayback stream from a clientA browser tab playing video
Source outputRecording stream to a clientA video call capturing the microphone
Card and profilePhysical device and its modeBluetooth headset in A2DP or HSP/HFP mode
ModuleLoadable unit of functionalitymodule-bluetooth-discover
Core PulseAudio objects

A notable design choice is timer-based scheduling, often called the glitch-free mode. Instead of relying on sound card interrupts, the daemon fills a large hardware buffer and wakes up on system timers, adapting latency to the workload. This saves power on laptops but makes latency variable, which matters for interactive audio.

Modules and configuration

Nearly every feature of PulseAudio is implemented as a loadable module, configured in default.pa or system.pa, while daemon-wide parameters live in daemon.conf and client behavior in client.conf. User copies in ~/.config/pulse/ override system files.

ModuleFunctionTypical purpose
module-udev-detectDetects sound cards through udevHot-plugging USB audio devices
module-bluetooth-discoverAdds Bluetooth audio devicesWireless headphones and speakers
module-combine-sinkPlays to several sinks at onceSpeakers and headphones together
module-null-sinkCreates a virtual outputCapturing application audio for streaming
module-loopbackCopies a source to a sinkMonitoring a microphone
module-echo-cancelRemoves speaker echo from the microphoneVoice calls without a headset
module-native-protocol-tcpAccepts remote clientsPlaying audio over a network
Commonly used modules

Day-to-day control uses pactl and pacmd on the command line and the pavucontrol mixer in the graphical session. Default sample settings are typically 16-bit, 44.1 kHz stereo, and the daemon resamples any stream that differs, which is why setting default-sample-rate and alternate-sample-rate correctly avoids needless resampling.

PulseAudio also offers network transparency. With the TCP protocol module and Zeroconf discovery, a client on one machine can play to a sink on another, and a monitor source exists for every sink, so any output can be recorded as if it were a microphone. These features made it popular for thin clients, remote desktops and screen recording long before similar functions appeared elsewhere.

PulseAudio compared with other Linux audio layers

PulseAudio is one of several layers in the Linux audio stack, and the choice between them depends on latency needs and the distribution’s age.

LayerRoleLatency profileMain audience
ALSAKernel drivers and low-level libraryVery low, but no mixing on many cardsDrivers and minimal systems
PulseAudioDesktop sound serverModerate and adaptiveGeneral desktop use
JACKReal-time professional audio serverVery low and fixedRecording studios and music production
PipeWireUnified audio and video graph serverLow, configurable per clientModern desktops and containers
Linux audio layers compared

The decisive development is PipeWire replacing the daemon. Fedora switched in 2021 and Ubuntu followed in 2022, using the pipewire-pulse compatibility server, which implements the PulseAudio protocol. Applications built against libpulse keep working unchanged, and tools such as pactl and pavucontrol still operate, so the PulseAudio API outlives the original server.

Typical problems and how to resolve them

Most PulseAudio issues come from routing, profiles or conflicting clients rather than from broken hardware. The table lists frequent symptoms on a Linux desktop.

SymptomLikely causeFix
No sound after plugging in headphonesStream still attached to the old sinkMove the stream in pavucontrol or set a new default
Poor Bluetooth sound in callsHeadset switched to HSP/HFP profileSelect A2DP when no microphone is needed
Crackling or dropoutsTimer scheduling under heavy loadSet tsched=0 or increase fragments
Device busy errors in an applicationProgram opens ALSA hardware directlyUse the pulse ALSA plugin as default
Settings ignored after editing filesUser configuration overrides system filesCheck ~/.config/pulse/ and restart the daemon
Common symptoms, causes and fixes
  • Flat volumes let an application raise the hardware volume, which surprises users and can be disabled with flat-volumes = no.
  • Running a system-wide instance is discouraged except on headless or embedded devices because of security and permission problems.
  • Professional recording needs JACK or PipeWire, since PulseAudio does not guarantee fixed low latency.

Put simply

PulseAudio is a traffic controller for sound on a Linux computer. Many programs want to play audio at once, such as a browser, a music player and a chat app, and PulseAudio mixes them together and sends the result to the speakers or headphones.

It also lets a person give each program its own volume and move sound to a new device, such as Bluetooth headphones, without restarting anything. Newer systems use PipeWire instead, but it still speaks the same language, so programs written for PulseAudio keep working.

In practice

A teacher records lessons on a Linux laptop and needs both her voice and the video sound in the recording. Recording the microphone alone misses the video audio, while recording the speakers picks up room noise.

Her colleague loads module-null-sink to create a virtual output, adds two module-loopback instances that feed the microphone and the video player into it, and points the recording program at the monitor source of the null sink. With pavucontrol the video is set to 60 percent so speech stays clear. The recording now contains both sources cleanly mixed, and the change persists after adding the lines to her personal default.pa.