Pulseaudio: Listen to line in through speakers and use microphone for communication

What I would like to do: have my line-in audio coming from my monitor (playing on game console) to my motherboard and listen to the audio through my PC. I have that part figured out by adding load-module module-loopback latency_msec=1 to /etc/pulse/default.pa. The problem is I cannot use my microphone to talk to other people over VoiP programs like Discord. In pavucontrol-qt I have line in set as the port under input devices but if I want to talk over discord it pucks up the audio from the monitor, like-wise if I have microphone selected in pavucontrol-qt I can use my microphone to talk but the loopback makes me hear my voice and I can't hear audio from my monitor anymore. I was able to do this perfectly on Windows 7 with 'Listen to this device' and Windows audio being able to select a 'Default communications device'.

are you trying to use only microphone with discord
or do you want mix of your microphone + Line-in ?

No OS can be configured with default tools to have 2 'mix-minus':

  1. Headphones mix = Line-In + Discord - Mic

  2. Discord mix = Mic + Line-In - Discord audio

hardware must have 2 audio capture device/sub-devices listed in arecord -l to support simultaneous use of both Line-in and Microphone
your hardware probably does if it works in another OS

but only one sub-device may be available at any time in default Pulseaudio
may need to remove Pulseaudio automatic detection of audio devices (module-udev-detect)
and load input and output modules manually(module_alsa_in and module_alsa_out)
information for this can be found using pactl list modulesand pactl list cards

to combine audio streams would also need to use Pulseaudio module-combine-sink

I tried something similar in Pulseaudio a few years ago and found it too complex and unreliable and lot of extra latency (delay) from looping through mutiple modules

I prefer to use JACK for mixing multiple audio sources
assisted some friends new to Linux to use jack_mixer similar to how they used to use an application called Voicemeeter in Windows

Only want to use my microphone with Discord, otherwise the people I'm talking to will only hear the audio from my game. I figured out a way to do it with ALSAMixer's loopback, but I need to leave pavucontrol-qt open in order for it to work. go to alsamixer and press F5 to view all audio devices and F6 select the audio card you're using. I'm using a Realtek ALC1220 so I selected HD Audio Generic. Set your Line volume/Boost and set your Input Sources to where ever your microphone is plugged into. I set both to Rear Mic, CAPTURE L R is your Mic's volume. Enable Loopback and set Rear/Front Mic and their Boost to 0 but do not mute them.
Now add load-module module-loopback latency_msec=to your /etc/pulse/default.pa and use whatever latency you want. Under pavucontrol-qt change your input device to Rear Microphone since Discord depends on Pulseaudio. Leave pavucontrol-qt open, change your monitor's input to your game consoles and try Discord's microphone check. You should now have your game console's audio playing through your speakers/headphones and you'll be able to use your microphone on Discord!
If there's a way to do this while having pavucontrol-qt closed that would be great or to close it to the system tray or a jack-for-dummies guide that'd be great. No idea if alsa has as much latency as pulse but I haven't noticed any awful delay.

ALSA loopback in hardware is better option. no latency problem like Pulseaudio

If microphone is single audio source required for Discord, should be able to configure microphone in Discord settings or pavucontrol - t 2

keeping pavucontrol open is simple workaround to prevent Pulseaudio suspending audio devices

pavucontrol can be closed without affecting audio if disable Pulseaudio module-suspend-on-idle

 echo '.include /etc/pulse/default.pa
unload-module module-suspend-on-idle' >> ~/.config/pulse/default.pa

to create custom Pulseaudio configuration

restart Pulseaudio to load new configuration

systemctl --user restart pulseaudio
1 Like

Thank you, got it to work! Only thing now is when I open pavucontrol-qt it takes a about a minute to open, tried changing autospawn = yes in /etc/pulse/client.conf but it made Discord not see any audio devices at all. It's not a big deal since I use KDE's volume in the system tray. I also uncommented the load-module module-loopback latency_msec=1 since I'm using ALSA for the line in loopback.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by