openSUSE:Pipewire
用法
当用于处理音频时,PipeWire 在 ALSA 内核基础设施之上工作,就像 PulseAudio 或 JACK 一样,并且可以提供 PulseAudio、JACK 甚至仅 ALSA 应用程序的兼容层。相应的支持包命名如下
pipewire-pulseaudio pipewire-jack pipewire-alsa
它还用于为视频会议应用程序提供 Wayland 下的屏幕捕获支持。因此,Gnome 和 KDE DE 桌面环境现在默认使用它。
PipeWire 提供了一个 systemd 用户服务和 socket。systemd socket 单元默认启用,因此当需要时服务会自动启动,这通常就足够了。无论如何,要手动启动服务,可以使用
WirePlumber 是 PipeWire 的会话/策略管理器,应该与其一起运行。与 PipeWire 一样,WirePlumber 服务默认启用,因此无需手动启动它,但如果需要也可以启动/停止它:
该服务默认将使用 main WirePlumber 配置文件,但可以通过在 /etc/wireplumbler.env 中设置 WIREPLUMBER_PROFILE 环境变量来配置它,以使用所有用户默认要使用的配置文件。或者,也可以使用 wireplumber@ 用户服务代替 wireplumber 服务。
安装
PipeWire 可从主要的 openSUSE 仓库获得,名为 pipewire。它默认安装时不带音频支持,在 openSUSE Leap 中。为了启用它并将 PipeWire 用作音频引擎(替换 Leap 中的默认音频引擎 PulseAudio),需要安装 pipewire-pulseaudio 包。确保删除 wireplumber-video-only-profile,否则最终只会得到一个虚拟音频设备。要安装它,请使用
这将安装 pipewire-pulseaudio 和 wireplumber-audio 包。如果安装了 pulseaudio,zypper 会向您发出如下警告消息:
Problem: the installed pulseaudio-15.0-150400.2.10.x86_64 conflicts with 'pulseaudio-daemon' provided by the to be installed pipewire-pulseaudio-0.3.49-150400.1.5.x86_64 Solution 1: Following actions will be done: deinstallation of pulseaudio-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-gdm-hooks-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-lang-15.0-150400.2.10.noarch deinstallation of pulseaudio-module-bluetooth-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-module-gsettings-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-module-jack-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-module-lirc-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-module-x11-15.0-150400.2.10.x86_64 deinstallation of pulseaudio-module-zeroconf-15.0-150400.2.10.x86_64 deinstallation of alsa-plugins-pulse-1.2.6-150400.1.10.x86_64 Solution 2: do not install pipewire-pulseaudio-0.3.49-150400.1.5.x86_64
您应该选择方案 1(卸载 pulseaudio)。
安装完成后,重新启动计算机。此后,pipewire-pulse socket 单元应自动启用并处于活动状态,这将使 PulseAudio 应用程序认为 PulseAudio 正在运行,而实际上使用的是 PipeWire。
工具
此外,pipewire-tools 也可以使用。此包包含许多用于使用 PipeWire 的工具。
pw-cat 包含一组使用 PipeWire 本机播放和录制媒体的工具。pw-play 和 pw-midiplay 用于播放音频和 MIDI 文件,pw-record 和 pw-recordmidi 用于录制原始音频和 MIDI 数据。
pw-cli 是一个命令行界面 (CLI),用于加载和删除模块、列出实例中的对象和设备、连接到并与 PipeWire 管理的节点和链接的远程实例进行交互。
pw-dot 将 PipeWire 图形提示为 .dot 格式的文件。可以使用以下命令读取它:
dot -Tpng file.dot -o output.png
注意:dot 工具由 graphviz 包提供。
pw-dump 与 pw-dot 相同,但它将提示输出到标准输出而不是文件。
pw-mon 是 PipeWire 的监视器,用于监视 pipewire 实例中的对象。
pw-profiler:加载 profiler 模块后,连接并记录来自本地/远程实例的数据。可以执行此程序如下:
选项 -o 是可选的,默认情况下,程序输出到 profiler.log。
停止程序后,它将使用 gnuplot 生成一个 .svg 文件以及一个 .html 文件,以便更好地从浏览器中查看配置文件。
WirePlumber 是 PipeWire 的模块化会话/策略管理器,以下命令提供有关活动客户端、设备、sink、source 和流的有用状态信息。
更多信息
https://pipewire.pages.freedesktop.org/wireplumber/index.html
https://wiki.archlinux.org.cn/title/WirePlumber
JACK 兼容性
要安装 JACK 兼容层,请使用
如果 zypper 显示冲突是因为安装了 jack,请选择卸载它的选项。安装完包后,JACK 应用程序将像系统上正在运行 JACK 守护程序一样与 PipeWire 一起工作。
如何用 PulseAudio 替换 PipeWire?
要返回使用 PulseAudio 而不是 PipeWire,只需使用以下命令安装 pulseaudio 包:
zypper install pulseaudio
并重新启动计算机。这将重新启用 pulseaudio 自动。
请注意,当您使用 pulseaudio 管理音频时,仍然希望在系统中也使用 PipeWire,因为它负责其他事情,例如屏幕共享应用程序的屏幕捕获等。由于同时打开两个音频管理器可能会导致问题,因此当安装了 pulseaudio 时,PipeWire 不应这样做。在 Tumbleweed(自 20250515 起)和 Leap 16 中,这由 wireplumber-video-only-profile 包管理。此包为 wireplumber 用户服务设置一个环境变量,告诉它使用 video-only 配置文件而不是 main。在 Leap 15 和旧 Tumbleweed 系统(直到 20250514)上,情况相反:wireplumber 包本身会禁用音频支持,而安装 wireplumber-audio 包则会在 PipeWire/WirePlumber 中启用音频支持。
如何禁用 PipeWire 并使用纯 ALSA?
您可能希望使用 PipeWire 或 PulseAudio,但如果您想使用纯 ALSA,请执行以下操作:
systemctl --user disable --now pipewire.{socket,service}
systemctl --user disable --now pipewire.{socket,service}
rm /etc/alsa/conf.d/99-pipewire-default.conf /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf
并且要恢复它,请执行以下操作:
zypper in -f pipewire
systemctl --user enable --now pipewire.{socket,service}