We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
Alpine Linux
PipeWire
/ 2 This material is work-in-progress ...
‘The instructions below have not been thoroughily tested and may break things.
(Last edited by Sertonix on 4 Nov 2023.)
PipeWire (https://pipewire.org/) is a multimedia processing engine that aims to improve audio and video handling on
Linux.
Prerequisites
Device access
PipeWire needs proper permissions to access devices. If you do not use elogind, your user should be in audio (to
access audio devices) and video (to access webcam devices) groups:
# addgroup audio
# addgroup video
‘Warning: Membership of the video group will also grant unrestricted access to video devices, which is
often a security issue. See issue #15409 (https://gitlab.alpinelii org/alpine/aports/-/issues/15409) for
further details.
See pre-systemd groups (https://wiki.archlinux.org/title/Users_and_groups#Pre-systemd_groups) for more info. Make
sure to re-login for these changes to take effect.
D-Bus
PipeWire optionally requires a running D-Bus system and/or session bus for some of its functionality.
For certain configurations (e.g. only audio playback and recording) D-Bus setup is not necessary. Edit configuration
files to disable D-Bus support.
If you start session-wide dbus instance, make sure to start PipeWire in that same session.
Environment
Ensure that XDG_RUNTIME. DIR is configured correcily. If this is not set, pipewire will create a directory in your
home folder instead, called ~/pulse, and on attempting to run Pavucontrol or pactl, you will get the following error:
$ pactt List
Connection failure: Connection refused
pa_context_connect() failed: Connection refusedUnder Sway, in order for xdg-desktop-portal-wlr to work it may also be necessary 10 set
XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP to sway
Installation
Install the pipewire (https: //pkgs .alpineLinux.org/packages?name=pipewireébranch=edgeSrepo-Garch
=x86_646ma intainer=) package.
# apk add pipewire
Session Manager
PipeWire delegates plumbing work to session manager. There is only one option: WirePlumber (hitps://gitlab.freed
esktop.org/pipewire/wireplumber). It has modular design and supports Lua plugins. This is the default pipewire
session manager.
# apk add wireplumber
PulseAudio compatibility
Install pipewire-pulse (https: //pkgs .alpineLinux.org/packages?nam
epo=arch=x86_646maintainer=) package, which provides a daemon so PulseAudio applications could use
PipeWire as backend.
JACK compatibility
Install pipewire-jack (https://pkgs.alpinelinux. org/packages?name=pipewire-jack&branch=edge6rep
o=Garch=x86_64Gmaintainer=) package, which provides ABI-compatible libraries for JACK applications.
ALSA support
Install pipewire-alsa (https: //pkgs.alpinelinux. org/packages?name=pipewire-alsaSbranch-edgeérep
0=Garch=x86_646maintainer=) package.
Configuration
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:
# cp -a /usr/share/pipewire /etc
# cp -a /usr/share/wireplumber /etc
Disable D-Bus support
Edit the following configuration parameters:
Contents of /etc/pipewire/pipewire. confcontext properties = {
pport.dbus = false
Contents of /etc/wireplumber/wireplumber. conf
context.properties = {
Support.dbus = false
Contents of /etc/wireplumber/bluetooth. lua. d/S0-bluez-config. lua
bluez_monitor.properties = {
('with-logind"] = false,
Contents of /etc/wireplumber/main.lua.d/50-alsa-config. lua
alsa_monitor.properties - {
alsa.reserve"] = false,
Contents of /etc/wireplumber/main.lua.d/50-default-access-config.lua
default_access. properties = {
(*enable-flatpak-portal"] = false,
Realtime scheduling
For realtime scheduling, it is recommended to use rtkit (https: //pkgs.alpinelinux.org/packages?name=rt
. Add your user to the rtkit group.
Alternatively, ensure your user has the right ulimit permissions. Since pipewire 0.3.66, you can add yourself to the
pipewire group. You generally need (e.g. in /etc/security/Limits. conf):
Apipowire - momlock 4191304
Apipewire - nice ~19
Apipewire — rtprio 95
This allows a member of the pipewire group to have the right permissions for PipeWire to use realtime scheduling
without rikit. This same snippet comes with pipewire since 0.3.66, so if you have a PAM login session and add
yourself to the pipewire group, you don't have to do anything else.Note that the above limits.conf will only work if your session is using PAM.
Video
Video should work out-of-the-box with val2 devices (e.g. a lot of webcams) and GStreamer (hups://gstreamer.freedes
‘ktop.org/) applications.
Bluetooth aur
» Enable PulseAudio support as described above
* Install bluetooth service packages: bluez bluez-openrc pipewire-spa-bluez
* Optional: install GUI manager for bluetooth bLueman
« Enable and start bluetooth service: rc-update add bluetooth; rc-service bluetooth
start
«= Restart PipeWire
+ Use commandline program bluetoothct1 or GUI program blueman-manager to scan and pair
bluetooth audio devices.
» Use pavucontrol to adjust volume and manually select high definition bluetooth codecs.
Screen sharing on Wayland
You will need the right xdg-desktop-portal_(https://github.com/flatpak/xdg-desktop-portal) backend for your desktop
environment. Screen sharing is known to work
* GNOME with xdg-desktop-portal-gtk
«KDE Plasma with xdg-desktop-portal-kde and Firefox
* Sway with xdg-desktop-portal-wLr and Firefox, see Sway for details
Running
Tip: You can also use uperd to manage pipewire and its related services.
Note: pipewire-Launcher script is provided by Alpine Linux, not by upstream. Please report issues to Alpine
Linux maintainers first.
Start the PipeWire media server. You'll probably get quite a few errors but just ignore them for now.
$ /usr/Libexec/pipewire-launcher
AD-Bus session service must be running unless dbus support is disabled.
Auto launching
You can add /usr/Libexec/pipewire-Launcher to your ~/.xinitre
If you do not use GUI by default and have D-Bus enabled in configuration, add the following stanza to your shell
configuration file:export $(dbus-Launch)
/usr/libexec/pipewire-launcher
Testing
Ina different terminal window check the default output device. I don't yet know how this default can be changed for
all applications, so you'd better hope it's right!
WirePlumber
$ wpctl status
pw-cat playback
Test sound is working using an audio file in a format supported by libsndfile (hup://www.mega-nerd.com/libsndfile/)
(c.g. flac, opus, ogg, wav). Use pw-Cat utility from pipewire-tools (https: //pkgs.alpinel inux.org/pac
kages?name=pipewire-toolsSbranch=edgeSrepo=6arch=x86_646maintainer=):
$ pu-cat -p test. flac
$ pw-play /usr/share/sounds/alsa/Front_Center.wav
pw-cat recording
If you have a microphone test audio recording is working.
$ pu-cat -r —-list-targets
$ pu-cat -r recording. flac
(Speak for a while then stop it with Ctrl+c)
$ pu-cat -p recording. flac
PulseAudio
Test PulseAudio clients using a media player, as most use PulseAudio.
JACK
Use jack_simple_client from jack-simple-clients (https: //pkgs.alpineLinux.org/packages?nam
e=jack-simple-clients&branch=edgeGrepo-Garch-x86_646maintaine:
$ jack_simple_client
You should hear a sustained beep.
Troubleshooting
‘wpetl status’ shows no targets
First, check whether ALSA knows about your sound card:aplay -1
If sound devices are found, the issue is with your pipewire configuration. Consider double-checking the instructions
above.
Otherwise, your sound card may not be supported in the version of the Linux Kernel you're running. You should
search online for fixes relating to your current kernel version and the codec of your sound card. You can find each of
these with:
uname -r
cat /proc/asound/card0/codecx
Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
‘This means D-Bus session bus is not started and GUI is not active (ie. you are in a tty). Use dbus-run-session
as outlined above. Altematively, disable D-Bus support.
Bluetooth connect failed: br-connection-profile-unavailable
Ensure that a Session Manager is running.
Play/Pause buttons not working on bluetooth headphones
Check /var/log/messages. If you see something like this:
bluetoothd[ 3463]: profiles /audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2)
bluetoothd[ 3463]: profiles/audio/avetp.c:init_uinput() AVRCP: failed to init winput for wH-1000%xK5.
Then bluez is trying to register the headphones buttons as an input devices, but uinput is not loaded. Try
modprobe uinput. If this works, see Architecture¥Module_Loading for instructions on how to make sure this
module is loaded automatically on each startup.
Quick Configuration
You might want to use pavucontrol (https: //pkgs.alpinelinux.org/packages ?name=pavucontrolébranch
=edgeSrepo=6arch=x86_645maintainer=) or pavucontrol-qt (https: //pkgs .alpinelinux .org/package
s?name=pavucontrol-qt6branch=edgeGrepo-Garch=x86_64émaintainer=) to have a simple GUI app for
controlling sound, outputs, etc.
PipeWire Graph Qt GUI Interface
qpwgraph (https: //pkgs.alpinelinux.org/packages?name=qpwgraph&branch=edgebrepo=6arch=x86_645
naintainer=) isa graph manager dedicated to PipeWire.
See Also
= PipeWire source repository (https:/gitlab.freedesktop.org/pipewire/pipewire)
= PipeWire Wiki (https://gitlab.freedesktop.org/pipewire/pipewirel-/wikisIhome)
» PipeWire on the ArchWiki (https://wikiarchlinux.orgindex.php/PipeWire)
+ PipeWire on the Gentoo Wiki (https://wiki,gentoo.org/wiki/Pipewire)Retrieved from “https:/wiki.alpinelinux.orgiwindex. php tite=PipeWirezoldid=25432"