How to import Pulseaudio settings to Pipewire?

Hello!
I searched for any way of sharing audio with my screen and then I found “Pipewire”. It seems that It allows me to share application audio, unlike Pulseaudio.

So I’m trying to find any page on the internet that shows how to import my Pulseaudio settings into Pipewire, but no luck. I tried to install Pipewire earlier and It ignored completely my Pulseaudio settings which I set like this article, in default.pa.

So, how would I map my devices (the playback PCH, 0 ALSA device and the PCH, 0 and PCH, 2 ALSA recording devices) into a Pipewire installation? In other words, how to import my Pulseaudio default.pa settings into Pipewire?

If you’re not using Pulseaudio manual settings, but an automatic detection, there is no reason to follow this. Just install manjaro-pipewire package and be happy without fear :slight_smile:

Instead, if you have the same problem as mine on Pulseaudio (2 inputs been used as 1 input with 2 options instead of… 2 inputs) and want to go to Pipewire, see the spoiler:

How I did with my Pulseaudio settings on Pipewire

My Pulseaudio configuration

When we have

load-module module-alsa-sink device=hw:PCH,0 sink_name=line_output
load-module module-alsa-source device=hw:PCH,0 source_name=microphone_input
load-module module-alsa-source device=hw:PCH,2 source_name=line_input

#.ifexists module-udev-detect.so
#load-module module-udev-detect
#.else
### Use the static hardware detection module (for systems that lack udev support)
#load-module module-detect
#.endif

on /etc/pulse/default.pa (or ~/.config/pulse/default.pa) It tells us that:

  • There is a sink on hw:PCH,0
  • There are 2 sources on hw:PCH,0 and hwPCH,2
  • Automatic detection is disabled

How I did on Pipewire

On Pipewire the settings are located on /etc/pipewire, so you can copy them to ~/.config/pipewire/ to set your own, just like Pulseaudio.

So, to make something like that on Pipewire we should disable auto-detection on media-session.d/media-session.conf at probably line 90 by commenting alsa-monitor:

        #alsa-monitor

And to manually set what sources and sinks we edit pipewire.conf like this:

pipewire.conf
context.objects = {
    adapter = {
        args = {
            factory.name    = api.alsa.pcm.sink            # The ALSA sinks object on Pipewire
            node.name       = line_output            # A name for the device
            node.description        = "Line Output"            # A visible name for the device in the tray (mandatory quotes)
            media.class             = Audio/Sink            # Another sink parameter on Pipewire
            api.alsa.path           = "hw:PCH,0"            # Finally the sink location. Quotes are mandatory.
        }
    }
    adapter = {
        args = {
            factory.name    = api.alsa.pcm.source            # Here we did the same thing, just change "sink" to "source" and the names.
            node.name       = microphone_input
            node.description        = "Microphone Input"
            media.class             = Audio/Source
            api.alsa.path           = "hw:PCH,0"
        }
    }
    adapter = {
        args = {
            factory.name    = api.alsa.pcm.source
            node.name       = line_input
            node.description        = "Line Input"
            media.class             = Audio/Source
            api.alsa.path           = "hw:PCH,2"
        }
    }
}

Then you should probably get the devices like I asked on this article.

Basically there is no correct way to do this. I think the idea is to adapt what you need to Pipewire. My adaptations are completely compatible, so I had no problems (basically It was a pipewire object instead of a pactl module).

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.