PulseAudio无法加载蓝牙模块。

我在新安装的15.10版本(编辑:16.04版本也适用)中遇到了连接蓝牙音箱的问题。音箱已经连接上了,但是它们没有显示在可用的音频设备列表中。
我尝试使用以下命令加载蓝牙模块:
sudo pactl load-module module-bluetooth-discover
Failure: Module initialization failed

同样的扬声器在14.04上运行得很好。有什么办法可以正确加载模块,这样我就可以使用我的扬声器了吗?

1我已经将您在问题的一部分中发布的解决方案提取出来,作为一个单独的答案。请随意使用您的账户重新发布这个答案(以获得相应的声望),或者将其与您当前的答案整合在一起。然后请通知我,以便我可以删除我的答案。另请参阅我们如何处理这个实际上是答案的问题? - Melebius
3个回答

this帖子中,通过使用SimFox3的答案解决了。

Bug and possible solution: actually I found a bug in that make the headset unusable, it seems that the pulse audio module: module-bluetooth-discover works only if started after the X11 session is up. So I have a workaround.

Edit the file:

/etc/pulse/default.pa

and comment out (with an # at the beginning of the line) the following line:

#load-module module-bluetooth-discover

now edit the file:

/usr/bin/start-pulseaudio-x11

and after the lines:

   if [ x”$SESSION_MANAGER” != x ] ; then
        /usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null
    fi

add the following line:

    /usr/bin/pactl load-module module-bluetooth-discover

This way the Pulse audio’s Bluetooth modules will not be downloaded at boot time but after x11 is started.


2你是我的英雄!你在某个地方提交了这个作为一个错误报告吗?这个方法对我有用。 - select
也适用于我 - 这是便宜而实用的Lidl蓝牙SBL 4.1,之前在Linux上搜索时没有出现。干得好 +1! - Mark Williams
3它也适用于16.04版本,信不信由你,这个bug仍然存在,似乎没有人打算修复它。 - Zippp
我在Debian Testing (stretch)上遇到了同样的问题,它解决了。谢谢! - Black-Pixel
1太棒了!在Debian 9中遇到了同样的问题,也有了同样的解决方案... - Marlord
3有没有关于这个的上游或发行版的错误报告?我似乎无法在Ubuntu、Debian或上游找到它... - bk138
很酷。运作得非常顺利。 - Viacheslav Dobromyslov
对我来说没用,我仍然遇到错误:连接失败:blueman.bluez.errors.DBusFailedError:协议不可用。 - Aniket Tiwari
尝试了很多方法,终于找到了解决办法!使用的是Debian系统。为什么在Debian和Ubuntu发行版上这个问题还没有得到解决呢?毕竟每天都有很多人使用蓝牙音频设备啊! - L. G.
真的非常感谢你,兄弟。我可以确认这个方法在Debian 9 Stretch上也有效 :) - Amir El-Bashary
嗯……那些使用Wayland的人怎么办? - Joshua Robison

16.10的解决方案是:
$ sudo apt install bluetooth pulseaudio-module-bluetooth

这个答案最初是作为对问题的编辑发布的。

谢谢,重新安装确实是必要的。 - Alex Botev

有时候,重启后问题会解决,但之后可能会再次出现。在这种情况下,你可以尝试以下方法,对我来说很有效:
pactl unload-module  module-bluetooth-discover
pactl   load-module  module-bluetooth-discover

1这里似乎卸载是关键。仅仅加载(如其他地方所建议)会导致一个错误,在加载时失败。但我无法通过sudo运行它 - 但在没有sudo的情况下它可以正常工作。 - Zoe stands with Ukraine
1这也是在19.10版本中必须完成的任务。 - Rqomey
这在18.04版本下也有效! - parsethis
这完全解决了我的问题。Linux Mint 18.3(Sylvia)。蓝牙连接只有一半。 - brad