Skip to content

Instantly share code, notes, and snippets.

@hamletmun
Last active October 9, 2025 16:25
Show Gist options
  • Select an option

  • Save hamletmun/95acc8f280258c33b18f5c328e6bff75 to your computer and use it in GitHub Desktop.

Select an option

Save hamletmun/95acc8f280258c33b18f5c328e6bff75 to your computer and use it in GitHub Desktop.
Use PipeWire to link audio ports

PipeWire

Link applications

  1. List output and input ports, look for the application's name

    pw-link -o
    pw-link -i
    
  2. Start Share Screen on Google Chrome to create the input device, THEN link mpv output to Google Chrome input

    pw-link -L mpv:output_FL "Google Chrome input:input_FL"
    pw-link -L mpv:output_FR "Google Chrome input:input_FR"
    
  3. Repeat the above steps on each Start Share Screen, since the input device is removed by Stop Share Screen

Add VirtualMic

  1. Create a virtual microphone

    pw-cli create-node adapter '{ factory.name=support.null-audio-sink node.name="VirtualMic" node.description="Virtual Microphone" media.class=Audio/Source/Virtual audio.position=[FL FR] object.linger=true }'
    
  2. List output ports, look for the headset's monitor

    pw-link -o monitor
    
  3. Connect the monitor of the USB headset to the VirtualMic (What you hear will be injected to the virtual microphone)

    pw-link alsa_output.usb-Manufacturer_Model_0123456789ABCDEF0123456789ABCDEF-00.analog-stereo:monitor_FL VirtualMic:input_FL
    pw-link alsa_output.usb-Manufacturer_Model_0123456789ABCDEF0123456789ABCDEF-00.analog-stereo:monitor_FR VirtualMic:input_FR
    
  4. Choose the VirtualMic as your microphone in the application

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment