How to setup Buffer Size individually for External Audio Interface (Focusrite 2i2)?
Hello, can you please explain how can I setup buffer size for the whole USB device individually to make sure every application using this device have the same settings? I know that you should create .lua config files in ~/.config/wireplumber/main.lua.d
Which parameters corresponds for that? is it "api.alsa.headroom" or "api.alsa.period-size" ? And how to use them properly? The only thing I found is that you can add a line to .bashrc "export PIPEWIRE_LATENCY=128/96000" but in cases when I unplug my sound card from laptop I guess it can cause problems (plus, it works only when you open shell, which means that it won't apply on reboot actually). Also, I found some info here: https://pipewire.pages.freedesktop.org/wireplumber/configuration/alsa.html
But I'm not quite sure how to use these options in my case.
Here are mine config files:
51-focusrite-2i2-3rd-gen-input.lua
rule = {
matches = {
{
{ "node.name", "matches", "alsa_input.usb-Focusrite_Scarlett_2i2_USB_Y8PGRCG094CD49-00.analog-stereo" },
},
},
apply_properties = {
["node.description"] = "Scarlett 2i2 3rd Gen",
["node.nick"] = "Scarlett 2i2 3rd Gen",
["audio.format"] = "S24LE",
["audio.rate"] = 96000,
},
}
table.insert(alsa_monitor.rules, rule)
51-focusrite-2i2-3rd-gen-output.lua
rule = {
matches = {
{
{ "node.name", "matches", "alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y8PGRCG094CD49-00.analog-stereo" },
},
},
apply_properties = {
["node.description"] = "Scarlett 2i2 3rd Gen",
["node.nick"] = "Scarlett 2i2 3rd Gen",
["audio.format"] = "S24LE",
["audio.rate"] = 96000,
},
}
table.insert(alsa_monitor.rules, rule)
I also have a 50-alsa-config.lua file, which copied from /usr/share/wireplumber/main.lua.d and modified a bit. Uncommented and modified these lines in "apply_properties" section (for all sources and sinks):
["api.alsa.period-size"] = 4,
["api.alsa.disable-batch"] = true,
My goal is to be able to use my laptop for Music Production when needed (that's why I need 24 Bit 128 Buffer Size 96000 Sample Rate, its an ideal setting for my audio interface for perfect audio quality+music production using headphones/studio monitors)+while I'm using USB interface to make sure that all the sound have these settings (24 bit 128/96000) in order to record some videos with perfect audio quality or i.e. to imrove voice from microphone during Skype/Zoom calls using Carla with plugins. And I want to make sure that the system uses my settings for this device for every application (i.e. when you open Bitwig Studio to avoid opening settings each time because of these annoying 2048/48000 setting!!!!!) while USB device is active and be able to safely unplug USB device without audio/system crashing and re-tweaking (that's why I'm looking for a posibility to add individual setting to specific device).
Btw, are there any plans on tools like Cadence or QJackCTL? Before I was forced move to Pipewire+Wireplumber I just used UbuntuStudio Control/QJackCtl/Cadence apps for start/stop actions as well as configuration and it took me maybe 2-3 mins to setup audio and forget about it. So GUI tools support is way more easier because it saves you time. And time for musicians should be spent on music itself
Info about my config:
- PipeWire Version: 0.3.56
- WirePlumber Version: 0.4.11-1pop1-1658775967-22.04-e271407
- OS Version: Pop_OS! 22.04
- DE: Gnome 42
- Kernel Version: 5.19.0-76051900-generic
- Laptop: Razer Blade Base 15 2021
- External Audio Interface: Focusrite 2i2 3rd Gen
- I'm using Carla's Patchbay for pluging audio sources to OBS/Zoom/Bitwig Studio and applying plugins to audio sources (i.e. I apply compression and sometimes vocoding on my voice during record sessions and video calls), so for me also critical to make sure that opened instance of Carla (as standalone app) will also use my device buffer size and sample rate.