openSUSE:Pipewire

跳转到:导航搜索
PipeWire 是由 Wim Taymans 开发的,作为 GNOME 项目的一部分,基于图形的音频和视频处理引擎。它旨在与容器和 flatpak 应用程序协同工作。它的目标是与 Wayland 一起作为 ALSA 之上的音频系统。

用法

当用于处理音频时,PipeWire 在 ALSA 内核基础设施之上工作,就像 PulseAudio 或 JACK 一样,并且可以提供 PulseAudio、JACK 甚至仅 ALSA 应用程序的兼容层。相应的支持包命名如下

pipewire-pulseaudio
pipewire-jack
pipewire-alsa

它还用于为视频会议应用程序提供 Wayland 下的屏幕捕获支持。因此,Gnome 和 KDE DE 桌面环境现在默认使用它。

PipeWire 提供了一个 systemd 用户服务和 socket。systemd socket 单元默认启用,因此当需要时服务会自动启动,这通常就足够了。无论如何,要手动启动服务,可以使用

systemctl --user start pipewire.service

WirePlumber 是 PipeWire 的会话/策略管理器,应该与其一起运行。与 PipeWire 一样,WirePlumber 服务默认启用,因此无需手动启动它,但如果需要也可以启动/停止它:

systemctl --user start wireplumber.service

该服务默认将使用 main WirePlumber 配置文件,但可以通过在 /etc/wireplumbler.env 中设置 WIREPLUMBER_PROFILE 环境变量来配置它,以使用所有用户默认要使用的配置文件。或者,也可以使用 wireplumber@ 用户服务代替 wireplumber 服务。


安装

PipeWire 可从主要的 openSUSE 仓库获得,名为 pipewire。它默认安装时不带音频支持,在 openSUSE Leap 中。为了启用它并将 PipeWire 用作音频引擎(替换 Leap 中的默认音频引擎 PulseAudio),需要安装 pipewire-pulseaudio 包。确保删除 wireplumber-video-only-profile,否则最终只会得到一个虚拟音频设备。要安装它,请使用

zypper in pipewire-pulseaudio -wireplumber-video-only-profile
自 20220708 openSUSE Tumbleweed 发布以来,新安装使用 PipeWire 作为默认音频引擎,而不是 PulseAudio,因此无需进行任何手动安装。请注意,从以前的版本升级系统不会自动替换 PulseAudio,因为这对已安装的系统来说过于激进,因此在这种情况下,您需要像在 Leap 中一样启用音频支持。

这将安装 pipewire-pulseaudiowireplumber-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-playpw-midiplay 用于播放音频和 MIDI 文件,pw-recordpw-recordmidi 用于录制原始音频和 MIDI 数据。

pw-cli 是一个命令行界面 (CLI),用于加载和删除模块、列出实例中的对象和设备、连接到并与 PipeWire 管理的节点和链接的远程实例进行交互。

pw-dot 将 PipeWire 图形提示为 .dot 格式的文件。可以使用以下命令读取它:

pw-dot -o file.dot
dot -Tpng file.dot -o output.png

注意:dot 工具由 graphviz 包提供。

pw-dump 与 pw-dot 相同,但它将提示输出到标准输出而不是文件。

pw-mon 是 PipeWire 的监视器,用于监视 pipewire 实例中的对象。

pw-mon

pw-profiler:加载 profiler 模块后,连接并记录来自本地/远程实例的数据。可以执行此程序如下:

pw-profiler -o name

选项 -o 是可选的,默认情况下,程序输出到 profiler.log

停止程序后,它将使用 gnuplot 生成一个 .svg 文件以及一个 .html 文件,以便更好地从浏览器中查看配置文件。

WirePlumber 是 PipeWire 的模块化会话/策略管理器,以下命令提供有关活动客户端、设备、sink、source 和流的有用状态信息。

wpctl status

更多信息

https://pipewire.pages.freedesktop.org/wireplumber/index.html

https://wiki.archlinux.org.cn/title/WirePlumber



JACK 兼容性

Icon-warning.png
警告: 两个兼容包(用于 PulseAudio 和 JACK)分别与 PulseAudio 和 JACK 冲突,因此只能同时安装每个官方守护程序或兼容层,并且安装的内容将是使用内容。也可以同时安装两个兼容包,以便 PulseAudio 和 JACK 应用程序可以通过 PipeWire 一起工作。

要安装 JACK 兼容层,请使用

zypper in pipewire-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}



外部链接