PipeWire: Difference between revisions
m (Simplify wording) |
m (Misc styling) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
== Prerequisites == | == Prerequisites == | ||
* PipeWire requires [[D-Bus#D- | * PipeWire requires [[D-Bus#D-Bus_session_bus|D-Bus session bus]] for most of its functionality. | ||
* Ensure that your [[Setting_up_a_new_user#Creating_a_new_user|non-root user account]] has appropriate [[Setting_up_a_new_user# | * Ensure that your [[Setting_up_a_new_user#Creating_a_new_user|non-root user account]] has appropriate [[Setting_up_a_new_user#Groups_for_desktop_usage|groups for desktop usage]]. | ||
* WirePlumber requires [[ | * WirePlumber requires [[eudev]] for ALSA device discovery. | ||
== Installation == | == Installation == | ||
| Line 16: | Line 16: | ||
=== Pulseaudio interface === | === Pulseaudio interface === | ||
The package {{Pkg|pipewire-pulse}} allows pulseaudio applications and [[# | The package {{Pkg|pipewire-pulse}} allows pulseaudio applications and [[#GUI_tools|GUI tools]] to use PipeWire as audio server in the backend. | ||
{{Cmd|# apk add pipewire-pulse}} | |||
=== JACK compatibility === | === JACK compatibility === | ||
Since PipeWire replaces JACK, Install {{Pkg|pipewire-jack}} package, so it provides ABI-compatible libraries for JACK applications.{{Cmd|# apk add pipewire-jack}} | Since PipeWire replaces JACK, Install {{Pkg|pipewire-jack}} package, so it provides ABI-compatible libraries for JACK applications. | ||
{{Cmd|# apk add pipewire-jack}} | |||
=== ALSA support === | === ALSA support === | ||
Install {{Pkg|pipewire-alsa}} package to provide support for | Install {{Pkg|pipewire-alsa}} package to provide support for ALSA applications. | ||
{{Cmd|# apk add pipewire-alsa}} | |||
=== GUI tools === | === GUI tools === | ||
[[#Pulseaudio interface | * {{Pkg|pavucontrol}}: simple GUI app for controlling sound, outputs, etc. Consider using {{Pkg|pavucontrol-qt}} when using [[KDE|Plasma]]. | ||
: [[#Pulseaudio_interface|Pulseaudio interface]] is mandatory for {{Ic|pavucontrol}} to work with PipeWire. | |||
* {{Pkg|xfce4-mixer}}: XFCE Audio mixer. | |||
: Currently available in the [[Repositories#Testing|testing]] repository. | |||
* {{Pkg|qpwgraph}}: graph manager dedicated to PipeWire with Qt GUI Interface. | |||
== Launch PipeWire | == Launch PipeWire == | ||
Most [[Desktop_environments_and_Window_managers#Desktop_environments|desktop environments]] launch PipeWire automatically in Alpine Linux upon relogging( i.e logging out and logging in) after [[#Installation|installing the above packages]]. Proceed with section below only if PipeWire is [[#Testing|not launched]] after a relogin/reboot. | Most [[Desktop_environments_and_Window_managers#Desktop_environments|desktop environments]] launch PipeWire automatically in Alpine Linux upon relogging (i.e. logging out and logging in) after [[#Installation|installing the above packages]]. Proceed with the section below only if PipeWire is [[#Testing|not launched]] after a relogin/reboot. | ||
[[# | {{Note|[[#PipeWire_user_service|PipeWire user service]] is the recommended method to launch PipeWire and will replace [[#pipewire-launcher|pipewire-launcher]]. Do '''NOT''' use both methods to avoid running multiple instances of PipeWire.}} | ||
=== PipeWire user service === | === PipeWire user service === | ||
Since [[Release_Notes_for_Alpine_3.22.0#OpenRC_User_services| | Since [[Release_Notes_for_Alpine_3.22.0#OpenRC_User_services|Alpine 3.22]], PipeWire can be launched as a user service. | ||
==== User service prerequisites ==== | ==== User service prerequisites ==== | ||
| Line 54: | Line 62: | ||
To start the {{Ic|pipewire}} user service and its {{Ic|wireplumber}} session manager: | To start the {{Ic|pipewire}} user service and its {{Ic|wireplumber}} session manager: | ||
$ rc-service -U pipewire start | {{Cmd|$ rc-service -U pipewire start | ||
$ rc-service -U wireplumber start | $ rc-service -U wireplumber start}} | ||
To enable the {{Ic|pipewire}} and {{Ic|wireplumber}} user services in [[Wayland]], | To enable the {{Ic|pipewire}} and {{Ic|wireplumber}} user services in [[Wayland]], in [[Xorg]] change {{Ic|gui}} to {{Ic|default}}: | ||
$ rc-update -U add pipewire gui | {{Cmd|$ rc-update -U add pipewire gui | ||
$ rc-update -U add wireplumber gui | $ rc-update -U add wireplumber gui}} | ||
The above steps may be repeated for {{Ic|pipewire-pulse}} user service. | The above steps may be repeated for {{Ic|pipewire-pulse}} user service. | ||
Note | {{Note|The {{ic|pipewire-pulse}} user service would be required to enable various functions, including setting audio levels with {{ic|pactl}}, when [[PulseAudio#PulseAudio_Utils|running pulseaudio with pulseaudio-utils]] and to enable associated volume user keys.}} | ||
=== pipewire-launcher === | === pipewire-launcher === | ||
{{Note|The pipewire-launcher script will be removed in the future to be replaced with [[#PipeWire user | {{Note|The {{Ic|pipewire-launcher}} script will be removed in the future to be replaced with the [[#PipeWire_user_service|PipeWire user service]].}} | ||
Launch PipeWire by using the <code>pipewire-launcher</code> script. You'll probably get quite a few errors but just ignore them for now. | |||
{{Cmd|$ /usr/libexec/pipewire-launcher}} | |||
If | If xinitrc is used, add {{Path|/usr/libexec/pipewire-launcher}} to your {{Path|~/.xinitrc}}. | ||
If you do not use GUI by default, add the following stanza to your shell configuration file:{{Cmd|export $(dbus-launch) | If you do not use GUI by default, add the following stanza to your shell configuration file: | ||
{{Cmd|export $(dbus-launch) | |||
/usr/libexec/pipewire-launcher}} | /usr/libexec/pipewire-launcher}} | ||
| Line 100: | Line 111: | ||
* Enable and start bluetooth service: <code>rc-update add bluetooth; rc-service bluetooth start</code> | * Enable and start bluetooth service: <code>rc-update add bluetooth; rc-service bluetooth start</code> | ||
* Restart PipeWire | * Restart PipeWire | ||
* Use commandline program | * Use commandline program <code>bluetoothctl</code> or GUI program <code>blueman-manager</code> to scan and pair bluetooth audio devices. | ||
* Use pavucontrol to adjust volume and manually select high definition bluetooth codecs. | * Use pavucontrol to adjust volume and manually select high definition bluetooth codecs. | ||
| Line 123: | Line 134: | ||
== Testing == | == Testing == | ||
Use the <code>wpctl</code> utility from {{Pkg|wireplumber}} to test the working of PipeWire: {{Cmd|$ wpctl status}} | Use the <code>wpctl</code> utility from {{Pkg|wireplumber}} to test the working of PipeWire: | ||
{{Cmd|$ wpctl status}} | |||
=== pw-cat playback === | === pw-cat playback === | ||
| Line 159: | Line 172: | ||
=== `wpctl status` shows no targets === | === `wpctl status` shows no targets === | ||
First, check whether ALSA knows about your sound card using the <code>aplay</code> utility from {{pkg|alsa-utils}} package: {{Cmd|aplay -l}} | First, check whether ALSA knows about your sound card using the <code>aplay</code> utility from {{pkg|alsa-utils}} package: | ||
{{Cmd|$ aplay -l}} | |||
If sound devices are found, the issue is likely with your PipeWire configuration. Ensure that [[ | If sound devices are found, the issue is likely with your PipeWire configuration. Ensure that [[eudev]] is installed, and consider double-checking the instructions above. | ||
If no sound devices are found, 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: | If no sound devices are found, 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: | ||
{{Cmd|uname -r | {{Cmd|$ uname -r | ||
cat /proc/asound/card0/codec* | $ cat /proc/asound/card0/codec* {{!}} grep Codec}} | ||
Modern devices might require {{Pkg|sof-firmware}}, which is the case if you get <code>sof firmware file is missing</code> errors in dmesg. | Modern devices might require {{Pkg|sof-firmware}}, which is the case if you get <code>sof firmware file is missing</code> errors in dmesg. | ||
| Line 176: | Line 191: | ||
=== Connection failure: Connection refused === | === Connection failure: Connection refused === | ||
When using [[Wayland]], ensure that [[XDG_RUNTIME_DIR]] is configured correctly. If this is not set, PipeWire will create a directory in your home folder instead, called {{Path|~/pulse}}, and on attempting to run | When using [[Wayland]], ensure that [[Wayland#XDG_RUNTIME_DIR|XDG_RUNTIME_DIR]] is configured correctly. If this is not set, PipeWire will create a directory in your home folder instead, called {{Path|~/pulse}}, and on attempting to run {{Ic|pavucontrol}} or {{Ic|pactl}}, you will get the following error: | ||
{{Cmd|$ pactl list | |||
$ pactl list | |||
Connection failure: Connection refused | Connection failure: Connection refused | ||
pa_context_connect() failed: Connection refused | pa_context_connect() failed: Connection refused}} | ||
If you are running Alpine 3.22+ and continue to experience this error after verifying that [[XDG_RUNTIME_DIR]] is correctly set, ensure that the <code>pipewire-pulse</code> [[#PipeWire_user_service|user service is running]]. | If you are running Alpine 3.22+ and continue to experience this error after verifying that [[Wayland#XDG_RUNTIME_DIR|XDG_RUNTIME_DIR]] is correctly set, ensure that the <code>pipewire-pulse</code> [[#PipeWire_user_service|user service is running]]. | ||
=== Bluetooth connect failed: br-connection-profile-unavailable === | === Bluetooth connect failed: br-connection-profile-unavailable === | ||
| Line 192: | Line 205: | ||
=== Play/Pause buttons not working on bluetooth headphones === | === Play/Pause buttons not working on bluetooth headphones === | ||
Check {{Path|/var/log/messages}} | Check {{Path|/var/log/messages}} for lines similar to: | ||
bluetoothd[3463]: profiles/audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2) | {{Cat|/var/log/messages|bluetoothd[3463]: profiles/audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2) | ||
bluetoothd[3463]: profiles/audio/avctp.c:init_uinput() AVRCP: failed to init uinput for WH-1000XM5 | bluetoothd[3463]: profiles/audio/avctp.c:init_uinput() AVRCP: failed to init uinput for WH-1000XM5}} | ||
Then bluez is trying to register the headphones buttons as an input devices, but <code>uinput</code> is not loaded. Try <code>modprobe uinput</code>. If this works, see [[Architecture# | Then {{Ic|bluez}} is trying to register the headphones buttons as an input devices, but <code>uinput</code> is not loaded. Try <code>modprobe uinput</code>. If this works, see [[Architecture#Loading_of_Kernel_Modules|Loading of Kernel Modules]] for instructions on how to make sure this module is loaded automatically on each startup. | ||
=== RTKit error: org.freedesktop.DBus.Error.ServiceUnknown === | === RTKit error: org.freedesktop.DBus.Error.ServiceUnknown === | ||
mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown | |||
mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown | mod.rt ../src/modules/module-rt.c:995:do_rtkit_setup: RTKit does not give us MaxRealtimePriority, using 1 | ||
mod.rt ../src/modules/module-rt.c:995:do_rtkit_setup: RTKit does not give us MaxRealtimePriority, using 1 | mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown | ||
mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown | mod.rt ../src/modules/module-rt.c:1000:do_rtkit_setup: RTKit does not give us MinNiceLevel, using 0 | ||
mod.rt ../src/modules/module-rt.c:1000:do_rtkit_setup: RTKit does not give us MinNiceLevel, using 0 | mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown | ||
mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown | mod.rt ../src/modules/module-rt.c:1005:do_rtkit_setup: RTKit does not give us RTTimeUSecMax, using -1 | ||
mod.rt ../src/modules/module-rt.c:1005:do_rtkit_setup: RTKit does not give us RTTimeUSecMax, using -1 | |||
Installing the {{pkg|rtkit}} package as mentioned in [[#Realtime scheduling|Realtime scheduling]] section resolves the above error message. | Installing the {{pkg|rtkit}} package as mentioned in [[#Realtime scheduling|Realtime scheduling]] section resolves the above error message. | ||
| Line 219: | Line 229: | ||
* [https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home PipeWire Wiki] | * [https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home PipeWire Wiki] | ||
* [https://wiki.archlinux.org/index.php/PipeWire PipeWire on the ArchWiki] | * [https://wiki.archlinux.org/index.php/PipeWire PipeWire on the ArchWiki] | ||
* [https://wiki.gentoo.org/wiki/ | * [https://wiki.gentoo.org/wiki/PipeWire PipeWire on the Gentoo Wiki] | ||
[[Category:Sound]] | [[Category:Sound]] | ||
Latest revision as of 00:05, 17 November 2025
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.
Prerequisites
- PipeWire requires D-Bus session bus for most of its functionality.
- Ensure that your non-root user account has appropriate groups for desktop usage.
- WirePlumber requires eudev for ALSA device discovery.
Installation
Install pipewire and wireplumber (session manager).
# apk add pipewire wireplumber
Pulseaudio interface
The package pipewire-pulse allows pulseaudio applications and GUI tools to use PipeWire as audio server in the backend.
# apk add pipewire-pulse
JACK compatibility
Since PipeWire replaces JACK, Install pipewire-jack package, so it provides ABI-compatible libraries for JACK applications.
# apk add pipewire-jack
ALSA support
Install pipewire-alsa package to provide support for ALSA applications.
# apk add pipewire-alsa
GUI tools
- pavucontrol: simple GUI app for controlling sound, outputs, etc. Consider using pavucontrol-qt when using Plasma.
- Pulseaudio interface is mandatory for
pavucontrolto work with PipeWire.
- xfce4-mixer: XFCE Audio mixer.
- Currently available in the testing repository.
- qpwgraph: graph manager dedicated to PipeWire with Qt GUI Interface.
Launch PipeWire
Most desktop environments launch PipeWire automatically in Alpine Linux upon relogging (i.e. logging out and logging in) after installing the above packages. Proceed with the section below only if PipeWire is not launched after a relogin/reboot.
PipeWire user service
Since Alpine 3.22, PipeWire can be launched as a user service.
User service prerequisites
- Ensure the OpenRC User service Prerequisites are met and environment variables are configured.
- Issue the command
$ rc-status -Urto view and verify the current user runlevel as gui and default for Wayland and Xorg respectively.
User service management
To start the pipewire user service and its wireplumber session manager:
$ rc-service -U pipewire start $ rc-service -U wireplumber start
To enable the pipewire and wireplumber user services in Wayland, in Xorg change gui to default:
$ rc-update -U add pipewire gui $ rc-update -U add wireplumber gui
The above steps may be repeated for pipewire-pulse user service.
pipewire-pulse user service would be required to enable various functions, including setting audio levels with pactl, when running pulseaudio with pulseaudio-utils and to enable associated volume user keys.pipewire-launcher
pipewire-launcher script will be removed in the future to be replaced with the PipeWire user service.Launch PipeWire by using the pipewire-launcher script. You'll probably get quite a few errors but just ignore them for now.
$ /usr/libexec/pipewire-launcher
If xinitrc is used, add /usr/libexec/pipewire-launcher to your ~/.xinitrc.
If you do not use GUI by default, add the following stanza to your shell configuration file:
export $(dbus-launch) /usr/libexec/pipewire-launcher
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
Screen sharing on Wayland
Applications which don't implement native Wayland screensharing rely on xdg-desktop-portal plus the correct backend for your compositor. Screen sharing is known to work on:
- GNOME with
xdg-desktop-portal-gtk - KDE Plasma with
xdg-desktop-portal-kdeand Firefox - Sway with
xdg-desktop-portal-wlrand Firefox, see Sway for details
Bluetooth audio
- 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
bluetoothctlor GUI programblueman-managerto scan and pair bluetooth audio devices. - Use pavucontrol to adjust volume and manually select high definition bluetooth codecs.
Video
Video should work out-of-the-box with v4l2 devices (e.g. a lot of webcams) and GStreamer applications.
Realtime scheduling
For realtime scheduling, it is recommended to use rtkit package. 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):
@pipewire - memlock 4194304 @pipewire - nice -19 @pipewire - rtprio 95
This allows a member of the pipewire group to have the right permissions for PipeWire to use realtime scheduling without rtkit. 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 /etc/security/limits.conf will only work if your session is using PAM.
Testing
Use the wpctl utility from wireplumber to test the working of PipeWire:
$ wpctl status
pw-cat playback
Test sound is working using an audio file in a format supported by libsndfile
🔓 (e.g. flac, opus, ogg, wav). Use pw-cat utility from pipewire-tools:
$ pw-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.
$ pw-cat -r --list-targets $ pw-cat -r recording.flac (Speak for a while then stop it with Ctrl+c) $ pw-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:
$ jack_simple_client
You should hear a sustained beep.
Troubleshooting
`wpctl status` shows no targets
First, check whether ALSA knows about your sound card using the aplay utility from alsa-utils package:
$ aplay -l
If sound devices are found, the issue is likely with your PipeWire configuration. Ensure that eudev is installed, and consider double-checking the instructions above.
If no sound devices are found, 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/codec* | grep Codec
Modern devices might require sof-firmware, which is the case if you get sof firmware file is missing errors in dmesg.
Error acquiring bus address: Cannot autolaunch D-Bus without X11 $DISPLAY
Check and ensure that D-Bus session bus is started along with your GUI session i.e. you are in a tty.
Connection failure: Connection refused
When using Wayland, ensure that XDG_RUNTIME_DIR is configured correctly. 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:
$ pactl list Connection failure: Connection refused pa_context_connect() failed: Connection refused
If you are running Alpine 3.22+ and continue to experience this error after verifying that XDG_RUNTIME_DIR is correctly set, ensure that the pipewire-pulse user service is running.
Ensure wireplumber, the session manager, is running.
Play/Pause buttons not working on bluetooth headphones
Check /var/log/messages for lines similar to:
Contents of /var/log/messages
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 Loading of Kernel Modules for instructions on how to make sure this module is loaded automatically on each startup.
RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown mod.rt ../src/modules/module-rt.c:995:do_rtkit_setup: RTKit does not give us MaxRealtimePriority, using 1 mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown mod.rt ../src/modules/module-rt.c:1000:do_rtkit_setup: RTKit does not give us MinNiceLevel, using 0 mod.rt ../src/modules/module-rt.c:330:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown mod.rt ../src/modules/module-rt.c:1005:do_rtkit_setup: RTKit does not give us RTTimeUSecMax, using -1
Installing the rtkit package as mentioned in Realtime scheduling section resolves the above error message.