LinuxCommandLibrary

pactl

TLDR

List all audio sinks (output devices)

$ pactl list sinks short
copy
Set the default audio output
$ pactl set-default-sink [sink_name]
copy
Set volume to a percentage
$ pactl set-sink-volume @DEFAULT_SINK@ [50%]
copy
Increase volume by 10%
$ pactl set-sink-volume @DEFAULT_SINK@ +[10%]
copy
Mute/unmute the default sink
$ pactl set-sink-mute @DEFAULT_SINK@ toggle
copy
List all audio sources (input devices)
$ pactl list sources short
copy
Move an application to a different output
$ pactl move-sink-input [stream_index] [sink_name]
copy
Load a PulseAudio module
$ pactl load-module [module-null-sink]
copy

SYNOPSIS

pactl [options] command [args]
pactl set-sink-volume SINK VOLUME
pactl list [short] [TYPE]

DESCRIPTION

pactl controls a running PulseAudio sound server from the command line. It provides a scriptable interface for managing audio devices, streams, volumes, and modules.
Volume can be specified as percentages (50%), decibels (0dB), or absolute values. Prefix with + or - for relative adjustments. Special names @DEFAULT_SINK@, @DEFAULT_SOURCE@, and @DEFAULT_MONITOR@ refer to default devices.
The list command shows detailed information about audio objects. Use short for condensed output suitable for scripting. Stream indices from list sink-inputs can be used to move applications between outputs with move-sink-input.

PARAMETERS

-s SERVER, --server SERVER

Connect to specified PulseAudio server
-n NAME, --client-name NAME
Client name for connection
-f FORMAT, --format FORMAT
Output format (text or json)
-v, --verbose
Enable verbose output
--version
Show version information
-h, --help
Show help message

COMMANDS

stat

Show memory usage statistics
info
Display server information
list [short] [TYPE]
List objects (modules, sinks, sources, sink-inputs, source-outputs, clients, samples, cards)
exit
Terminate PulseAudio server
set-default-sink NAME|INDEX
Set default audio output
set-default-source NAME|INDEX
Set default audio input
set-sink-volume SINK VOLUME
Set sink volume (percentage, dB, or absolute)
set-source-volume SOURCE VOLUME
Set source volume
set-sink-mute SINK 0|1|toggle
Mute/unmute sink
set-source-mute SOURCE 0|1|toggle
Mute/unmute source
move-sink-input INDEX SINK
Move playback stream to different sink
move-source-output INDEX SOURCE
Move recording stream to different source
load-module NAME [ARGS]
Load a PulseAudio module
unload-module INDEX|NAME
Unload a module
set-card-profile CARD PROFILE
Change sound card profile
subscribe
Listen for PulseAudio events

CAVEATS

Requires a running PulseAudio daemon. On systems using PipeWire with PulseAudio compatibility, pactl commands work but interact with PipeWire instead. The pacmd command is deprecated in favor of pactl. Volume values above 100% are allowed but may cause distortion.

HISTORY

pactl is part of PulseAudio, a sound server for Linux and other Unix-like systems created by Lennart Poettering. PulseAudio was first released in 2004 and became the default sound system in most Linux distributions by 2009. The pactl utility provides command-line access to PulseAudio's D-Bus interface. In recent years, PipeWire has begun replacing PulseAudio while maintaining compatibility with pactl commands.

SEE ALSO

Copied to clipboard