I have a digital piano connected to a Focusrite Scarlett 2i2 USB audio interface. That interface and a Logitech USB webcam are both connected to my computer. I want to merge the sounds from the Scarlett and the webcam microphone into a null-sink and use its monitor as "microphone" in Skype for remote Piano lessons. The teacher can then hear me speak and also the music directly from the Scarlett (and not recorded via air).

So far I do this:

pactl load-module module-null-sink sink_name=piano_lesson
pactl load-module module-loopback sink=piano_lesson
pactl load-module module-loopback sink=piano_lesson

So now I have to loopbacks going into the null-sink. I then open pavucontrol GUI and on the recording tab I assign the Scarlett to the first loopback and the webcam mic to the second loopback. This works. However, this is tedious and I have begun writing a script to automate the process.

However, I struggle to find the command for assigning the devices to those loopbacks. I'm not sure if pactl move-sink-input|move-source-output are the right commands for this nor have I fully understood their purpose even through reading documentation and other Stack questions/answers. The commands provide auto-completion but the suggestions for the parameters are confusing or expected parameters (e.g. the microphone) do not show up.

Q: How would I connect the Scarlett/microphone to the loopback devices via command line?

My goal:

  • connect source #4 (alsa_input.usb-Focusrite_Scarlett_2i2_[...].analog-stereo) to sink-input 1
  • connect source #5 (alsa_input.usb-046d_09a1_C5BDCE20-02.analog-mono [=webcam]) to sink-input 2

Here are some outputs:

$ pactl list sinks short
0   alsa_output.pci-0000_00_1b.0.analog-stereo  module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
1   alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y8GCE759613412-00.analog-stereo  module-alsa-card.c  s32le 2ch 44100Hz   SUSPENDED
2   piano_lesson    module-null-sink.c  s16le 2ch 44100Hz   RUNNING

$ pactl list sink-inputs short
0   0   1   protocol-native.c   float32le 2ch 44100Hz
1   2   -   module-loopback.c   s16le 2ch 44073Hz
2   2   -   module-loopback.c   s16le 2ch 44032Hz

$ pactl list sources short
0   alsa_output.pci-0000_00_1b.0.analog-stereo.monitor  module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
1   alsa_input.pci-0000_00_1b.0.analog-stereo   module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
3   alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y8GCE759613412-00.analog-stereo.monitor  module-alsa-card.c  s32le 2ch 44100Hz   SUSPENDED
4   alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y8GCE759613412-00.analog-stereo   module-alsa-card.c  s32le 2ch 44100Hz   RUNNING
5   alsa_input.usb-046d_09a1_C5BDCE20-02.analog-mono    module-alsa-card.c  s16le 1ch 16000Hz   RUNNING
6   piano_lesson.monitor    module-null-sink.c  s16le 2ch 44100Hz   IDLE

$ pactl list source-outputs short
7   4   -   module-loopback.c   s16le 2ch 44100Hz
9   5   -   module-loopback.c   s16le 2ch 44100Hz

Note: I'm also open for non-PulseAudio solutions and it doesn't matter if it is a script or a GUI based tool in which I could load such a configuration, e.g. from a profile.

1 Answer 1


You can set the source for loopback devices.

pactl load-module module-loopback source=alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y8GCE759613412-00.analog-stereo sink=piano_lesson
pactl load-module module-loopback source=alsa_input.usb-046d_09a1_C5BDCE20-02.analog-mono sink=piano_lesson

You must log in to answer this question.

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