I sometimes stream games for my friends on Discord, but Discord for Linux is unable to capture the game sounds. I use Pulseaudio + ALSA combo for my sound needs. I thought of solving this issue by making virtual source device, which would combine the sounds from my microphone and the output of my computer. My best shot looked like those commands:
pactl load-module module-null-sink sink_name=loopback pactl load-module module-loopback source=alsa_input.pci-0000_00_1b.0.analog-stereo sink=loopback pactl load-module module-loopback source=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor sink=loopback
The idea was that I would be able to slect this device as an input from discord. Sadly there seem to be two problems with my attempt. First the loopback doesn't implicitly mix the two audio sources and only binds itself to the last one. Second Discord doesn't recognize loopback as input, probably because it is audio sink despite having loopback.monitor source.
Is there a way to do what I'm trying to do, or at least something similar?