蓝牙USB适配器5.0 0a12:0001在Ubuntu 20.04上无法正常工作。

无线USB适配器 - 蓝牙USB适配器 - 迷你5.0 - 版本5.48 - 0a12:0001
最近我买了一个蓝牙USB适配器 - 型号:MLT-5.0-MiNi
我正在使用Ubuntu 20.04.1 LTS。
1. 在我将适配器连接到USB端口后,我在终端中输入命令“lsusb”来检查端口,结果如下:
Bus 002 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

2. hciconfig -a 给出了以下结果:
hci0:   Type: Primary  Bus: USB
        BD Address: 00:1A:7D:DA:71:11  ACL MTU: 679:9  SCO MTU: 48:16
        DOWN
        RX bytes:574 acl:0 sco:0 events:30 errors:0
        TX bytes:368 acl:0 sco:0 commands:30 errors:0
        Features: 0xff 0xff 0x87 0xfa 0xdb 0xbf 0x7b 0x83
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF PARK 
        Link mode: SLAVE ACCEPT

3. hcitool dev:
Devices:

所以看起来我的电脑没有安装驱动程序。
4. bluetoothctl --version:
bluetoothctl: 5.53

5. rfkill:
ID TYPE      DEVICE      SOFT      HARD
0  bluetooth hci0   unblocked unblocked

6. 最后是 btmon:
Bluetooth monitor ver 5.53
Failed to bind channel: Operation not permitted

我找到了这个YouTube视频来解决问题。 1. 首先,我需要安装应用程序“Ubuntu Mainline Kernel Installer”以更新到最新的内核版本,所以我输入了:
sudo add-apt-repository ppa:cappelikan/ppa
sudo apt-get update
sudo apt-get install mainline

2. 然后,在更新到最新的内核版本之前,我需要检查当前运行的内核版本是什么:
User@PC:~$ uname -r
5.4.0-48-generic

User@PC:~$ uname -sr

Linux 5.4.0-48-generic
3. 后来我访问了 KERNEL的网站并检查了最新的稳定内核版本,例如:5.8.13。
毕竟,我打开了Ubuntu Mainline Kernel Installer应用程序,并单击最后一个稳定的内核版本,例如:5.8.13。最后单击“安装”按钮。 4. 安装和重启后,我再次检查: User@PC:~$ uname -r
5.8.13-050813-generic

用户@PC:~$ uname -sr

Linux 5.8.13-050813-generic

我看到它成功了,蓝牙USB DONGLE 5.0正在工作。

但是有一个连接问题在配对后:在将Ubuntu与我的扬声器5.0配对后,它无法连接,然后在将Ubuntu与我的智能手机LG配对后,我无法从Ubuntu向智能手机发送任何图片,反之亦然。

1. 我输入了systemctl status bluetooth并进入。

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2020-10-03 19:02:12 -05; 10min ago
       Docs: man:bluetoothd(8)
   Main PID: 2173 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 4649)
     Memory: 2.2M
     CGroup: /system.slice/bluetooth.service
             └─2173 /usr/lib/bluetooth/bluetoothd

oct 03 19:02:11 PC systemd[1]: Starting Bluetooth service...
oct 03 19:02:12 PC bluetoothd[2173]: Bluetooth daemon 5.53
oct 03 19:02:12 PC systemd[1]: Started Bluetooth service.
oct 03 19:02:12 PC bluetoothd[2173]: Starting SDP server
oct 03 19:02:12 PC bluetoothd[2173]: Bluetooth management interface 1.17 initialized
oct 03 19:02:13 PC bluetoothd[2173]: Failed to set mode: Blocked through rfkill (0x12)
oct 03 19:02:14 PC bluetoothd[2173]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSink/sbc
oct 03 19:02:14 PC bluetoothd[2173]: Endpoint registered: sender=:1.75 path=/MediaEndpoint/A2DPSource/sbc
oct 03 19:02:14 PC bluetoothd[2173]: Failed to set mode: Blocked through rfkill (0x12)

我看到有一个问题:

bluetoothd[2173]: Failed to set mode: Blocked through rfkill (0x12)

2. rfkill list:
1: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

3. hciconfig -a:
hci0:   Type: Primary  Bus: USB
    BD Address: 00:1A:7D:DA:71:11  ACL MTU: 679:9  SCO MTU: 48:16
    UP RUNNING PSCAN ISCAN 
    RX bytes:1174 acl:0 sco:0 events:65 errors:0
    TX bytes:1046 acl:0 sco:0 commands:65 errors:0
    Features: 0xff 0xff 0x87 0xfa 0xdb 0xbf 0x7b 0x83
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH HOLD SNIFF PARK 
    Link mode: SLAVE ACCEPT 
    Name: 'Daniel-MS-7529'
    Class: 0x1c0104
    Service Classes: Rendering, Capturing, Object Transfer
    Device Class: Computer, Desktop workstation
    HCI Version: 5.0 (0x9)  Revision: 0x810
    LMP Version: 5.0 (0x9)  Subversion: 0x2312
    Manufacturer: Cambridge Silicon Radio (10)

我看到一切都没问题。 4. btmon:
Bluetooth monitor ver 5.53
Failed to bind channel: Operation not permitted

