t-nil avatar

Virtuelle Audiogeräte mit Pulseaudio

t-nil

Published: 22 Dec 2021 › Updated: 22 Dec 2021Virtuelle Audiogeräte mit Pulseaudio

Virtuelle Audiogeräte mit Pulseaudio

English version below


Hallo,

heute werde ich euch mal zusammengeschusterte pulseaudio-Befehle servieren. Diese richten ein virtuelles Audiogerät ein und dienen aktuell folgendem Mittel:

  • Game Sound getrennt von zB Discord ausgeben (und dann zusammenmischen), um streamen zu können, ohne das Zuschauer sich selbst doppelt hören
  • Einem Freund über Discord ein Hörbuch streamen, und den Mikrofonsound zusammenführen

Dazu geht ihr folgende Schritte durch


Schritt 1: Register virtual sink

$ pacmd load-module module-null-sink sink_name=MySink
$ pacmd update-sink-proplist MySink device.description=MySink
$ pacmd update-source-proplist "MySink.monitor" device.description="\"MySink Monitor\""

Damit registriert ihr eine neue Ausgabe namens MySink. Die ist erstmal virtuell, geht also nirgendwo hin, aber ihr könnt zB VLC direkt dahin schicken oder eben auch Discord an den Monitor anschließen und so den Sound von VLC an Discord schicken.

Mit einem einfachen

$ pacmd list-sinks

oder

$ pacmd list-sources

findet ihr die relevanten Namen eurer echten Audiogeräte heraus. Die könnt ihr dann in den nächsten Befehl basteln:

$ pacmd load-module module-loopback sink=MySink source=alsa_input.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.mono-fallback

damit schweißt ihr euer Mikrofon an den Virtual Sink, und habt somit zusätzlich eure Sprache auf dem Kanal, den ihr dann mit folgendem Befehl widerrum auf eure Lautsprecher schaltet (damit ihr auch das Hörbuch beispielsweise hört):

$ pacmd load-module module-loopback source=MySink.monitor sink=alsa_output.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.analog-stereo

Nun müsst ihr nur noch VLC auf das Gerät konfigurieren

Screenshot_2021-12-23_00-18-29.png

und per pavucontrol (der Mixer, der mit pulseaudio mitgeliefert wird) Discord "zwingen", einen Monitor als Input zu verwenden.

Screenshot_2021-12-23_00-21-52.png

Bei mir funktioniert's und ich bin mir ziemlich sicher, dass man dafür keine spezielle Config braucht. Probiert's aus!


English version


English version below


Hello,

today I will serve you some cobbled together pulseaudio commands. These set up a virtual audio device and currently serve the following purpose:

  • Output game sound separately from e.g. Discord (and then mix it together) to be able to stream without viewers hearing themselves twice.
  • Streaming an audio book to a friend via Discord, and merging the microphone sound

To do this, go through the following steps


Step 1: Register virtual sink

$ pacmd load-module module-null-sink sink_name=MySink
$ pacmd update-sink-proplist MySink device.description=MySink
$ pacmd update-source-proplist "MySink.monitor" device.description="\"MySink Monitor\""

With this you register a new output named MySink. It's virtual for now, so it doesn't go anywhere, but you can send e.g. VLC directly to it or even connect Discord to the monitor and send the sound from VLC to Discord that way.

With a simple

$ pacmd list-sinks

or

$ pacmd list-sources

you can find out the relevant names of your real audio devices. You can then build them into the next command:

$ pacmd load-module module-loopback sink=MySink source=alsa_input.usb-Kingston_HyperX_Cloud_II_Wireless_0000000001-00.mono-fallback

with this you weld your microphone to the Virtual Sink, and so you have additionally your speech on the channel, which you then switch to your speakers with the following command (so that you also hear the audio book for example):

$ pacmd load-module module-loopback source=MySink.monitor sink=alsa_output.usb-Kingston_HyperX_Cloud_II_Wireless_0000000001-00.analog-stereo

Now you just have to configure VLC on the device

Screenshot_2021-12-23_00-18-29.png

and via pavucontrol (the mixer that comes with pulseaudio) "force" Discord to use a monitor as input.

Screenshot_2021-12-23_00-21-52.png

It works for me and I'm pretty sure you don't need a special config for it. Try it out!

Leave Virtuelle Audiogeräte mit Pulseaudio to:

Written by

Read more #proofofbrain posts


Best Posts From t-nil

We have not curated any of t-nil's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From t-nil