更新到16.04后,蓝牙音频A2DP模式停止工作

我有一个很好的蓝牙音频接收器连接到我的HiFi立体声,我曾经能够在14.04连接它作为A2DP接收器,质量很好。

升级到16.04后,设备仅作为耳机连接,当尝试在A2DP模式下切换时,我的系统日志中出现此错误:

May 21 11:35:50 RRyS pulseaudio[6159]: [pulseaudio] module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected 

音频质量很好。 我该如何解决?

对我有用的是连接蓝牙设备,切换到HSP / HFP模式,断开连接,重新连接,然后切换到A2DP模式。

关于这个有几个错误,例如检查这个(从15.05开始)和另一个,相当老 ; 一般的原因尚不清楚。

在开始修改系统文件之前,您还可以在Ubuntu 16.04中检查蓝牙扬声器没有声音 (似乎是一个不同的错误),并且A2DP蓝牙在16.04上不起作用 (通过内核升级在注释中解决)。

对我有用的修复如下 – 感谢启动板中的用户RobertFM和Arch论坛中的SimFox3 。 必须从root shell( sudo -i )执行以下所有指令。 保重和三重检查。

  1. 首先,备份这些文件(你永远不知道):

     cp /etc/bluetooth/audio.conf /etc/bluetooth/audio.conf.bak cp /etc/pulse/default.pa /etc/pulse/default.pa.bak cp /usr/bin/start-pulseaudio-x11 /usr/bin/start-pulseaudio-x11.bak 
  2. 编辑/etc/bluetooth/audio.conf并使其类似于这个:

     # Configuration file for the audio service # This section contains options which are not specific to any # particular interface [General] Enable=Gateway,Source # Switch to master role for incoming connections (defaults to true) Master=true # If we want to disable support for specific services # Defaults to supporting all implemented services #Disable=Gateway,Source,Socket Disable=Socket # SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA) # Defaults to HCI #SCORouting=HCI # Automatically connect both A2DP and HFP/HSP profiles for incoming # connections. Some headsets that support both profiles will only connect the # other one automatically so the default setting of true is usually a good # idea. AutoConnect=true # Headset interface specific options (ie options which affect how the audio # service interacts with remote headset devices) [Headset] # Set to true to support HFP, false means only HSP is supported # Defaults to true HFP=true # Maximum number of connected HSP/HFP devices per adapter. Defaults to 1 MaxConnected=2 # Set to true to enable use of fast connectable mode (faster page scanning) # for HFP when incoming call starts. Default settings are restored after # call is answered or rejected. Page scan interval is much shorter and page # scan type changed to interlaced. Such allows faster connection initiated # by a headset. FastConnectable=true # Just an example of potential config options for the other interfaces #[A2DP] #SBCSources=1 #MPEG12Sources=0 
  3. 编辑/etc/pulse/default.pa并注释掉该行

     #load-module module-bluetooth-discover 

    (你真的只需要在开始时添加#

  4. 编辑/usr/bin/start-pulseaudio-x11并在加载模块module-x11-xsmp后添加/usr/bin/pactl load-module module-bluetooth-discover module-x11-xsmp ; 在实践中,您应该编辑接近结尾的文件以具有类似的节

     if [ x"$SESSION_MANAGER" != x ] ; then /usr/bin/pactl load-module module-x11-xsmp "display=$DISPLAY session_manager=$SESSION_MANAGER" > /dev/null # add this line here: /usr/bin/pactl load-module module-bluetooth-discover fi 
  5. 重启。

    现在,您应该可以将设备设置为A2DP并享受高品质的音乐:

    声音设置

    请注意,有时您需要断开并重新连接设备以重新启用A2DP:

    蓝牙设备

    …是的,这是一堆错误。 但是当它工作时,它的工作效果非常好。

  6. 重启后出现问题

    在所有这些之后,有时候这个技巧似乎只在下次重启后才起作用。 在这种情况下,请尝试遵循rmfought的答案 :

    对我有用的是连接蓝牙设备,切换到HSP / HFP模式,断开连接,重新连接,然后切换到A2DP模式。

    …也适合我(有时候)。 我甚至不得不重新配对加密狗一次。

  7. 如果它仍然不起作用……

    如果这对您不起作用,您可以尝试使用此脚本 – 其作者保持最新状态。

对于那些需要麦克风的人来说,这不一定是一个解决方案,但这对我来说在Ubuntu 16.04中有效:

 sudo nano /etc/bluetooth/audio.conf 

然后在[General]下添加Disable=Headset

 [General] Disable=Headset 

并重新启动蓝牙服务

 sudo service bluetooth restart 

这个家伙的所有信誉: https : //jimshaver.net/2015/03/31/going-a2dp-only-on-linux/