Creating a null sink
Getting familiar with pactl
First we want to take a look at all output channels (or sinks
):
➜ ~ pactl list short sinks
1 alsa_output.pci-0000_1f_00.3.iec958-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_output.pci-0000_1d_00.1.hdmi-stereo-extra1 module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
3 bluez_sink.38_18_4C_BE_25_8B.a2dp_sink module-bluez5-device.c s16le 2ch 44100Hz RUNNING
Sink 3
are my bluetooth headphones, so I want to use those later to output all sounds.
In case the naming isn't as obvious in your case, you can look at pavucontrol
which should show you, which sink you are using at the moment. (While you are playing audio, the last column should also say RUNNING
)
Creating a null sink
A null sink is a output channel that doesn't correspond to a hardware device. Later we will use it to tell OBS to only stream audio from this channel.
➜ ~ pactl load-module module-null-sink
28
As null
is an ugly name, we will set this channel's description to OBS
(so this is what pavucontrol
and your desktop environments audio settings will show you).
➜ ~ pacmd update-sink-proplist null device.description=OBS
➜ ~ pactl list short sinks
1 alsa_output.pci-0000_1f_00.3.iec958-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_output.pci-0000_1d_00.1.hdmi-stereo-extra1 module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
3 bluez_sink.38_18_4C_BE_25_8B.a2dp_sink module-bluez5-device.c s16le 2ch 44100Hz RUNNING
4 null module-null-sink.c s16le 2ch 44100Hz SUSPENDED