39

I work on two computers with one USB headset. I want to listen to both by piping the non-Linux computers' output into the Linux computer's line in (blue audio jack) and mixing the signal into the Linux computer's headset output using PulseAudio.

Audio hardware diagram

pavucontrol shows a "Built-in Audio Analog Stereo" Input Device which allows me to pick ports like "Line In" (selected), "Front Microphone", "Rear Microphone". I can see the device's volume meter reacting to audio playback on the non-Linux machine.

Built-in Audio Analog Stereo

How do I make PulseAudio play that audio signal into my choice of Output Device?

2 Answers 2

52

1. Load the loopback module

pacmd load-module module-loopback latency_msec=5

creates a playback and a recording device.

2. Configure the devices in pavucontrol

In pavucontrol, in the Recording tab, set the "Loopback" device's from input device to the device which receives the line in signal.

recording settings

In the Playback tab, set the "Loopback" device's on output device to the device through which you want to hear the line in signal.

playback settings

3. Troubleshooting

If the audio signal has issues, remove the module with pacmd unload-module module-loopback and retry a higher latency_msec= value

Additional Notes

Your modern Mid-Range computer might easily be able to manage lower latency with the latency_msec=1 option:

pacmd load-module module-loopback latency_msec=1

This answer was made possible by this forum post. Thanks!

7
  • 1
    I do not see that loopback text in pavucontrol, but it works anyway. I can unmute the input device and adjust the input level in Input Devices tab. Maybe it is due to newer version of software, Ubuntu 20.04 here. See also the module documentation.
    – jarno
    Nov 11, 2020 at 19:25
  • I had to add source setting in the load-module command to make it work more reliably.
    – jarno
    Nov 11, 2020 at 20:53
  • @jarno Thanks for that info. I do not see any "loopback" text inside the Playback tab of pavcontrol, but I do see it inside the Recording tab. Also, when I first ran the pacmd load-module module-loopback latency_msec=5, it emitted a loud noise through the speakers that were currently playing. I had to quickly execute pacmd unload-module module-loopback to turn it off...
    – bgoodr
    Nov 29, 2020 at 6:14
  • ... then reduce the speaker volume (via a physical volume control dial on the side of the speakers), then try loading the module again. Again the noise continued, but then I discovered only when I switched to the Recording tab, and switched "Loopback to Builtin Audio Analog Stereo from" from "Monitor of Built-in Audio Analog Stereo" to just "Built-in Audio Analog Stereo", it started to play normally without the noise. This is running under Xubuntu 20.04.1 LTS.
    – bgoodr
    Nov 29, 2020 at 6:16
  • 1
    BTW It is good to unload the module, when you do not use it, because it uses CPU for nothing otherwise.
    – jarno
    Nov 29, 2020 at 9:43
0

As stated in the preferred answer

pacmd load-module module-loopback latency_msec=5

Which should create a playback and recording device, doesn't seem to work in all cases. In that case, you can attempt

pactl load-module module-loopback latency_msec=5

Notice the similar arguments, using pactl

For me it didn't work with pacmd, did with pactl.

Note: Both these options are only for Pulse Audio and not for Pipewire

1
  • Please edit this so it makes sense even if the other answer is deleted.   Reference the other answer (by stating the name of the author), but copy all essential information into your answer. Dec 1, 2018 at 18:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .