7

I have a 3rd generation Scarlett 2i2 USB Audio Interface. It has two inputs and two outputs. The two inputs are treated as stereo mics by default. Settings -> Sound -> Input shows one device: "Analog Input - Scarlett 2i2 USB". However, I want to have the two inputs to be separated so I can pick either one in an app.

For example, in Firefox, when something wants to use the mic, I can choose the 2i2 and both inputs will be used. I want to be able to send either the left or the right input to an app, but not both.

How would I change Pulse / Alsa so that the Audio Interface is split into two Virtual Input Devices, one with the left input, one with the right?

2
  • 1
    try to find something similar on wiki.archlinux.org/index.php/PulseAudio/Examples
    – CL.
    Commented Oct 8, 2019 at 6:50
  • The only one from that page that seems like it could be useful is "Remap left or right to mono", however, that creates two fake Output devices, not input. Commented Oct 8, 2019 at 13:21

2 Answers 2

3

Well, thanks to mattia's answer, I found that there is a difference between sinks and sources. A sink is an output, a source is an input. First, I ran pacmd list-sources and found the line channel map: front-left,front-right. These are the inputs I am trying to separate. I then formed this line to put in /etc/pulse/defaults.pa:

load-module module-remap-source source_name=2i2_Left_Mic source_properties="device.description='2i2 Left In'" master=alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y8J9ZC3950FFF9-00.analog-stereo master_channel_map=front-left channel_map=front-left

The master value came from pacmd list-sources, and the channel maps at the end are the what make this work. I am taking the physical left from the input, and mapping it to the virtual left for my reamp source. Here is what the line for the other side looks like:

load-module module-remap-source source_name=2i2_Right_Mic source_properties="device.description='2i2 Right In'" master=alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y8J9ZC3950FFF9-00.analog-stereo master_channel_map=front-right channel_map=front-right

You can also attach this source to your running sound server without changing /etc/pulse/defaults.pa by using pactl load-module, in which case you'll need to escape the spaces in the description with literal backslashes like '"foo\ bar"' (looks wrong but works, and avoids a cryptic "Failure: Module initialization failed" error):

pactl load-module module-remap-source \
    master=alsa_input.usb-Focusrite_Scarlett_Solo_USB_Y78PVD021E19F4-00.analog-stereo \
    source_name=Scarlett_Left_Mic \
    source_properties=device.description='"Scarlett\ Solo\ Left\ Mic"' \
    channels=1 \
    master_channel_map=front-left \
    channel_map=mono \
    ;
2
  • 1
    You're a lifesaver, thank you very much. I had the exact same issue and your method worked perfectly for me.
    – ales_t
    Commented Apr 22, 2020 at 9:54
  • 2
    This is exactly what I was looking for, thanks! One suggestion though: I'd map the individual channels to mono, just as the question stated: channel_map=mono
    – irgendwr
    Commented Dec 3, 2020 at 16:17
1
+25

Yes, you can do it. Thanks to ductility of pulseaudio you can manage input and output, source and sink of your sound card of your applications.

I do not know any already-done example/exercise, so you have to deal with it (at least start) by yourself.

As @CL stated above, this is a great source to start with. Here another useful place.

Finally, I suggest some GUIs: pavucontrol and paprefs, that can help you in this trip.

You must log in to answer this question.

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