5. sudo dmesg | grep -i bluetooth
[  132.146271] Bluetooth: Core ver 2.22
[  132.146302] Bluetooth: HCI device and connection manager initialized
[  132.146308] Bluetooth: HCI socket layer initialized
[  132.146310] Bluetooth: L2CAP socket layer initialized
[  132.146314] Bluetooth: SCO socket layer initialized
[  132.515401] Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds...
[  133.859424] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  133.859426] Bluetooth: BNEP filters: protocol multicast
[  133.859431] Bluetooth: BNEP socket layer initialized
[  135.263551] Bluetooth: RFCOMM TTY layer initialized
[  135.263561] Bluetooth: RFCOMM socket layer initialized
[  135.263570] Bluetooth: RFCOMM ver 1.11
[ 1017.955624] Bluetooth: hci0: inquiry failed: status 0x0c
[ 1023.331631] Bluetooth: hci0: inquiry failed: status 0x0c
[ 3305.392256] Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds...

还有一个问题:
Bluetooth: hci0: inquiry failed: status 0x0c

6. 另一次,我在终端上输入了命令,然后进入蓝牙设置尝试配对和连接扬声器,结果在终端上显示如下:
HCI sniffer - Bluetooth packet analyzer ver 5.53
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff

【多行与人机交互事件相关的内容】
> HCI Event: Command Status (0x0f) plen 4
    Inquiry (0x01|0x0001) status 0x00 ncmd 1
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2744 class 0x240404 rssi -25
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 24:FC:E5:6E:53:5B mode 1 clkoffset 0x18bd class 0x08043c rssi -71
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 24:FC:E5:6E:53:5B mode 1 clkoffset 0x18bd class 0x08043c rssi -98
> HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Random Address (0x08|0x0005) ncmd 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
> HCI Event: Command Status (0x0f) plen 4
    Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
> HCI Event: Command Status (0x0f) plen 4
    Inquiry (0x01|0x0001) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 128 reason 0x16
    Reason: Connection Terminated by Local Host
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -25
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Inquiry Complete (0x01) plen 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Random Address (0x08|0x0005) ncmd 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Parameters (0x08|0x000b) ncmd 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Scan Enable (0x08|0x000c) ncmd 1
    status 0x00
> HCI Event: Command Status (0x0f) plen 4
    Inquiry (0x01|0x0001) status 0x00 ncmd 1
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -27
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -27
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -24
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -24
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -23
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -24
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -23
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data
> HCI Event: Extended Inquiry Result (0x2f) plen 255
    bdaddr 88:D0:39:7C:24:61 mode 1 clkoffset 0x2745 class 0x240404 rssi -22
    Complete local name: 'Soundcore Flare+'
    Unknown type 0xff with 9 bytes data

Soundcore Flare+ 是这个音箱的型号。我看到还有另一个问题:
Unknown type 0xff with 9 bytes data

蓝牙USB 5.0在Windows 10上运行良好,但在Ubuntu 20.04上无法工作。因此,Ubuntu需要针对蓝牙5.0的驱动程序。

在5.8.14内核上,Ubuntu确实显示要配对和连接的设备,但配对和连接无法正常工作。

所以,有人能帮我解决在Ubuntu上与设备配对和连接的问题吗?

我在这个网站上找到了Linux的解决方案,但我不知道如何在Ubuntu 20.04上进行编译和修补,它只适用于内核版本5.8。


有可能你走错了方向。无线适配器的确切型号是什么?问题很可能与硬件有关。你是否查阅过制造商的文档? - Nmath
在终端中尝试运行命令 sudo hciconfig hci0 up - Jeremy31
@Nmath 型号:MLT-5.0-MiNi,但无论是什么型号,关键在于芯片:0a12:0001 - luisito_36
@Jeremy31 结果:无法初始化设备hci0:操作不支持(95) - luisito_36
请编辑问题以包括rfkill list的结果。 - Jeremy31
@Nmath其中一些设备得到了支持,但有很多设备使用相同的USB ID,这给内核开发人员带来了麻烦。实际上,在2014年还有一个模块参数可以忽略该设备,因为它是一个大问题。 - Jeremy31
@Nmath 我买了一个没有驱动程序的蓝牙USB。我发帖求助工程师来帮我解决这个问题。工程师可以编译源代码来解决这个问题。 - luisito_36
你可能想从GitHub安装UKUU,并查看是否安装了5.8.10内核可以修复这个问题,因为该补丁是该内核的一部分。 - Jeremy31
@Jeremy31 包含了rfkill。 - luisito_36
我找到了解决问题的方法:https://fosspost.org/linux-bluetooth-problem/ 但是我不知道在Ubuntu上如何应用补丁到内核的步骤。 - luisito_36
一个快速的谷歌搜索显示了很多与这个硬件相关的问题,包括市场上出现的伪劣产品,它们声称是0a12:0001型号,但缺乏功能或者根本无法使用。如果您学会如何编译补丁,那么这个补丁可能能解决您的问题...但也可能不行。之前的问题(链接:https://askubuntu.com/questions/1208296)、其中一个Launchpad的bug(链接:https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1879124)以及Upstream的bug(链接:https://bugzilla.kernel.org/show_bug.cgi?id=60824)都讨论了一些这些问题。老实说,买一个价格稍微贵一点的蓝牙适配器可能更划算、更快捷。 - user535733
1蓝牙USB 5.0在Windows 10上运行良好,但在Ubuntu 20.04上却无法工作。因此,Ubuntu需要针对蓝牙5.0的驱动程序。在5.8.14内核上,Ubuntu确实显示了可配对和连接的设备,但是配对和连接却无法正常工作。 - luisito_36
1个回答

在Ubuntu 20.04.4下,0a12/0001也存在同样的问题。我的第二台电脑使用debian 11 bullseye,适配器可以正常工作。我在那里找到了一个在Ubuntu 20.04默认情况下没有安装的软件包。所以在20.04中尝试安装蓝牙软件包。对于供应商0a12/0001有效。 打开终端并输入sudo apt install bluetooth