14

I'd like to have my system automatically output to all available sound devices (preferably using a sink in Pulseaudio Volume Control). This was possible when using Pulseaudio alone.

Is it possible with Pipewire? If yes, how would you achieve this?
Is it possible to set this up to be available automatically?

1

4 Answers 4

13

I finally found the answer after reporting a bug and getting a response to my question. The solution is so amazingly simple:

Run:

pactl load-module module-combine-sink

And you get the same functionality with PipeWire.

If I'm understanding these instructions correctly, you can make this permanent by copying /usr/share/pipewire/pipewire-pulse.conf to ~/.config/pipewire/pipewire-pulse.conf and adding:

context.exec = [
    { path = "pactl"  args = "load-module module-combine-sink" }
]

Then saving the file. Alternatively, you can add the first command to your startup applications.

1
  • I'm doing pactl load-module module-combine-sink and it shows up in the output devices and the levels flicker up and down indicating there's audio piped through, but sound does not come through both outputs.
    – Victor
    Apr 7, 2022 at 13:18
5

This is to supplement OP's answer:

According to man pipewire.conf (and a bit of inferencing), you can use drop-in files to the same effect, so this should be the preferred way to do it IMO.

The directories are /etc/pipewire/pipewire-pulse.conf.d/ for global and $XDG_CONFIG_HOME/pipewire/pipewire-pulse.conf.d/ for user (which defaults to ~/.config/pipewire/pipewire-pulse.conf.d/ if $XDG_CONFIG_HOME is unset).


So just create this file (mkdir -p if directory does not exist):

$XDG_CONFIG_HOME/pipewire/pipewire.conf.d/add-combined-sink.conf

context.exec = [
    { path = "pactl" args = "load-module module-combine-sink" }
]

Note that in my testing, if I put the drop-in file in /etc/pipewire/pipewire-pulse.conf.d/, something weird happens to the combined output (pitch becomes higher and introduces regular stutters).

If I have to guess, it's probably something related to the modules' loading order: most likely there is a way to fix it, but I haven't bothered to investigate. Putting it in $XDG_CONFIG_HOME/pipewire/pipewire-pulse.conf.d/ works just fine though, so that's what I did.

5
  • I'm running Kinetic 22.10 and loading the combine sink does nothing in ~/.config/pipewire/pipewire-pulse.conf but elicits weird crashes in /etc/pipewire/pipewire-pulse.conf.d/ (BTW is there a reason why the answer above is not part of your first answer? You could just merge them and delete this one.) Jan 3 at 10:06
  • Not sure if this is related, but recently I've noticed that the combined sink is no longer showing up in KDE's audio volume widget, but can still be found in the audio page of system settings. Maybe it's a GUI issue? (educated guess; don't quote me on this)
    – cyqsimon
    Jan 3 at 18:37
  • As of why I didn't merge the answer: I personally think edits should be reserved for minor corrections and stylistic improvements only. This would obviously not be a minor edit. And there's the selfish reason too: of course I want to get rep for the things I wrote, sorry ¯\_(ツ)_/¯.
    – cyqsimon
    Jan 3 at 18:43
  • Fair enough. BTW in the end, I just put pactl load-module module-combine-sink into a shell script that's called on login with Gnome's "startup programs". Now works fine for me on 22.10. Jan 5 at 16:07
  • @TommyPeanuts I also got issues with the conf.d in the home directory, sound completely stopped working, and launching new processes/windows was utterly slow. I had to revert it.
    – Didier L
    Jan 20 at 20:08
1

With PipeWire version 0.3.65, we have a native module available as well: module-combine-stream.

For the simultaneous output configuration, you'll want to use something like the following in pipewire.conf, adapted from the example in the documentation:

context.modules = [
{   name = libpipewire-module-combine-stream
    args = {
        combine.mode = sink
        node.name = "my_combined_sink"
        node.description = "My Combined Sink"
        combine.props = {
            audio.position = [ FL FR ]
        }
        stream.rules = [
            {
                matches = [
                    {
                        media.class = "Audio/Sink"
                    }
                ]
                actions = {
                    create-stream = {
                    }
                }
            }
        ]
    }
}
]

If you only want to combine specific sinks, you can of course add more entries to the matches array and specify node.name instead of matching all sinks.

If you don't know their names already, you can get all available sink names via pw-link -o.

1
  • Thank you for this answer, I'll update mine to reference this one after I've tested it.
    – RolandiXor
    Mar 21 at 1:02
0

You can check with helvum if sinks and sources are properly connected.

2
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Pilot6
    Jun 11, 2022 at 8:45
  • @Pilot6 The link is to helvum's repo. If the linked page changes and helvum no longer exists, then this answer wouldn't make sense anyway. Mar 19 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .