Site icon Linux Genie

How to Install PipeWire on Arch Linux?

How to Install PipeWire on Arch Linux

PipeWire is a new audio service for Linux that aims to replace PulseAudio. It started in 2017, but it wasn’t very stable back then. Now, after many years of improvement, PipeWire has become a reliable option for Linux audio. If you plan to transition to PipeWire, follow this installation article to get PipeWire on an Arch Linux system.

Contents:

Why Use PipeWire over PulseAudio?

PipeWire is a framework that works with different kinds of multimedia data, like sound, video, and MIDI. If you want to handle audio and video better on Linux, you should try PipeWire. It lets you connect different software and hardware devices. Using it, you can share audio over screen sharing and remote desktop. PipeWire works fast and supports numerous applications that use audio and video.

Some reasons to use PipeWire over PulseAudio are:

  • PipeWire can dynamically switch between different buffer sizes, to adapt to the different latency requirements of different audio applications.
  • PipeWire supports virtually all Bluetooth codecs by default, while PulseAudio supports just the SBC codec.
  • PipeWire can work with pro-audio apps and JACK. It provides a replacement libjack.so that makes all JACK applications run on top of PipeWire.
  • PipeWire can also handle video streams and has been integrated with Wayland and Flatpak.

How to Install PipeWire on Arch Linux?

To install PipeWire on Arch Linux, first install the PipeWire package from the official repositories. After that, you can install a session manager, such as wireplumber or pipewire-media-session, to handle the connection logic between streams and devices. The PipeWire package is also available as lib32-pipewire for multilib support.

Further, it is recommended to install the PipeWire packages like alsa, jack, and pulse. All these packages enable PipeWire as a drop-in alternative to other audio servers.

Once PipeWire is installed, you have to enable and start the pipewire, pipewire-pulse, and session manager services using systemctl –user.

Let’s check all these steps and take a closer look at PipeWire installation on Arch Linux.

1. Check the Installed Audio Server

Before you install PipeWire on your system, you need to check if it’s already running. Open a terminal and type pactl info.

Look at the Server Name line. If it says on PipeWire, you have PipeWire. If it only says PulseAudio, you don’t have PipeWire.

pactl info

The pactl info command can introspect the PulseAudio server during runtime. It connects to the sound server and provides brief configuration details of the audio server.

Note:

Before moving to the installation of PipeWire it’s best to back up your system. If installation doesn’t go well, you will have a system backup.

2. Installing PipeWire Audio Server

You need the base service for PipeWire installation. Maybe your distro already has it, but if not, you can get it yourself. Simply run the below-explained commands.

To install the PipeWire package along with the PipeWire-ALSA plugin on Arch-based systems, run:

sudo pacman -S pipewire pipewire-alsa

This command also installs the alsa plugin. ALSA stands for Advanced Linux Sound Architecture. It is a software framework and also a Linux kernel part. It gives the system an interface for sound card device drivers. ALSA can be used directly by applications, or through other sound servers such as pipewire, pulseaudio, or JACK.

3. Session Manager for Controlling PipeWire

To connect your devices, you need a session manager because PipeWire doesn’t do that by itself. A session manager is responsible for configuring PipeWire’s behavior, such as which devices to use, how to route the streams, and what policies to apply.

WirePlumber and Media Session are two different session managers for PipeWire.

WirePlumber is a newer and more granular session manager with extra plugin support than media sessions. It is designed on a modular design with Lua plugins to get management functions. Using WirePlumber you can easily customize the PipeWire experience. WirePlumber is intended to replace Media Session as the default session manager for the PipeWire audio server.

Media Session is the original session manager for PipeWire, and it provides basic functionality for managing audio and video streams. It is simpler than WirePlumber and relies on configuration files that prompt it to activate PipeWire’s features. Media session is still compatible with PipeWire, but may not support some of the newer features that WirePlumber offers.

To install WirePlumber on Arch-based systems, run this command:

sudo pacman -S wireplumber

Note:

You can also try a graphical user interface to control PipeWire, such as qpwgraph or helvum.

Or, you can go for PipeWire Media Session, which is a simpler session manager. The command for that is:

sudo pacman -S pipewire-media-session

Both WirePlumber and Media Session can be installed and used on Arch Linux, but they cannot coexist on the same system. If you want to switch from media session to WirePlumber you need to disable the former and enable the latter using systemd user units.

4. Configuring PipeWire-Pulse for PulseAudio Compatibility

A large portion of system applications are still using the PulseAudio sound server. If you want to make your audio work well, you need to install PipeWire’s daemon. It can handle the calls from your system’s applications that use PulseAudio.

This package is called pipewire-pulse, and it provides a replacement for the PulseAudio server that redirects all audio to PipeWire. By installing this package, you can use PipeWire as your system sound server and still enjoy the compatibility with PulseAudio applications.

To install pipewire-pulse on Arch-based systems, you can run:

sudo pacman -S pipewire-pulse

5. Removing PulseAudio

To avoid any conflicts with Pipewire or pipewire-pulse, you should uninstall PulseAudio completely from your system. To remove pulseaudio from Arch-based systems, run:

sudo pacman -Rns pulseaudio

From the image above, the target not found means PulseAudio is already removed from the system.

6. Enable PipeWire Services

For now, we have installed all the necessary packages required for PipeWire and uninstalled the PulseAudio packages. Now let’s make PipeWire work. For that, first, you have to disable all the remaining pulseaudio services.

Disable the PulseAudio Services

To disable PulseAudio services, you can run:

systemctl --user --now disable pulseaudio.service pulseaudio.socket

Now masks the PulseAudio service for the current user:

systemctl --user mask pulseaudio

The above command will prevent the PulseAudio sound server from starting automatically when you log in to your user account. This is useful if you want to use an alternative sound server or if you want to disable PulseAudio altogether. The mask command is similar to the disable command, but it also prevents other services from starting PulseAudio.

Enable PipeWire and PipeWire Session Managers

Now enable the PipeWire audio server and WirePlumber session manager:

systemctl --user --now enable pipewire pipewire-pulse wireplumber

If you have installed or using PipeWire Media Session services, you can enable it by running this command:

systemctl --user --now enable pipewire pipewire-pulse pipewire-media-session

Get PipeWire While Arch Installation

If you are installing Arch Linux using the Archinstall script, we recommend you select PipeWire as your audio server. With the new installation script, it’s now easier than ever to install and customize your Arch Linux.

To select PipeWire as an audio server, open the Audio option:

Now you will get the options for both audio servers. You can either select the Pipewire or Pulseaudio to continue with your installation.

Conclusion

To install PipeWire on Arch Linux, first, you have to check the current audio server using the pactl info command. After that, you can use the Pacman package manager to get PipeWire and PipeWire plugin alsa on your system. Once the installation is done, disable and remove the PulseAudio server and install a session manager for PipeWire. You have two options for a session manager, you can either continue with WirePlumber or use the Media Session Manager. Session Manager helps PipeWire in configuring audio streams and devices. To get PulseAudio support, you can install pipewire-pulse in your system. With all these installation steps, you’ll have PipeWire working perfectly on your Arch system.

 

Exit mobile version