How to Create a PipeWire Audio Loopback
Practical steps for creating and testing a PipeWire loopback to route audio between an input device and an output device.
Before you start
A PipeWire loopback is a local audio route that connects a capture source to a playback sink on the same machine. It does not require a separate network service. You need a running PipeWire session, an input device that is recognized by PipeWire, an output device that can play the routed signal, and a terminal where pw-loopback can run.
First list the available audio nodes. Run pw-cli ls Node and look for the names of the capture and playback nodes. Many systems include a combined sink such as alsa_output with a monitor port, but check the actual node names shown on your machine instead of assuming a particular label. Keep the command open or save the node names before starting the loopback.
A useful preparation step is to set the input level before routing. If the source is a microphone, check it in the desktop audio settings or with wpctl status. Start with a moderate input level and adjust only after you can hear the loopback clearly. This helps separate level problems from routing problems.
Step-by-step instructions
Use the pw-loopback command for a temporary route. The basic form connects the default capture source to the default playback sink. To target specific devices, include their numeric IDs from wpctl status or the names shown by pw-cli.
Open a terminal and run the following command:
pw-loopback
To route a microphone to headphones or speakers, include the capture and playback target. The option style differs between PipeWire versions. On newer versions, use --capture-props and --playback-props:
pw-loopback --capture-props='{ node.target=INPUT_ID }' --playback-props='{ node.target=OUTPUT_ID }'
Replace INPUT_ID and OUTPUT_ID with the IDs from your wpctl status output. On older releases, the equivalent options may be --capture and --playback followed by the target ID. This is a version difference worth checking with pw-loopback --help.
Leave the command running while you test. It is a foreground process, so closing the terminal or stopping it with Ctrl+C removes the loopback. This makes the setup reversible: stop the command and the route disappears without changing stored device profiles.
If the audio is too quiet, raise the input level at the source first. If it is distorted, lower the input level before changing routing properties. Do not raise the output volume to compensate for a weak source; that also amplifies background noise.
Check the output
Play a short test sound from the source device. If the source is a microphone, speak into it. You should hear the sound through the target output with a small amount of latency. Stop the loopback after the check to avoid feedback when speakers and a microphone are in the same room.
The loopback carries the format supported by the source and sink. PipeWire may convert the sample rate or channel layout as needed, but it cannot improve a source that is already noisy or clipped. Quality and format limitations follow the devices and the session configuration, not the loopback itself.
A reliable verification is to compare the input monitor level while the source is active. If the level reacts and sound reaches the output, the route is working. Silence through the output means the route, target selection, or input level needs attention.
Common problems and next steps
If the loopback creates an echo, you are probably capturing an output monitor instead of the intended microphone. Choose the actual microphone node, not a monitor port, and reduce speaker volume near the microphone.
If there is no sound, confirm the source is not muted and the input level is above zero. Then check that the target ID belongs to an output device, not another capture node. Node IDs can change after reboot or device reconnection, so re-run wpctl status before retrying.
Persistent crackling or dropouts can indicate a sample rate mismatch between devices. Check the negotiated rate with pw-top or the node properties in pw-cli. A temporary test at a different rate can help confirm the cause, but change only one setting at a time.
If the command exits immediately, read the error text for the failed target or property. Starting with plain pw-loopback can confirm that the default source and sink are available before adding explicit IDs.