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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. faillog Command Examples in Linux
  2. autorandr: command not found
  3. pactree Command Examples in Linux
  4. konsole Command Examples in Linux
  5. How to enable NFS debug logging using rpcdebug
  6. How to Extend allowed number of loopback devices
  7. fwupdmgr Command Examples in Linux
  8. How to Check if any of the RPM files were tampered with
  9. homectl Command Examples in Linux
  10. How to Install dmg File on Mac from Command Line

You May Also Like

Primary Sidebar

Recent Posts

  • “aws s3” Command Examples
  • “aws s3 rm” Command Examples
  • “aws s3 presign” Command Examples
  • “aws s3 mv” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright