蓝牙 HSP/HFP 不工作,但 A2DP 工作

蓝牙 HSP/HFP 不工作,但 A2DP 工作

我有一个 Broadcom 内置蓝牙适配器。它的型号是BCM20702A0 ( Vendor=0a5c ProdID=21e1 Rev=01.12),我能够运行 A2DP 功能,但无法运行 HSP/HFP 模式。我尝试过不同的固件和不同的配置,/etc/bluetooth/audio.conf但都没有成功。有人知道我能做什么吗?我在谷歌上搜索了又搜索,尝试了各种方法,持续了两个小时。我想让你们这些大师试一试。以下是我的系统详细信息,如果您还有其他需要,请告诉我。

dylan@laptop:~$ uname -a
Linux laptop 3.19.0-20-generic #20-Ubuntu SMP Fri May 29 10:10:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


dylan@laptop:~$ dmesg | grep Bluetooth
[    4.179038] Bluetooth: Core ver 2.20
[    4.179051] Bluetooth: HCI device and connection manager initialized
[    4.179054] Bluetooth: HCI socket layer initialized
[    4.179056] Bluetooth: L2CAP socket layer initialized
[    4.179060] Bluetooth: SCO socket layer initialized
[    5.501272] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    5.501275] Bluetooth: BNEP filters: protocol multicast
[    5.501281] Bluetooth: BNEP socket layer initialized
[    5.508181] Bluetooth: RFCOMM TTY layer initialized
[    5.508188] Bluetooth: RFCOMM socket layer initialized
[    5.508193] Bluetooth: RFCOMM ver 1.11

USB-DEVICES...
T:  Bus=04 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0a5c ProdID=21e1 Rev=01.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM20702A0
S:  SerialNumber=083E8E9B280C
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)


dylan@laptop:~$ dkms status; uname -a
bcmwl, 6.30.223.248+bdcom, 3.19.0-16-generic, x86_64: installed
bcmwl, 6.30.223.248+bdcom, 3.19.0-18-generic, x86_64: installed
bcmwl, 6.30.223.248+bdcom, 3.19.0-20-generic, x86_64: installed
bcmwl, 6.30.223.248+bdcom, 3.19.0-21-generic, x86_64: installed
vboxhost, 4.3.28, 3.19.0-16-generic, x86_64: installed
vboxhost, 4.3.28, 3.19.0-18-generic, x86_64: installed
vboxhost, 4.3.28, 3.19.0-20-generic, x86_64: installed
vboxhost, 4.3.28, 3.19.0-21-generic, x86_64: installed
Linux laptop 3.19.0-21-generic #21-Ubuntu SMP Sun Jun 14 18:31:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


dylan@laptop:~$ dmesg | grep -i bluetooth; dmesg | grep firmware
[    4.085160] Bluetooth: Core ver 2.20
[    4.085171] Bluetooth: HCI device and connection manager initialized
[    4.085175] Bluetooth: HCI socket layer initialized
[    4.085176] Bluetooth: L2CAP socket layer initialized
[    4.085181] Bluetooth: SCO socket layer initialized
[    4.109764] bluetooth hci0: Direct firmware load for brcm/BCM20702A0-0a5c-21e1.hcd failed with error -2
[    4.109773] Bluetooth: hci0: BCM: patch brcm/BCM20702A0-0a5c-21e1.hcd not found
[    5.332794] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    5.332797] Bluetooth: BNEP filters: protocol multicast
[    5.332803] Bluetooth: BNEP socket layer initialized
[    5.346411] Bluetooth: RFCOMM TTY layer initialized
[    5.346419] Bluetooth: RFCOMM socket layer initialized
[    5.346425] Bluetooth: RFCOMM ver 1.11
[    4.109764] bluetooth hci0: Direct firmware load for brcm/BCM20702A0-0a5c-21e1.hcd failed with error -2

答案1

我会尝试这个:

wget https://www.dropbox.com/s/owropuric6iz898/BCM20702A0-05ac-21e1.hcd
sudo cp BCM20702A0-05ac-21e1.hcd /lib/firmware/brcm/BCM20702A0-0a5c-21e1.hcd
sudo modprobe -r btusb
sudo modprobe btusb

然后检查dmesg | tail任何信息:

sudo apt-get install linux-headers-$(uname -r) build-essential
wget https://www.dropbox.com/s/xu80svavlazttaf/bluetooth-3.19.tar.gz
tar xpvf bluetooth-3.19.tar.gz
cd bluetooth
cp /boot/config-$(uname -r) .config
cp /usr/src/linux-headers-$(uname -r)/Module.symvers Module.symvers
make -C /lib/modules/$(uname -r)/build M=$PWD modules
sudo cp btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth/
sudo modprobe -r btusb
sudo modprobe btusb

看看是否有效

内核更新后,您将丢失 HSP/HFP。发生这种情况时,您应该执行以下操作:

cd bluetooth
make -C /lib/modules/$(uname -r)/build M=$PWD clean
cp /boot/config-$(uname -r) .config
cp /usr/src/linux-headers-$(uname -r)/Module.symvers Module.symvers
make -C /lib/modules/$(uname -r)/build M=$PWD modules
sudo cp btusb.ko /lib/modules/$(uname -r)/kernel/drivers/bluetooth/
sudo modprobe -r btusb
sudo modprobe btusb

答案2

我的猜测是,这是一个 pulseaudio 的 bt 配置文件问题,除非它是更严重的问题。

安装并运行 pavucontrol ( apt-get install pavucontrol) 并转到最后一页(配置)检查蓝牙配置文件是否存在并尝试更改它。

我的 bt 音频配置是默认的,没有任何更改(ubuntu 14.04)/etc/bluetooth/audio.conf

现在,我刚刚用蓝牙耳机(a2dp 和 hsp 功能)测试了这些步骤,并且成功了。虽然不是最好的方法,但确实有效。

  1. 配对蓝牙设备
  2. 从配置页面检查pavucontrol配置文件是否为 HSP。
  3. 开始skype(我知道,但是用它测试很容易)
  4. 运行movesink.sh脚本
  5. 开始对 Skype 测试服务进行测试呼叫
  6. 从中选择录音选项卡pavucontrol,然后选择“Skype 输入来自”以匹配您的蓝牙设备。
  7. 说话并观察音量条是否移动。
  8. 如果出现问题,请重新启动呼叫并movesink.sh在测试呼叫期间运行

a) 检查bt设备名称:

pactl list sinks|grep Name
# or
pactl list sinks|grep card:

b) 使用该名称运行 movesinks.sh

./movesink.sh bluez_sink.48_C1_AC_C1_C3_85.hsp
# or
./movesink.sh bluez_sink.48_C1_AC_C1_C3_85

这是我编写的 movesink.sh 脚本。它将程序声音输出移动到您的 bt 设备(这不会自动将麦克风从集成移动到 bt-headset):

#!/bin/bash 
echo "Setting default sink to: $1";
# where new pa should output sound for new programs
pacmd set-default-sink $1
# get "active" programs and with while read
pactl list sink-inputs short |cut -f1 | while read line    
do
echo "Moving input: ";
echo $line
#| cut -f2 -d' ';
echo "to sink: $1";
#  move audio to the newly assigned output.
pacmd move-sink-input `echo $line | cut -f2 -d' '` $1

done

希望这能验证您的设置是否有效。(我以前有一个键绑定,它与 bt 耳机配对,将输入移至该键绑定,当我再次使用它时,它会恢复该设置。)

您可以使用以下命令将主音频恢复为默认设置:

./movesink.sh alsa_output.pci-0000_00_1b.0.analog-stereo
# or
./movesink.sh alsa_output.pci-0000_00_1b.0

相关内容