Pipewire install - nutthawit/alpine-dotfile GitHub Wiki

PipeWire is a multimedia processing engine that aims to improve audio and video handling on Linux. Pipewire can act as a replacement for both PulseAudio and ALSA servers.

The following packages i.e pipewire and wireplumber a session manager are the minimum required packages for getting pipewire to work.

Installation

doas apk add pipewire wireplumber

The package pipewire-pulse allows pulseaudio applications to use PipeWire as audio server in the backend.

doas apk add pipewire-pulse

ncpamixer is ncurses mixer for PulseAudio inspired by pavucontrol

doas apk add ncpamixer

ALSA stands for Advanced Linux Sound Architecture. It is a software framework and kernel component that provides the audio functions (sound card drivers, audio mixing, etc.) in the Linux operating system. It replaced the older Open Sound System (OSS) as the standard Linux audio interface.

Install alsa tools

doas apk add alsa-utils

Configuration

Check sound card is visible on your system. If not go to troubleshtooting section

aplay -l

# Output
# ---------
# This mean sound not found
arecord: device_list:279: no soundcards found...

from the man page option -l, --list-devices do list all soundcards and digital audio devices

PipeWire and WirePlumber store their default configuration in /usr/share/pipewire and /usr/share/wireplumber respectively. If you want to edit the configuration, you need to move it to /etc:

doas cp -a /usr/share/pipewire /etc
doas cp -a /usr/share/wireplumber /etc

OpenRC uses $XDG_CONFIG_HOME/rc for its user service configuration. If $XDG_CONFIG_HOME is unset, the fallback ~/.config is used.

The main configuration file for OpenRC User services is ~/.config/rc/rc.conf.

Add $XDG_CONFIG_HOME to /usr/local/bin/run-sway

#!/bin/sh
# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway
export XDG_RUNTIME_DIR=/run/user/"$(id -u $USER)"
export XDG_CONFIG_HOME="${HOME}/.config"

# Wayland stuff
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1

# Launch Sway with a D-Bus server
dbus-run-session -- sway "$@"

Kill sway by Mod+Shift+e and rerun sway by: run-sway

When sway is back online verify $XDG_CONFIG_HOME by:

echo $XDG_CONFIG_HOME

# Output should look like this (tie is my username)
/home/tie/.config

Allow propagation of the $WAYLAND_DISPLAY and associated environment variables by adding the following lines to file ~/.config/rc/rc.conf as follows:

rc_env_allow="WAYLAND_DISPLAY"

Create a custom gui user runlevel:

mkdir -p ~/.config/rc/runlevels/gui

Start gui user runlevel, by add following line to ~/.config/sway/config

# Start `gui` runlevel
exec openrc -U gui

Kill sway again by Mod+Shift+e and rerun sway by: run-sway

Start the PipeWire user service

rc-service -U pipewire start
rc-update -U add pipewire
rc-update -U add pipewire-pulse

# Verify
rc-status -U

# Output should look like this
Runlevel: gui
 pipewire                                                       [  started 00:10:00 (0) ]
 pipewire-pulse                                                 [  started 00:10:00 (0) ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
 dbus                                                           [  started 00:10:00 (0) ]
 wireplumber                                                    [  started 00:09:58 (1) ]
Dynamic Runlevel: manual

Troubleshooting

lspci -k | grep -i audio

# My output is
0000:00:1f.3 Multimedia audio controller: Intel Corporation Alder Lake PCH-P High Definition Audio Controller (rev 01)
	Kernel driver in use: sof-audio-pci-intel-tgl

In my case, I already have a kernel driver, I think maybe i don't have a firmware

[!TIP] Different between firmware and drivers

Firmware is the software that runs on the device. A driver is the software that tells your operating system how to communicate with the device. Read more

Install firmware and reboot

# Install the Sound Open Firmware files
doas apk add sof-firmware

doas reboot