4

I'm new to using PulseAudio for routing sources, but how would I create the following setup?

I have some source X, which I can use pavucontrol to set as the audio input for some specific application. Source X is composed of: audio from my microphone that's plugged in, and audio from Application A (and maybe even more applications, but it's not 100% required as long as I'm able to switch the application that/'s feeding in)

Source X should not be audible in my actual speakers, only used as a source for some applications.

I've not been able to figure this out - I've tried some solutions to similar problems but they always end up with either audio in my headset, or infinite echo.

If there's no way to do this in Pulse, then how would I do it? If the only solution is using JACK, I can try to get it working instead, but Pulse would be preferred.

Thanks

Theo
  • 121
  • 1
  • 6
  • This can help you: https://unix.stackexchange.com/questions/576785/redirecting-pulseaudio-sink-to-a-virtual-source – mattia.b89 Mar 05 '21 at 22:10

1 Answers1

2

you can create a virtual speaker using pactl command (PulseAudio ConTroL)

pactl load-module module-null-sink sink_name=sourceX sink_properties=device.description=Source-X-speaker

Now copy microphone output to this virtual speaker:

pactl load-module module-loopback sink_dont_move=true sink=sourceX

This command will get your default system microphone, if you wish to select different add option source=, you can find out your microphones using this command: pactl list sources short. Your real mic will usually include word alsa like alsa_input.pci-0000_00_1f.3.analog-stereo

Now open pavucontrol and redirect your application to the virtual speaker. You can do it via command as well, but GUI is much easier here.

Some programs like firefox or simplescreenrecorder allow using this speaker as a microphone but some don't (like chrome or any chromium/electron app such as discord). You can create a virtual microphone that contains every sound sent to the virtual speaker. Use this command to create one:

pactl load-module module-remap-source source_name=sourceXmic master=sourceX.monitor source_properties=device.description=Source-X-microphone

Now please set Source-X-microphone as a microphone/source in any program use want to use

jakweg
  • 61
  • 1
  • I wonder if this technique can be used to solve a [screen recording problem with SimpleScreenRecorder](https://unix.stackexchange.com/questions/681438/how-to-mix-two-input-sources-in-pulseaudio-for-recording-mic-and-speakers-with) – Francesco Potortì Dec 15 '21 at 11:41
  • @jakweg, is it possible to have speaker outputs also use the sink 'sourceX'? – Vass Oct 12 '22 at 17:59
  • 1
    @Vass yes! It is possible to record only single application + (optional microphone) and hear this application normally on the speakers if that's what you need Checkout my other answer https://unix.stackexchange.com/a/682718/460095 – jakweg Oct 14 '22 at 13:08