Create virtual audio sinks for pipewire automatically using a system (user) service.
With the patchbay software helvum the audio can then be routed/multiplexed for e.g. obs.
It per default loops back to the default audio output.
# Create the script to unload the sink automatically
mkdir -p ~/.local/bin
nano ~/.local/bin/unload-virtual-sink.sh
chmod +x ~/.local/bin/unload-virtual-sink.sh
# Create the service
mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/virtual-sink@.servicesystemctl --user daemon-reload
# First time
systemctl --user enable --now virtual-sink@Music.service
systemctl --user enable --now virtual-sink@Game.service
systemctl --user enable --now virtual-sink@Chat.service
# Restart after chaning the service
systemctl --user restart virtual-sink@Music.service
systemctl --user restart virtual-sink@Game.service
systemctl --user restart virtual-sink@Chat.servicepactl list short modules
# ...
536870928 module-null-sink sink_name=VIRTUAL_SINK_Music
536870929 module-null-sink sink_name=VIRTUAL_SINK_Game
536870930 module-null-sink sink_name=VIRTUAL_SINK_Chat# Example to fix bad config
pactl unload-module 536870928pactl list short sinks
# ...
759 VIRTUAL_SINK_Music PipeWire float32le 2ch 48000Hz SUSPENDED
768 VIRTUAL_SINK_Game PipeWire float32le 2ch 48000Hz SUSPENDED
777 VIRTUAL_SINK_Chat PipeWire float32le 2ch 48000Hz SUSPENDED