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

Can confirm the following commands to setup simultaneous audio output in Plasma 6:

  1. pactl list sinks short  #will return the full names of audio sinks you need for the next command
    
  2. pactl load-module module-combine-sink sink_name=combined_monitor_sink slaves=<put name of audiosink 1 here>,<put name of audiosink 2 here>, channels=2 channel_map=front-left,front-right
    
  3. pactl set-default-sink combined_monitor_sink
    

note1: I do not have to set devices to “Pro Audio” mode, but that works too.
note2: this works reliably when done immediately after booting the machine.

There’s a bug report related to this:

1 Like

The bug/wishlist was reported in PulseAudio’s era, but what are the limitations now as of Plasma 6.6? Is it just a UI issue on the Audio Volume widget?

If it works with the pipewire configs and commands, like above, but does not show up in the widget UI you probably just forgot to to tick the “show virtual devices” checkbox in the Audio Volume widget (behind the “Hamburger” at the top of it)?

Another issue I have run into, with a new Monitor I got recently, is that the combined output is now slightly out of sync. Did not happen with the old Monitors. Have to take a closer look into the pipewire config options if it is possible to adjust that as soon I find the time for it.

  1. Is “Simultaneous Outputs” a new feature? I can’t find it. Perhaps need to update.

  2. Do you not see something similar to the “Pro Audio” selection as in this screenshot?

  • If not, then maybe you hardware cannot do the thingy
  • If yes, then selecting it should start separately showing all outputs

As not a beta version user, not as far I’m aware of.
It is a proposed/“wished for” feature hence this post in the Brainstorm section.

You can currently do it with your own config files through pipewire / wireplumbler directly, like explained above.
Or with a application that lets you graphically wire anything to everything (that pipewire supports, even if it makes no sense to connect :slightly_smiling_face:) but that only works with and as long that application runs. At least last time I tried, so long ago that I don’t remember the name of that application. Maybe things got better since(?)

One day simultaneous Audio output maybe is a direct KDE feature.
Although if one single output hardware post processes the output differently, like my new Monitor with a additional xx nanosecond delay, you may run into noticeable issues.

Ohh, just realised the dates.
Sorry, when a topic shows at the top, I end up assuming that the post came out just recently.
Turns out I was answering to one from 2023 and I didn’t scroll down to see recent replies (need to get used to this UI). :sweat_smile:

And maybe the “Pro Audio” option was not there back then.