pw-reserve
Reserve audio or video device nodes
TLDR
Reserve a device (currently only supports audio devices)
Monitor a device instead of reserving it
Display help
SYNOPSIS
pw-reserve <command> [options]
PARAMETERS
reserve
Attempts to acquire an exclusive reservation for the specified PipeWire audio device.
release
Releases an existing exclusive reservation for the specified PipeWire audio device, making it available to other applications.
status
Checks and displays the current reservation status of the specified PipeWire audio device.
help
Displays the usage information and exits.
-n <id>, --node-id=<id>
Specifies the PipeWire node ID of the audio device to operate on. This is a mandatory parameter for reserve, release, and status commands.
-v, --verbose
Enables verbose output, providing more detailed information about the command's execution and status.
-h, --help
Displays a brief help message and exits.
DESCRIPTION
pw-reserve is a utility within the PipeWire multimedia framework designed for managing exclusive access to audio devices. Its primary function is to allow a user or application to reserve a specific audio hardware node, ensuring that no other PipeWire client can utilize it concurrently. This is particularly crucial for scenarios where a device does not support simultaneous multi-application access, or for applications that require exclusive control for optimal performance, stability, or low-latency operations, such as professional audio software or media playback systems.
When a device is reserved, other PipeWire clients attempting to use it will typically fail to acquire access or will be paused until the reservation is explicitly released. The command provides functionalities to reserve a device, release an existing reservation, or status the current reservation state of a device. It interacts directly with the PipeWire session manager to establish or revoke exclusive control over a specified node ID, which represents an audio device within the PipeWire graph. This mechanism is vital for preventing resource conflicts and ensuring predictable audio behavior across various applications.
CAVEATS
- PipeWire Requirement: pw-reserve requires a running PipeWire daemon and session manager to function correctly.
- Node ID Discovery: Users must first identify the correct PipeWire node ID for their desired audio device, typically using tools like pw-cli dump Node or pw-top.
- Hardware Support: Not all audio hardware or drivers might fully support exclusive access management through PipeWire in the same way, though PipeWire aims to abstract this.
- Process Lifetime: Reservations are usually tied to the lifetime of the pw-reserve process. If the process exits without an explicit release, the reservation might be automatically released, but it's best practice to always explicitly release devices.
- Potential Inaccessibility: Misusing the command can render an audio device temporarily inaccessible to other applications or system sounds, potentially leading to a 'no sound' situation until the reservation is released.
FINDING THE NODE ID
To effectively use pw-reserve, you must first determine the specific node ID of the audio device you intend to manage. This can be achieved by running pw-cli dump Node, which lists all active PipeWire nodes (including audio sinks and sources representing your hardware), or by using pw-top for a live, interactive view. Look for nodes associated with your desired input or output device (e.g., sound card, USB microphone) and note their unique ID number.
TYPICAL USE CASES
This command is particularly valuable in scenarios such as:
- Professional Audio Production: Ensuring a Digital Audio Workstation (DAW) has uncontested access to an audio interface for low-latency recording and playback.
- Gaming: Dedicated control over audio output to prevent interference from background applications.
- Media Centers: Providing exclusive sound output for a movie or music player for an uninterrupted experience.
- Voice Chat/Conferencing: Guaranteeing a microphone or speaker is not inadvertently used or blocked by another application.
HISTORY
pw-reserve is a relatively modern utility, having been developed as an integral part of the PipeWire project. PipeWire itself emerged around 2017-2018 with the goal of unifying and modernizing audio, video, and hardware handling on Linux, serving as a successor to systems like PulseAudio and JACK. The need for `pw-reserve` arose from common challenges in traditional Linux audio stacks, particularly the management of exclusive access to hardware devices to prevent conflicts between applications. Its inclusion underscores PipeWire's commitment to providing robust and flexible resource management capabilities essential for professional audio workloads and a seamless user experience.