How to Create a PulseAudio Virtual Sink
Practical steps to create a PulseAudio virtual sink for routing camera, microphone, call and media audio, plus ways to verify and undo it.
Before you start
A virtual sink is useful when you want an application to play into a named audio target that you can also route elsewhere, such as into a recording tool or a call. The commands below run locally on the machine where PulseAudio is managing the speakers and applications. PulseAudio typically handles this with the null-sink module, so there is no separate network service to configure.
You will need a terminal on the Linux system that owns the PulseAudio session and a user account that can connect to the running PulseAudio daemon. Check that the pulseaudio or pipewire-pulse compatibility layer is active before changing anything.
Step-by-step instructions
Create the virtual sink
Open a terminal and run pactl to add a null sink. Choose a clear name so the device is easy to recognize in audio settings and application menus.
pactl load-module module-null-sink sink_name=cam_audio_sink
The command returns a module index number. That number is temporary: it belongs to the current audio session and can change after a restart or if the module is removed.
Include a matching monitor source
A null sink includes a monitor source automatically. The source has the same base name with .monitor added, for example cam_audio_sink.monitor. An application that plays to the sink can be recorded later by connecting a recorder or call input to the monitor source.
Route an application to the sink
- Start the camera, media player, browser meeting tool or other program that should use the virtual sink.
- Open the desktop sound settings or mixer panel and look for the application output choices.
- Select the name you used, such as cam_audio_sink, as the output device for that application.
- If the application exposes its own speaker or output device setting, select the named sink there as well.
Some applications show only physical devices in their own menus. In that case, moving the application playback stream in the system mixer is often the simplest route.
Make the sink available after restart
A sink loaded with pactl lasts until the audio session ends. To recreate it automatically, add the load-module line to the user PulseAudio configuration used by your setup.
.nofail
load-module module-null-sink sink_name=cam_audio_sink
The exact configuration path and syntax can differ between PulseAudio versions and distributions. Confirm the correct configuration file for your installed version before editing, so that the system does not ignore or misread the line.
Check the output
List the current sinks and verify that the new name appears with its current index.
pactl list short sinks
Confirm the monitor source exists by checking the available sources.
pactl list short sources
Play audio into the sink from the chosen application, then open a recording or level-monitoring tool that reads from cam_audio_sink.monitor. The signal should appear only when that application is producing audio. A null sink does not create loudness on its own, and it may not be visible as a physical speaker in every application.
Common problems and next steps
If the application list does not show the virtual sink, check pactl list short sinks while the application is running. Some programs discover output devices only when they start, so restart the application after creating the sink.
If recording is silent, the recorder is probably listening to the wrong source. Set its input to the monitor source ending in .monitor rather than naming the sink itself as an input.
If the sink disappeared after a reboot, the automatic configuration line was not loaded. Verify the file syntax and reload the PulseAudio session, then check the sink list again.
To remove a temporary sink, find its module number in the output of pactl list short sink-inputs and unload the matching module, or use the module index returned when it was loaded. Removing the module stops the routing and the monitor source until you create the sink again.