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).
Create the devices
Section titled “Create the devices”pactl load-module module-null-sink sink_name=VirtualSink sink_properties=device.description=VirtualSinkpactl load-module module-remap-source master=VirtualSink.monitor source_name=VirtualMic source_properties=device.description=VirtualMicpactl load-module module-loopback source=VirtualSink.monitor sink=@DEFAULT_SINK@ latency_msec=1Then pick VirtualSink as the output of the app (e.g. in pavucontrol), and VirtualMic as the microphone of the
receiving app.
Remove the devices
Section titled “Remove the devices”load-module prints the ID of the new module. Unload with that ID, or look it up:
pactl list short modules | grep -E 'null-sink|remap-source|loopback'pactl unload-module <module_id>pactl unload-module module-loopback