惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
I
InfoQ
U
Unit 42
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
月光博客
月光博客
D
Docker
Stack Overflow Blog
Stack Overflow Blog
D
DataBreaches.Net
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
V
Visual Studio Blog
博客园 - 聂微东
A
About on SuperTechFans
腾讯CDC
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
博客园 - 【当耐特】
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence

Arch Linux Forums

Avidemux crashes without strace / Applications & Desktop Environments how to apply patches with non-linux linends / Newbie Corner Replicating CachyOS on vanilla Arch (or at least getting close) / Arch Discussion What's arch linux GUI package manager ? / Newbie Corner Hibernation failing due to insufficient memory / System Administration profiledef.sh editting question / Installation trying to script kde plasma wallpaper settings / Programming & Scripting Looking for new Audacious package maintainer / Creating & Modifying Packages issues installing arch with LUKS2 encryption / Newbie Corner QEMU PXE booting does not work with OVMF.4m.fd / Applications & Desktop Environments Wired lan regular disconnect / Newbie Corner Need Help setting up ARCH in my G16 G634JZR iwlwifi started failing consistently, trying to determine root cause Windows randomly jumping between monitors after GNOME 50 update No display via DP or HDMI after boot. / Kernel & Hardware how to change acpi platform_profile? / Newbie Corner Linux denied all kernel modules which not loaded right now Use iPhone as Webcam for Arch Linux Video Output Failure on nvidia-580xx-dkms on TTY --> Desktop switch (Page 2) / Kernel & Hardware I was going to rant ..WINE32 Sabotage compliments of Arvind Krishna / Arch Discussion [SOLVED] LUKS drive auto unlocked by TPM when expected not to / Networking, Server, and Protection Hibernate/suspend from X = dark panel; from TTY = works (ASUS G14, hyb (Page 2) / Laptop Issues Headphone jack noise/buzz / Newbie Corner segmentation fault in cc1plus when building CLK / AUR Issues, Discussion & PKGBUILD Requests Console alternative to meld / GNU/Linux Discussion Problem with paru git clone / Newbie Corner XKB questions / Applications & Desktop Environments gnome-keyring-daemon is not working correctly / Applications & Desktop Environments [SOLVED] Steam opens and immediately closes constantly / Newbie Corner Firefox rounded edges on Sway / Applications & Desktop Environments
[SOLVED] How do I reverse L and R channels in pipewire? /...
BinToss · 2026-06-24 · via Arch Linux Forums

After doing a lot of research, learning the rudiments of lua scripting, and a lot of trial and error, I've come up with a solution.  It's my sincere hope that this post will help others figure out their pipewire woes as they transition over from PulseAudio and Jack to this promising, but less well-documented system.  Here it goes...

First off, I copied the following sample configs to my local directory (make sure to create the directory under ~/.config/wireplumber/main.lua.d first):

cp /usr/share/wireplumber/main.lua.d/30-alsa-monitor.lua ~/.config/wireplumber/main.lua.d/
cp /usr/share/wireplumber/main.lua.d/50-alsa-config.lua ~/.config/wireplumber/main.lua.d/

Open ~/.config/wireplumber/main.lua.d/50-alsa-config.lua in a text editor and make the following changes to audio.channels and audio.position properties in order to flip the order of the L & R audio channels across all devices:

~/.config/wireplumber/main.lua.d/50-alsa-config.lua
...
     matches = {
      {
        -- Matches all sources.
        { "node.name", "matches", "alsa_input.*" },
      },
      {
        -- Matches all sinks.
        { "node.name", "matches", "alsa_output.*" },
      },
    },
    apply_properties = {
      ...
      ["audio.channels"]         = 2,
      ...
      ["audio.position"]         = "FR,FL",
      ...

In order commit these changes, assuming pipewire and wireplumber are both running on user-level systemd, save these changes and run the following command:

systemctl --user --now wireplumber

Now, when you test your headphones or speakers through whichever audio device system setting app you use to configure your audio devices, you should notice that the front left and front right channels have switched around.

If you have, say, a multichannel audio interface (check out this page to find out how to get your audio interface alsa input/output device name) that you want to create special settings for, you can do so by creating under the same main.lua.d directory a file with the following contents:

~/.config/wireplumber/main.lua.d/51-alsa-multichannelAudioInterface.lua

rule = {
  matches = {
    {
      { "node.name", "matches", "alsa_input.usb-audio-interface" },
    },
    {
      { "node.name", "matches", "alsa_output.usb-audio-interface" },
    },
  },
  apply_properties = {
    ["audio.channels"]         = 4,
    ["audio.format"]           = "S32LE",
    ["audio.rate"]             = 48000,
    ["audio.position"]         = "FR,FL,RR,RL",
    ["api.alsa.period-size"]   = 128,
    ["api.alsa.period-num"]    = 3,
  },
}

table.insert(alsa_monitor.rules, rule)

The above code will not only reverse the order of the channels, but also sets the number of channels, the audio bit rate, sample rate, period size, and period number to a default that you may use when running a DAW through pipewire-jack.

Remember to run `systemctl --user --now wireplumber` to set these changes into action.

If anyone finds something wrong with these configs, or can find a better way of getting these sorts of settings into play, kindly add to this thread.  For now, I shall mark this is SOLVED.

Last edited by haigioli (2023-04-17 02:30:34)