• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pw-loopback Command Examples in Linux

by Deepika

In PipeWire, loopback devices allow users to capture audio from one source and play it back on another source. This can be useful for a variety of applications, such as recording audio from an application and playing it back through speakers, or routing audio from one application to another.

The pw-loopback tool is used to create loopback devices in PipeWire. Loopback devices are virtual audio sources and sinks that allow audio to be captured and played back in real-time.

To create a loopback device using pw-loopback, users need to specify the source and sink ports using their port IDs. Port IDs can be obtained using the pw-cli tool or other PipeWire tools. Once the source and sink ports are specified, users can use pw-loopback to create a loopback device between them.

pw-loopback Command Examples

1. Create a loopback device with the default loopback behavior:

# pw-loopback

2. Create a loopback device that automatically connects to the speakers:

# pw-loopback -m '{{[FL FR]}}' --captureprops='{{media.class=Audio/Sink}}'

3. Create a loopback device that automatically connects to the microphone:

# pw-loopback -m '{{[FL FR]}}' --playbackprops='{{media.class=Audio/Source}}'

4. Create a dummy loopback device that doesn’t automatically connect to anything:

# pw-loopback -m '{{[FL FR]}}' --captureprops='{{media.class=Audio/Sink}}' --playbackprops='{{media.class=Audio/Source}}'

5. Create a loopback device that automatically connects to the speakers and swaps the left and right channels between the sink and source:

# pw-loopback --capture-props='{{media.class=Audio/Sink audio.position=[FL FR]}}' --playbackprops='{{audio.position=[FR FL]}}'

6. Create a loopback device that automatically connects to the microphone and swaps the left and right channels between the sink and source:

# pw-loopback --capture-props='{{audio.position=[FR FL]}}' --
playback-props='{{media.class=Audio/Source audio.position=[FLFR]}}'

Summary

Overall, pw-loopback is a powerful tool for creating loopback devices in PipeWire, allowing users to capture and play back audio in real-time. More information about virtual devices and how to use them can be found in the PipeWire documentation.

Filed Under: Linux

Some more articles you might also be interested in …

  1. uvcdynctrl: command not found
  2. udisksctl: command not found
  3. needrestart Command Examples in Linux
  4. dolphin: command not found
  5. rtcwake Command Examples in Linux
  6. doctl balance: Show the balance of a Digital Ocean account
  7. edquota: command not found
  8. dbus-daemon Command Examples in Linux
  9. dotnet ef: Perform design-time development tasks for Entity Framework Core
  10. base64 Command Examples (Encode or decode file or standard input to/from Base64, to standard output)

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright