2022-03-03

Focusrite Scarlett 2i2 with Pipewire

The Focusrite Scarlett 2i2 is a popular beginner USB interface that gets recommended a lot on the internet. Since it is class compliant it does not need any special drivers and works out of the box on Linux (and macOS). Unfortunately, there is one caveat: if you plug in an XLR microphone into one of the two inputs you get a stereo signal which is completely silent on the right channel. This is not a problem in a DAW since it is easy to set the input to mono there but if you want to use you microphone for voice chat this is annoying. With a lot of software you won’t actually notice that since they convert all audio to mono anyway (probably so save bandwidth). Some programs don’t do that though and therefore I needed to configure my system so I would get a mono signal.

A while ago I switched to Pipewire as my audio framework because it allows me to record without having to deal with Jack directly. My idea was to route the left channel of my 2i2 to a virtual mono device.

First, I checked for the name of my input object:

$ pw-cli list-objects | grep alsa_input

After that I copied the default pipewire configuration to my config directory:

$ cp /usr/share/pipewire/pipewire.conf  ~/.config/pipewire/pipewire.conf

Here, we set up a virtual mono source by adding the following node.target to the context.modulessection:

{
  name = libpipewire-module-loopback
  args = {
    node.name = "mono-microphone"
    node.description = "Microphone - Focusrite 2i2 (mono)"
    capture.props = {
      audio.position = [ FL ]
      stream.dont-remix = true
      node.target = "alsa_input.usb-Focusrite_Scarlett_2i2_USB-00.analog-stereo"
      node.passive = true
    }
    playback.props = {
      media.class = "Audio/Source"
      audio.position = [ MONO ]
    }
  }
}

For node.name and node.description we can put whatever we want. In case you want to set that up for a different device (e.g. Behringer UMC204HD), you have to adjust the node.target to the name you got from the first step.

After that you just have to restart the Pipewire service (systemctl --user restart pipewire.service) and everything should work.