pw-cli
Interact with PipeWire multimedia server
TLDR
Print information of all object of a specific type
Print information about an object with a specific ID
Print all objects' information
Monitor for object changes
Display help
SYNOPSIS
pw-cli [OPTIONS] [COMMAND] [ARGUMENTS]
Common OPTIONS:
-h
, --help
-v
, --version
-r NAME
, --remote=NAME
Common COMMANDS:
info
nodes
links
connect
disconnect
PARAMETERS
-h, --help
Display help message and exit.
-v, --version
Show version information and exit.
-r, --remote=NAME
Connect to a specific PipeWire remote daemon instance by name.
-l, --list
List information in a compact format without detailed properties.
-c, --command=COMMAND
Execute a single command and exit, without entering interactive mode.
-m, --monitor
Monitor and print events from the PipeWire daemon in real-time.
-P, --playback
Start an interactive playback shell (legacy mode for specific tests).
-V, --record
Start an interactive record shell (legacy mode for specific tests).
help [COMMAND]
Display help for pw-cli or a specific command (e.g., help nodes
).
quit
Exit the pw-cli interactive shell.
info [ID]
Display detailed information about all PipeWire objects or a specific object by its numeric ID.
nodes
List all active PipeWire nodes (processing units).
links
List all active PipeWire links (connections between ports).
devices
List all PipeWire devices (hardware abstractions).
clients
List all connected PipeWire clients (applications).
ports
List all active PipeWire ports (connection points on nodes).
connect ID_OUT ID_IN
Connect an output port (ID_OUT) to an input port (ID_IN).
disconnect ID_LINK
Disconnect a specific PipeWire link by its ID.
create-node NAME
Create a new PipeWire test node (e.g., test-sink
, test-source
).
enum-params ID [PARAM]
Enumerate parameters of an object by its ID, optionally filtering by parameter name.
set-param ID PARAM_DATA
Set parameters for an object by ID using a JSON string or key=value properties string.
parse-info TEXT
Parse PipeWire info data from TEXT (primarily for scripting and internal use).
log-level LEVEL
Set the PipeWire daemon's log level (0-3 for error, info, debug, trace messages).
load-module NAME [ARGUMENTS]
Load a PipeWire module (e.g., libpipewire-module-loopback
) with optional arguments.
unload-module ID
Unload a PipeWire module by its numeric ID.
DESCRIPTION
pw-cli is a versatile command-line tool designed for inspecting and managing the PipeWire multimedia server. It allows users to gain deep insights into the PipeWire graph, including active nodes, links, devices, clients, and ports. This tool is invaluable for debugging PipeWire setups, understanding how audio and video streams flow, and for advanced configuration and control. It can be used to manually connect and disconnect graph objects, load or unload modules, and query detailed properties of any PipeWire object. While primarily a diagnostic and administrative utility for developers and power users, pw-cli also serves as a scripting interface for automating PipeWire interactions.
CAVEATS
Requires the PipeWire daemon to be running for full functionality.
The output can be very verbose, especially for complex graphs, necessitating piping to `grep` or `less`.
Understanding PipeWire's graph model (nodes, ports, links) is essential for effective use.
pw-cli is primarily a power-user and developer tool; casual users might find simpler graphical frontends like `qpwgraph` more suitable.
INTERACTIVE VS. NON-INTERACTIVE MODE
pw-cli
can be used in two main modes:
1. Interactive shell: Running pw-cli
without arguments drops you into an interactive prompt where you can execute multiple commands sequentially.
2. Non-interactive (one-shot): Using the -c
or --command
option executes a single command and immediately exits, which is useful for scripting and automation.
PIPEWIRE OBJECT TYPES
pw-cli
interacts with various PipeWire object types, each identified by a unique numeric ID:
Nodes: Represent processing units, such as applications (e.g., Firefox, MPV) or hardware devices (e.g., sound cards, webcams).
Ports: Connection points on nodes, categorized as input or output, which allow data to flow between nodes.
Links: Direct connections established between an output port and an input port.
Devices: Abstract representations of physical or virtual hardware components controlled by PipeWire.
Clients: Applications or services connected to the PipeWire daemon that interact with the graph.
Each object has properties and parameters that can be queried and sometimes modified using commands like info
, enum-params
, and set-param
.
HISTORY
pw-cli
is an integral part of the PipeWire project, which emerged as a modern multimedia framework for Linux, aiming to supersede and unify functionalities previously handled by PulseAudio (for audio) and JACK (for professional audio), as well as provide robust video stream management. PipeWire was initially developed by Wim Taymans at Red Hat, with its first stable release in 2020. pw-cli
was designed from the outset as the primary command-line interface for direct interaction with the PipeWire daemon, essential for debugging, scripting, and advanced system administration tasks related to multimedia.