Swapping left & right speaker with wireplumber

Hi there,
since a few days I’m trying to remap my speakers, but no success. Any help is appreciated.
I’m using

wpctl status                                                                                              1 ✘ 
PipeWire 'pipewire-0' [1.0.7, kami@bee, cookie:1531004938]
 └─ Clients:
        31. xdg-desktop-portal                  [1.0.7, kami@bee, pid:714]
        32. WirePlumber                         [1.0.7, kami@bee, pid:959]
        40. WirePlumber [export]                [1.0.7, kami@bee, pid:959]
        80. pipewire                            [1.0.7, kami@bee, pid:1067]
        81. libcanberra                         [1.0.7, kami@bee, pid:813]
        82. plasmashell                         [1.0.7, kami@bee, pid:813]
        83. KDE Connect-Dienst                  [1.0.7, kami@bee, pid:1075]
        84. Plasma-PulseAudio                   [1.0.7, kami@bee, pid:813]
        85. Firefox                             [1.0.7, kami@bee, pid:1168]
        86. Firefox                             [1.0.7, kami@bee, pid:1168]
        97. libcanberra                         [1.0.7, kami@bee, pid:2440]
       100. wpctl                               [1.0.7, kami@bee, pid:2602]
       112. Firefox                             [1.0.7, kami@bee, pid:1168]
       127. Plasma-PulseAudio                   [1.0.7, kami@bee, pid:2440]

Audio
 ├─ Devices:
 │      41. Renoir Radeon High Definition Audio Controller [alsa]
 │      42. Family 17h/19h HD Audio Controller  [alsa]
 │  
 ├─ Sinks:
 │      46. Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 4 Output [vol: 1.00]
 │      47. Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 3 Output [vol: 1.00]
 │  *   48. Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output [vol: 0.75]
 │      49. Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output [vol: 1.00]
 │      52. Family 17h/19h HD Audio Controller Pro [vol: 1.00]
 │  
 ├─ Sources:
 │      50. Family 17h/19h HD Audio Controller Pro 2 [vol: 1.00]
 │  *   51. Family 17h/19h HD Audio Controller Pro [vol: 1.00]
 │  
 ├─ Filters:
 │  
 └─ Streams:
        87. Firefox                                                     
             88. output_FL       > U3277WB:playback_FL  [active]
             89. output_FR       > U3277WB:playback_FR  [active]

and

wpctl inspect 48                                                                                            ✔ 
id 48, type PipeWire:Interface:Node
    alsa.card = "0"
    alsa.card_name = "HD-Audio Generic"
    alsa.class = "generic"
    alsa.components = "HDA:1002aa01,00aa0100,00100700"
    alsa.device = "7"
    alsa.driver_name = "snd_hda_intel"
    alsa.id = "Generic"
    alsa.long_card_name = "HD-Audio Generic at 0xfcdc8000 irq 67"
    alsa.mixer_device = "_ucm0001.hw:Generic"
    alsa.mixer_name = "ATI R6xx HDMI"
    alsa.name = "U3277WB"
    alsa.resolution_bits = "16"
    alsa.subclass = "generic-mix"
    alsa.subdevice = "0"
    alsa.subdevice_name = "subdevice #0"
    api.alsa.card.longname = "HD-Audio Generic at 0xfcdc8000 irq 67"
    api.alsa.card.name = "HD-Audio Generic"
    api.alsa.headroom = "0"
    api.alsa.open.ucm = "true"
    api.alsa.path = "hw:Generic,7"
    api.alsa.pcm.card = "0"
    api.alsa.pcm.stream = "playback"
    api.alsa.period-num = "32"
    api.alsa.period-size = "1024"
    audio.adapt.follower = ""
    audio.channels = "2"
    audio.position = "FL,FR"
    card.profile.device = "2"
  * client.id = "40"
    clock.quantum-limit = "8192"
    device.api = "alsa"
    device.class = "sound"
  * device.id = "41"
    device.profile.description = "HDMI / DisplayPort 2 Output"
    device.profile.name = "HiFi: hw:Generic,7: sink"
    device.routes = "1"
  * factory.id = "18"
    factory.mode = "merge"
    factory.name = "api.alsa.pcm.sink"
    library.name = "audioconvert/libspa-audioconvert"
  * media.class = "Audio/Sink"
  * node.description = "Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output"
    node.driver = "true"
    node.max-latency = "16384/48000"
  * node.name = "alsa_output.pci-0000_04_00.1.HiFi__hw_Generic_7__sink"
  * node.nick = "U3277WB"
    node.pause-on-idle = "false"
  * object.path = "alsa:pcm:0:hw:Generic,7:playback"
  * object.serial = "48"
  * priority.driver = "632"
  * priority.session = "632"

I tried a lot of different how to i found online. Most of them are deprecated because they are still using pipewire <0.4.
My wireplumber conf file:

cat ~/.config/wireplumber/wireplumber.conf.d/alsa-vm.conf                                               INT ✘ 
# ALSA node property overrides for virtual machine hardware

monitor.alsa.rules = [
  # Generic PCI cards on any VM type
  {
    matches = [
      {
        node.name = "~alsa_output.pci.*"
        cpu.vm.name = "~.*"
      }
    ]
    actions = {
      update-props = {
#        audio.channels         = 2
        audio.position         = ["FR", "FL"]
      }
    }
  }
]

But that doesn’t work… and right now I’m a bit clueless. Any ideas what i am missing?
Thanks!

Virtual devices · Wiki · PipeWire / pipewire · GitLab

Remap Sink

Create a sink that can be selected in applications and that swaps the left and right channels to another sink.

pw-loopback --capture-props='media.class=Audio/Sink node.name=my-sink audio.position=[FL FR]' --playback-props='audio.position=[FR FL]'

Or the PulseAudio equivalent:

pactl load-module module-remap-sink sink_name=my-sink channel_map=front-left,front-right master_channel_map=front-right,front-left
1 Like