Split Stereo USB Audio Interface Line In to Two Mono Devices

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?

Asked By: Feldspar15523

||

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.

Answered By: mattia.b89

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 
    ;
Answered By: Feldspar15523