Simultaneous Audio output

It is awesome Plasma allows automatic configuration for audio output, but the default setup isn’t robust enough to allow configuration in all situations. I think a few small front end and backend changes would improve things.

Right now a physical device is grouped together and sub-device output sources aren’t added to the simultaneous output grouping.

For example : GPU 1 has 5 ports.
2 HDMI and 3 DP

Currently the GUI has a line for this 1 GPU and any port that is actually plugged into the GPU shows up as a drop down. Then other physical devices such as an audio jack shows up as another device. If you activate the “Simultaneous” outputs check box it groups only GPU 1 and its active selection from above, but it doesn’t allow more sub-device selections.

What I propose is a simple GUI change.

You can leave it how it is for ease of use when not in “Simultaneous Mode” if desired, but when the user activates the Simultaneous checkbox it switches the listing to a per-audio source list.

So now GPU 1 with its 5 possible sources(if they are connected) would show up as 5 audio source outputs. Add 1 check box to say “combine this source” or whatever. Now when the user selects these sources it will be added to the virtual device and play the audio out of all those sources.

Any problems with this change?

Thanks, look forward to your input.

Maybe qpwgraph can do what you want. Wire things together as you like.

I don’t know the details of your audio hardware, but I suspect that it’s not possible to achieve what you are asking for.

The dropdown allows to chose between different device “profiles”, i.e. modes. The set of profiles and the behavior they give come from PulseAudio/the hardware, and only one profile can be active at any time

Maybe this pa config will help elaborate the point further. So I can manually configure this setup this way, but I cannot do this in the GUI. We need to break the drop down as shown in the picture below into different devices if in “simultaneous mode” and then maybe add a “checkbox” that allows this output source to be added to the “simultaneous mode” virtual device. This would make it much easier to configure.

load-module module-alsa-sink device=“hw:3,3” sink_name=dp_3 sink_properties=“device.description=‘DP 3’ device.icon_name=‘audio-card’”

load-module module-alsa-sink device=“hw:3,7” sink_name=dp_7 sink_properties=“device.description=‘DP 7’ device.icon_name=‘audio-card’”

load-module module-alsa-sink device=“hw:3,8” sink_name=dp_8 sink_properties=“device.description=‘DP 8’ device.icon_name=‘audio-card’”

load-module module-combine-sink sink_name=combined_output slaves=dp_3,dp_7,dp_8 sink_properties=“device.description=‘Combined Audio’ device.icon_name=‘audio-card-symbolic’”

Here is what I am talking about not exactly the profiles for like stereo duplex or mono etc…

here is aplay -l to make it make further sense.

**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 1: ALC1220 Digital [ALC1220 Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 3: NVidia_1 [HDA NVidia], device 3: HDMI 0 [PG42UQ]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 3: NVidia_1 [HDA NVidia], device 7: HDMI 1 [PG42UQ]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: NVidia_1 [HDA NVidia], device 8: HDMI 2 [PG42UQ]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: NVidia_1 [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: Microphone [Yeti Stereo Microphone], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

This makes it more clear. Sorry just figured out how to take a pic of the dropdown.

Obviously it would be even more impressive if this GUI could assign left/right/center audio channels to specific output sources.

This may be unrelated, but I am trying to get all audio sink devices to use the same output. Something pretty basic, but not possible through the GUI.

Not using pulseaudio anymore of course, but the Pipewire .conf addition didnt work loadint it manually, and I didnt find the default config file.

https://docs.pipewire.org/page_module_combine_stream.html#autotoc_md177

context.modules = [
{   name = libpipewire-module-combine-stream
    args = {
        combine.mode = sink
        node.name = "combine_sink"
        node.description = "My Combine Sink"
        combine.latency-compensate = false
        combine.props = {
            audio.position = [ FL FR ]
        }
        stream.props = {
        }
        stream.rules = [
            {
                matches = [
                    # any of the items in matches needs to match, if one does,
                    # actions are emited.
                    {
                        # all keys must match the value. ! negates. ~ starts regex.
                        #node.name = "~alsa_input.*"
                        media.class = "Audio/Sink"
                    }
                ]
                actions = {
                    create-stream = {
                        #combine.audio.position = [ FL FR ]
                        #audio.position = [ FL FR ]
                    }
                }
            }
        ]
    }
}
]

It seems like I can kinda get it working, but not with a pipewire config file.

If I try to add my own pipewire config in my .config file it just ends up where nothing works.

I even copied the pipewire config from where it is ran from and that works, but if I add my config it fails.

Here is the pipewire config I have.

context.modules = [
  # Other modules...
  { # Combine sink module
    name = libpipewire-module-combine-sink
    args = {
        sink.properties = {
            node.name = "combined_monitor_sink"
            node.description = "Combined Sink for Monitors"
            audio.position = [FL FR FC LFE RL RR] # Adapt this as needed
        }
        slaves = "alsa_output.pci-0000_01_00.1.pro-output-3,alsa_output.pci-0000_01_00.1.pro-output-7,alsa_output.pci-0000_01_00.1.pro-output-8"
    }
  }
]

That didn’t work, but I was able to get it working with pactl

pactl load-module module-combine-sink sink_name=combined_monitor_sink slaves=alsa_output.pci-0000_01_00.1.pro-output-7,alsa_output.pci-0000_01_00.1.pro-output-8,alsa_output.pci-0000_01_00.1.pro-output-3 channels=6 channel_map=front-left,front-right,front-center,rear-left,rear-right,lfe

pactl set-default-sink combined_monitor_sink

This worked great. When I set my device to “Pro Audio” mode in Plasma 6.

1 Like