AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1333404
Accepted
user5950
user5950
Asked: 2021-04-24 04:36:33 +0800 CST2021-04-24 04:36:33 +0800 CST 2021-04-24 04:36:33 +0800 CST

如何在 Ubuntu 21.04 上用 pipewire 替换 pulseaudio?

  • 772

由于 Ubuntu 21.04 默认包含用于视频流和屏幕共享的 pipewire,我想知道是否可以用 pipewire 完全替换 pulseaudio。

sound
  • 4 4 个回答
  • 38116 Views

4 个回答

  • Voted
  1. Best Answer
    user5950
    2021-04-24T04:36:33+08:002021-04-24T04:36:33+08:00

    确实,这是可能的,而且相当简单,只需按照Debian 文档中描述的步骤进行操作:

    首先安装 pipewire-audio-client-libraries 包。

    sudo apt install pipewire-audio-client-libraries
    

    创建这个空文件:

    touch /etc/pipewire/media-session.d/with-pulseaudio
    

    通过复制示例文件创建 pipewire-pulse 服务:

    cp /usr/share/doc/pipewire/examples/systemd/user/pipewire-pulse.* /etc/systemd/user/
    

    以您的普通用户(而不是 root)运行这三个命令:

    // Check for new service files with:
    systemctl --user daemon-reload
    // Disable and stop the PulseAudio service with:
    systemctl --user --now disable pulseaudio.service pulseaudio.socket
    // Enable and start the new pipewire-pulse service with:
    systemctl --user --now enable pipewire pipewire-pulse
    

    您可以检查哪个服务器正在使用,作为您的普通用户,运行:

    pactl info | grep '^Server Name'
    

    如果使用 PipeWire,则服务器名称将为“PulseAudio (On​​ PipeWire 0.3.19)”

    为了使它工作,我必须通过运行“屏蔽” PulseAudio 服务:

    systemctl --user mask pulseaudio
    

    然后重新启动 PipeWire 服务:

    systemctl --user restart pipewire pipewire-pulse
    

    这将阻止 PulseAudio 服务被完全激活。如果您希望恢复以前的功能,则需要使用“取消屏蔽”操作再次运行相同的命令。

    • 37
  2. Sourav Das
    2021-04-27T09:51:43+08:002021-04-27T09:51:43+08:00

    Arch用户在这里。但喜欢 PipeWire。在所有 debian/Ubuntu{18..21}.{04,10}下,PW 版本太旧了。这就是为什么我要维护一个PPA,它将提供 PipeWire 的最新版本(15-16 天的发布周期)。您可以在github上跟踪 此 PPA 的最新更改。

    在 arch linux 上,这个过程是通过包的 *.install 文件下的 {pre,post}_{install,upgrade,remove} 函数获得的。

    而在 Ubuntu/Debian 下会通过一些简单的{pre,post}{inst,rm}脚本来实现。我肯定会在下一个版本中更新这些。这已经完成了。

    编辑 1 -
    有关详细的安装说明,请遵循 github wiki。

    使用 PipeWire 我也在打包blueman-git(blueman 的 git 版本)。它具有一些与 PipeWire 一起使用的严重需要的功能。不用担心它也不会破坏任何东西,而是将您的生产力提高到更高的水平。

    编辑 2 -
    Launchpad PPA 将在基于所有debian/ubuntu的发行版下工作。不用担心!安装它,测试它并将错误提交到上游,以帮助它的开发人员使 PipeWire 变得更好。

    编辑 3 -
    现在PipeWire 0.3.27和病房也将支持debian/ubuntu 18.04。

    • 13
  3. Karol Wasowski
    2022-02-06T04:58:57+08:002022-02-06T04:58:57+08:00

    在 Ubuntu 21.10 上

    首先安装缺少的 PipeWire 包:

    sudo apt install pipewire-pulse pipewire-audio-client-libraries

    如果您想让蓝牙音频正常工作,您还需要安装:

    sudo apt install libspa-0.2-bluetooth

    之后随意禁用pulseaudio并启用运行这些命令的PipeWire(没有root):

    // Disable and stop the PulseAudio service with:
    systemctl --user --now disable pulseaudio.service pulseaudio.socket
    // Enable and start the new pipewire-pulse service with:
    systemctl --user --now enable pipewire pipewire-pulse
    

    就是这样!您可以通过运行确认一切正常:

    pactl info | grep '^Server Name'

    输出应该与此类似:

    Server Name: PulseAudio (on PipeWire 0.3.32)

    重启 Pipewire 服务

    systemctl --user restart pipewire pipewire-pulse

    • 7
  4. Sjoer van der Ploeg
    2021-05-07T08:01:39+08:002021-05-07T08:01:39+08:00

    您需要编辑:/etc/pipewire/media-session.d/media-session.conf

    并且至少alsa-monitor在session.modules.

    • -2

相关问题

  • 从网络广播录制声音

  • 播放声音时延迟

  • 5.1环绕声[关闭]

  • 声音,在多个程序之间停止

  • 即使插入耳机,我的扬声器也会发出声音[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve