Skip to content

Theme color

Virtual Audio Devices

A null sink is an output device that plays into nothing. Every sink has a .monitor source that records what is played into it, so a null sink can collect audio from apps and pass it on, for example to a call or a recording.

flowchart LR
  app[Music app] --> sink[VirtualSink]
  sink -.->|monitor| mic[VirtualMic]
  sink -.->|monitor| loop[loopback] --> speakers[Speakers]
  mic --> call[Call / OBS]

The commands use pactl, which works on PulseAudio and on PipeWire (through pipewire-pulse).

Virtual output
pactl load-module module-null-sink sink_name=VirtualSink sink_properties=device.description=VirtualSink
Virtual microphone fed by VirtualSink
pactl load-module module-remap-source master=VirtualSink.monitor source_name=VirtualMic source_properties=device.description=VirtualMic
Also hear what is played into VirtualSink
pactl load-module module-loopback source=VirtualSink.monitor sink=@DEFAULT_SINK@ latency_msec=1

Then pick VirtualSink as the output of the app (e.g. in pavucontrol), and VirtualMic as the microphone of the receiving app.

load-module prints the ID of the new module. Unload with that ID, or look it up:

Terminal window
pactl list short modules | grep -E 'null-sink|remap-source|loopback'
pactl unload-module <module_id>
Remove all modules of one type
pactl unload-module module-loopback