Skip to content

Instantly share code, notes, and snippets.

@fsimonis
Last active February 10, 2024 05:43
Show Gist options
  • Save fsimonis/7d8c64a4d83d41b9cf317362b3b81f59 to your computer and use it in GitHub Desktop.
Save fsimonis/7d8c64a4d83d41b9cf317362b3b81f59 to your computer and use it in GitHub Desktop.
Pipewire remapping of Focusrite Scarlett 2i4 to mono input and stereo output
# This is a remapping of the Focusrite Scarlett 2i4 to Mono input and Stereo output
# Place this file in ~/.config/pipewire/pipewire.conf.d/
# Then reload pipewire sudo systemctl reload --user pipewire.service
# Use pw-link --input and pw-link --output to find the name of the output and input device.
# The list will contain one line per port, but you will need the name of the device node.
# The format is <name of the device node>:<name of the port>.
# We need to configure two loopback modules. One for the sink and one of the source
context.modules = [
# Configuration of the Stereo Output
{ name = libpipewire-module-loopback
args = {
node.description = "Scarlett Focusrite Stereo Output"
capture.props = {
node.name = "SF_stereo_out"
media.class = "Audio/Sink"
audio.position = [ FL FR ] # The modules provides front left and front right
}
playback.props = {
node.name = "playback.SF_surround_out"
audio.position = [ FL FR ]
# Make sure, you are using the alsa_output node here.
node.target = "alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40"
stream.dont-remix = true
node.passive = true
}
}
}
# Configuration of the Mono Input
# The channels FL and FR, correspont to inputs 1 and 2.
# So you could duplicate and change the bellow settings for the FR channel if you use an instrument.
{ name = libpipewire-module-loopback
args = {
node.description = "Scarlett Focusrite Mono Input"
capture.props = {
node.name = "capture.SF_stereo_in"
# We use the front left channel which corresponds to input 1
audio.position = [ FL ]
# Make sure, you are using the alsa_input node here.
node.target = "alsa_input.usb-Focusrite_Scarlett_2i4_USB-00.analog-stereo"
stream.dont-remix = true
node.passive = true
}
playback.props = {
node.name = "SF_mono_in"
media.class = "Audio/Source"
audio.position = [ MONO ] # We expose this as a mono input device
}
}
}
]
# Optional: Use the above nodes as the defaults.
context.properties = {
default.configured.audio.sink = { name = "SF_stereo_out" },
default.configured.audio.source = { name = "SF_mono_in" }
}
@fsimonis
Copy link
Author

Pleasure!

Your timing is hilarious though. The stable linux kernel 6.2.1 was released on the 25. Feb. It includes support for the new Focusrite Solos.

Once arch updates the kernel, you will see Line 1 and Line 2 as separate inputs without any pw scripts.

@BernhardPosselt
Copy link

BernhardPosselt commented Jul 3, 2023

@thericosanto can you post your Scarlett Solo config? it is not working out of the box on kernel 6.4.1-arch1-1

@fsimonis
Copy link
Author

fsimonis commented Jul 3, 2023

@BernhardPosselt I contributed an example of the input remapping of the solo to the pipewire docs.
You can find it at the very bottom of the page.
https://docs.pipewire.org/page_module_loopback.html

@BernhardPosselt
Copy link

Thank you!

@gel-crabs
Copy link

Works perfectly with my Scarlett 8i6. Thank you so much.

@ar-nadeem
Copy link

I wanted to thank you 🙏 for posting this. I was desperately searching for a solution on the Pipewire Arch Wiki to get my Scarlett Solo to work since I only use the 🎙️ Input and don’t add an Instrument. I adapted it and am now able to record in Audacity.

It shows as two separate inputs, but mic only outputs from FL input. There isnt any way to change except for this config to make it mono.

@ebucario
Copy link

A godsend. Used this on my Focusrite Scarlett Solo (3rd gen) to take in XLR in mono under Pipewire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment