How to replace pulseaudio with pipewire?

Hi friends,

Can someone be so kind to share how to properly replace pulseaudio with pipewire? I’ve come across some results while searching for this, but they appear to be old posts, and I am concerned with breaking my system if I use those instructions. I figure it’s smarter to ask just to be sure.

Install pipewire-pulse

It is a pipewire-based implementation of pulse so it will replace pulseaudio when you install it.

Maybe I should’ve elaborated a bit more. The reason why I am trying to switch from PulseAudio to Pipewire is because I am having issues with PulseAudio selecting my XLR mic as it’s input device. Someone on the Arch linux subreddit told me to switch to pipewire instead and that it would likely fix my issue.

So because of that, I am trying to switch from Pulseaudio to Pipewire.

OK, in that case, install pipewire-pulse :wink:

Lol okay fair enough. So do I just run the following command?

sudo pacman -S pipewire-pulse

To be safe you should run sudo pacman -Syu pipewire-pulse . That will avoid a partial update situation.

Unfortunately, it didn’t fix my issue, sigh

EndeavourOS successfully detects my audio interface, but it will not let me use ‘analog stereo output + mono input’ as my config. In order to use the mic, I must select only ‘mono input’. This is problematic because this device is used for both input and output.

Did you reboot after package update?

Install pipewire ::

$ sudo pacman -S pipewire pipewire-alsa pipewire-jack pipewire-pulse wireplumber pipewire-zeroconf pipewire-audio pipewire-v4l2 pipewire-x11-bell gst-plugin-pipewire --overwrite=*
$ yay -S carla

Must init pipewire’s and wireplumber’s services at a new installation or an upgrading of pipewire’s new version.
$ systemctl --user daemon-reload && systemctl --user --now enable pipewire pipewire-pulse wireplumber

To run carla:
$ pw-jack carla

Must configure pipewire and wireplumber::

copy the following file to ~/.config/pipewire/ (The pipewire’s way of configuration)
/usr/share/pipewire/client.conf (can change one’s own parameters)
/usr/share/pipewire/jack.conf (can change one’s own parameters)
/usr/share/pipewire/pipewire.conf (can do one’s own sinks)
/usr/share/pipewire/pipewire-pulse.conf (can change one’s own parameters)

copy the directory /usr/share/wireplumber to ~/.config/wireplumber (The wireplumber’s way of configuration)
Usually, the user’s personal configuration is done in ~/.config/wireplumber/main.lua.d/50-alsa-config.lua

Running order at each os new boot: (if one creates more than ten sinks in ~/.config/pipewire/pipewire.conf)
$ systemctl --user daemon-reload && systemctl --user restart wireplumber.service
$ systemctl --user restart pipewire-pulse.service
$ systemctl --user restart pipewire.service
Repeating cycle:
$ systemctl --user restart pipewire-pulse.service
$ systemctl --user restart pipewire.service
$ systemctl --user restart pipewire-pulse.service
$ systemctl --user restart pipewire.service

------------------------------ configure microphone in pipewire

  1. plugin microphone to input port of USB Audio Device or any other Audio device
  2. pavucontrol’s USB Audio Device setup = stereo output + mono input (or stereo input)
  3. pw-loopback -m ‘[[FL FR]]’ -C alsa_output.usb-GeneralPlus_USB_Audio_Device-00.analog-stereo --playback-props=‘[media.class=Audio/Source]’
    Run the above command in terminal.
    alsa_output.usb-GeneralPlus_USB_Audio_Device-00.analog-stereo = The default Sink from command ‘$ pactl info’
    The linking setup of microphone in carla :: (must be done correctly)
    captur_MONO (USB Audio Device) - - > input_MONO (pw-loopback-xxxxx) - - > output_FL (pw-loopback-xxxxx) + output_FR (pw-loopback-xxxxx) - - > playback_FL (USB Audio Device) + playback_FR (USB Audio Device)
  4. do recording (must through routing in carla, I did not try this in the past)
    route captur_MONO (USB Audio Device) to your DAW or recording apps.

To return to pipewire’s default configuration ::

copy /usr/share/pipewire to /etc/pipewireire/ (The pipewire’s way of configuration)
rename ~/.config/pipewire to ~/.config/pipewirexx
$ systemctl --user daemon-reload && systemctl --user restart wireplumber.service
$ systemctl --user restart pipewire-pulse.service
$ systemctl --user restart pipewire.service

To return to user’s personal configuration ::

rename ~/.config/pipewirexx to ~/.config/pipewire
$ systemctl --user daemon-reload && systemctl --user restart wireplumber.service
$ systemctl --user restart pipewire-pulse.service
$ systemctl --user restart pipewire.service

1 Like

I did ‘sudo reboot’ after and it’s the same issue persisting.

I am tempted to try this, but I have to admit that this looks intimidating for a newbie like myself. Are you saying this should solve the issue I have with my ‘Elgato Wave XLR’ audio interface device? I’m not sure if you read the last message I posted here, but I was stating that this audio interface has my XLR mic and my headphones plugged into it. EndeavourOS detects it, but it will only let me use either for output or input, I cannot use it for both. The problem is I need to use it for both because that’s how it’s intended to be used. Before attempting your solution, are you suggesting it should fix my issue?

You should create a new thread stating you’re trying to get this particular thing working. The question of how to replace pulse-audio with pipewire is very straight forward and solved in this thread in post 2. You will likely have a much better chance of figuring out how to use said thing.

1 Like

I will only guess my suggestion will fix your issue, since if you intend to use pipewire, you have to do configuration both for the pipewire and for the microphone.
The headphone part appears in output device and the microphone part appears in the input device of the pavucontrol.
If you do not make configuration for microphone, the microphone will not be usable in pipewire because it needs to use loopback module.
There is no conflict in simultaneous use of headphone output and microphone input.
As a pipewire beginner, you can just do the basic configuration of copying configure files from /usr/share/pipewire/*.conf.
If some day you have many self-designed sinks to plugin to pavucontrol (as i have said), you must do many parameters changes in pipewire.conf, client.conf, jack.conf and pipewire-pulse and restart the wireplumber, pipewire and pipewire-pulse in the order suggested, otherwise you maybe never succeed.

For an excellent use of piprewire, the following things are necessary:

  1. move pipewire socket from /run/user/1000 to /opt/pulse
  2. making all sinks passive and virtual (appear in hardware device of pavucontrol) by both parameters of node.passive=true and device.api=virtual.
  3. making a simultaneous sink like this:
    $ pactl load-module module-null-sink media.class=Audio/Sink sink_name=Simultaneous node.passive=true device.api=virtual channel_map=surround-71
  4. configuring all sinks in 50-alsa-config.lua with the parameter [“session.suspend-timeout-seconds”] = 0.

Finally, anything begins from zero, you can begin from basic and gradually to complicated.