linuxmint / mint22-beta

BETA Bug Squash Rush
34 stars 0 forks source link

Bluetooth 5.0 adapter rtl8761b don't work, seems to load wrong firmware #95

Closed fellipec closed 1 month ago

fellipec commented 1 month ago

I've a kind of generic USB Bluetooth adapter, that uses a Realtek 8761 firmware.

In Linux Mint 21.3 there was a bug that made the system load the wrong firmware. Instead of loading the file the file rtl8761b_fw.bin it loaded the file rtl8761bu_fw.bin. I found out about a workaround in Linux Mint foruns and it solved the problem.

In fact, I found out that there was bug into Ubuntu, which was fixed last year in jammy version, and as far as I understood the noble version should not have it.

Turns out that Mint 22 beta is trying to load the wrong firmware, like 21.3 and Ubuntu Jammy before the fix, as can be seen in this dmesgexcerpt when I plug the USB adapter:

[ 2646.361991] usb 3-4: USB disconnect, device number 8
[ 2648.130147] usb 3-4: new full-speed USB device number 9 using xhci_hcd
[ 2648.269896] usb 3-4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[ 2648.269907] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2648.269911] usb 3-4: Product: Bluetooth Radio
[ 2648.269915] usb 3-4: Manufacturer: Realtek
[ 2648.269919] usb 3-4: SerialNumber: 00E04C239987
[ 2648.288924] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[ 2648.290933] Bluetooth: hci0: RTL: rom_version status=0 version=1
[ 2648.290942] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[ 2648.291391] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
[ 2648.291487] Bluetooth: hci0: RTL: cfg_sz 6, total sz 30210
[ 2648.558913] Bluetooth: hci0: RTL: fw version 0xdfc6d922
[ 2648.658167] Bluetooth: MGMT ver 1.22
[ 2669.080504] Bluetooth: hci0: Opcode 0x2005 failed: -110
[ 2669.080513] Bluetooth: hci0: command 0x2005 tx timeout
[ 2669.080534] Bluetooth: hci0: Opcode 0x2041 failed: -110
[ 2671.128994] Bluetooth: hci0: command 0x2005 tx timeout

The blueman GUI can't scan for devices and in dmesg we can see the message tx timeout, like above.

Troubleshooting steps

The first thing I did was to try the same workwaround that fixed the problem in the previous version:

$ sudo mv rtl8761bu_config.bin.zst rtl8761bu_config.bin.zst.bak
$ sudo mv rtl8761bu_fw.bin.zst rtl8761bu_fw.bin.zst.bak
$ sudo ln -s rtl8761b_config.bin.zst rtl8761bu_config.bin.zst
$ sudo ln -s rtl8761b_fw.bin.zst rtl8761bu_fw.bin.zst

Plugged and unplugged the USB dongle and not changed anything:

[ 4283.909335] usb 3-4: USB disconnect, device number 9
[ 4285.039777] usb 3-4: new full-speed USB device number 10 using xhci_hcd
[ 4285.179235] usb 3-4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[ 4285.179244] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4285.179248] usb 3-4: Product: Bluetooth Radio
[ 4285.179253] usb 3-4: Manufacturer: Realtek
[ 4285.179256] usb 3-4: SerialNumber: 00E04C239987
[ 4285.202225] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[ 4285.204215] Bluetooth: hci0: RTL: rom_version status=0 version=1
[ 4285.204225] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[ 4285.205168] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
[ 4285.205342] Bluetooth: hci0: RTL: cfg_sz 25, total sz 31189
[ 4285.480205] Bluetooth: hci0: RTL: fw version 0x9dc6d922
[ 4285.579466] Bluetooth: MGMT ver 1.22
[ 4297.191748] Bluetooth: hci0: command 0x2005 tx timeout
[ 4297.191748] Bluetooth: hci0: Opcode 0x2005 failed: -110
[ 4297.191775] Bluetooth: hci0: Opcode 0x2041 failed: -110
[ 4299.239737] Bluetooth: hci0: command 0x2005 tx timeout
[ 4505.354756] usb 3-4: USB disconnect, device number 10
[ 4506.686379] usb 3-4: new full-speed USB device number 11 using xhci_hcd
[ 4506.830508] usb 3-4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[ 4506.830519] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4506.830524] usb 3-4: Product: Bluetooth Radio
[ 4506.830528] usb 3-4: Manufacturer: Realtek
[ 4506.830532] usb 3-4: SerialNumber: 00E04C239987
[ 4506.851411] Bluetooth: hci1: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[ 4506.853423] Bluetooth: hci1: RTL: rom_version status=0 version=1
[ 4506.853432] Bluetooth: hci1: RTL: loading rtl_bt/rtl8761bu_fw.bin
[ 4506.853858] Bluetooth: hci1: RTL: loading rtl_bt/rtl8761bu_config.bin
[ 4506.853972] Bluetooth: hci1: RTL: cfg_sz 25, total sz 31189
[ 4507.129381] Bluetooth: hci1: RTL: fw version 0x9dc6d922
[ 4507.228750] Bluetooth: MGMT ver 1.22
[ 4516.198887] Bluetooth: hci1: command 0x0c03 tx timeout
[ 4516.199084] Bluetooth: hci1: HCI reset during shutdown failed
[ 4523.302967] Bluetooth: hci1: Opcode 0x0c03 failed: -110

I rebooted the system, and still not worked. But after removing and reinserting the USB dongle, it worked and I was able to pair my mouse:

[    8.921129] systemd[1]: Finished apparmor.service - Load AppArmor profiles.
[    8.988055] zram: Added device: zram0
[    8.993756] zram0: detected capacity change from 0 to 1433600
[    9.002886] EXT4-fs (zram0): mounted filesystem cd2c0bff-833f-49b2-b2e4-ba06e9e9157e r/w with ordered data mode. Quota mode: none.
[    9.256078] systemd[1]: Finished log2ram.service - Log2Ram.
[    9.275387] systemd[1]: Starting systemd-journald.service - Journal Service...
[    9.283441] systemd-journald[801]: Collecting audit messages is disabled.
[    9.338219] systemd[1]: Started systemd-journald.service - Journal Service.
[    9.348978] systemd-journald[801]: Received client request to flush runtime journal.
[    9.568939] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.568946] Bluetooth: BNEP filters: protocol multicast
[    9.568952] Bluetooth: BNEP socket layer initialized
[    9.571812] Bluetooth: MGMT ver 1.22
[    9.576614] NET: Registered PF_ALG protocol family
[    9.621515] block nvme0n1: No UUID available providing old NGUID
[    9.671242] NET: Registered PF_QIPCRTR protocol family
[   10.045258] Generic FE-GE Realtek PHY r8169-0-800:00: attached PHY driver (mii_bus:phy_addr=r8169-0-800:00, irq=MAC)
[   10.189396] r8169 0000:08:00.0 enp8s0: Link is Down
[   11.784639] Bluetooth: RFCOMM TTY layer initialized
[   11.784648] Bluetooth: RFCOMM socket layer initialized
[   11.784653] Bluetooth: RFCOMM ver 1.11
[   13.070666] r8169 0000:08:00.0 enp8s0: Link is Up - 1Gbps/Full - flow control rx/tx
[   21.646819] usb 3-2: reset high-speed USB device number 3 using xhci_hcd
[   43.053348] Bluetooth: hci0: command 0x2005 tx timeout
[   43.053364] Bluetooth: hci0: Opcode 0x2005 failed: -110
[   45.142729] Bluetooth: hci0: command 0x2005 tx timeout
[   45.142730] Bluetooth: hci0: Opcode 0x2041 failed: -110
[   64.890260] usb 3-4: USB disconnect, device number 5
[   67.924777] usb 3-4: new full-speed USB device number 6 using xhci_hcd
[   68.068953] usb 3-4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[   68.068964] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   68.068969] usb 3-4: Product: Bluetooth Radio
[   68.068973] usb 3-4: Manufacturer: Realtek
[   68.068977] usb 3-4: SerialNumber: 00E04C239987
[   68.086844] Bluetooth: hci1: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[   68.088821] Bluetooth: hci1: RTL: rom_version status=0 version=1
[   68.088830] Bluetooth: hci1: RTL: loading rtl_bt/rtl8761bu_fw.bin
[   68.089225] Bluetooth: hci1: RTL: loading rtl_bt/rtl8761bu_config.bin
[   68.089307] Bluetooth: hci1: RTL: cfg_sz 25, total sz 31189
[   68.364803] Bluetooth: hci1: RTL: fw version 0x9dc6d922
[   68.464075] Bluetooth: MGMT ver 1.22
[  110.130630] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input30
[  110.130842] input: Microsoft Bluetooth Mouse Keyboard as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input31
[  110.131018] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input32
[  110.131156] hid-generic 0005:045E:082F.0008: input,hidraw7: BLUETOOTH HID v2.12 Mouse [Microsoft Bluetooth Mouse] on 00:e0:4c:a8:33:03

Tryed once more to be sure:

[    8.824784] systemd[1]: Mounted proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System.
[    8.826413] systemd[1]: Finished systemd-binfmt.service - Set Up Additional Binary Formats.
[    8.861080] systemd[1]: Finished apparmor.service - Load AppArmor profiles.
[    8.928623] zram: Added device: zram0
[    8.935851] zram0: detected capacity change from 0 to 1433600
[    8.945152] EXT4-fs (zram0): mounted filesystem 7b72a67b-7dbf-4cf9-812e-56cc1c1a0626 r/w with ordered data mode. Quota mode: none.
[    9.206903] systemd[1]: Finished log2ram.service - Log2Ram.
[    9.225373] systemd[1]: Starting systemd-journald.service - Journal Service...
[    9.233524] systemd-journald[801]: Collecting audit messages is disabled.
[    9.288543] systemd[1]: Started systemd-journald.service - Journal Service.
[    9.301112] systemd-journald[801]: Received client request to flush runtime journal.
[    9.548812] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.548817] Bluetooth: BNEP filters: protocol multicast
[    9.548823] Bluetooth: BNEP socket layer initialized
[    9.550417] Bluetooth: MGMT ver 1.22
[    9.553721] NET: Registered PF_ALG protocol family
[    9.594911] block nvme0n1: No UUID available providing old NGUID
[    9.647536] NET: Registered PF_QIPCRTR protocol family
[   10.032250] Generic FE-GE Realtek PHY r8169-0-800:00: attached PHY driver (mii_bus:phy_addr=r8169-0-800:00, irq=MAC)
[   10.196369] r8169 0000:08:00.0 enp8s0: Link is Down
[   11.766206] Bluetooth: RFCOMM TTY layer initialized
[   11.766217] Bluetooth: RFCOMM socket layer initialized
[   11.766232] Bluetooth: RFCOMM ver 1.11
[   13.114394] r8169 0000:08:00.0 enp8s0: Link is Up - 1Gbps/Full - flow control rx/tx
[   33.239635] usb 3-2: reset high-speed USB device number 3 using xhci_hcd
[   55.979789] Bluetooth: hci0: Opcode 0x0c03 failed: -110
[   63.041149] usb 3-4: USB disconnect, device number 5
[   65.787268] usb 3-4: new full-speed USB device number 6 using xhci_hcd
[   65.929359] usb 3-4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[   65.929371] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   65.929376] usb 3-4: Product: Bluetooth Radio
[   65.929380] usb 3-4: Manufacturer: Realtek
[   65.929384] usb 3-4: SerialNumber: 00E04C239987
[   65.948250] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[   65.950242] Bluetooth: hci0: RTL: rom_version status=0 version=1
[   65.950247] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[   65.950455] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
[   65.950498] Bluetooth: hci0: RTL: cfg_sz 25, total sz 31189
[   66.226227] Bluetooth: hci0: RTL: fw version 0x9dc6d922
[   66.325633] Bluetooth: MGMT ver 1.22
[   67.113232] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input30
[   67.113456] input: Microsoft Bluetooth Mouse Keyboard as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input31
[   67.113636] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input32
[   67.113801] hid-generic 0005:045E:082F.0008: input,hidraw7: BLUETOOTH HID v2.12 Mouse [Microsoft Bluetooth Mouse] on 00:e0:4c:a8:33:03

Just to be more complete, I downloaded a Ubuntu Noble Nobat live image and booted it. Again my USB dongle didn't work out of the box, but after unplugging and plugging again, it worked without having to mess with driver files. I manged to copy the dmesg output too:

[   55.685237] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   55.685404] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   55.685533] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[   56.488080] block nvme0n1: the capability attribute has been deprecated.
[   56.600516] SGI XFS with ACLs, security attributes, realtime, quota, no debug enabled
[   56.655049] JFS: nTxBlock = 8192, nTxLock = 65536
[   56.690461] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[   56.720047] QNX4 filesystem 0.2.3 registered.
[   56.883194] Btrfs loaded, zoned=yes, fsverity=yes
[  125.034900] usb 3-4: USB disconnect, device number 5
[  127.430563] usb 3-4: new full-speed USB device number 6 using xhci_hcd
[  127.575856] usb 3-4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[  127.575866] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  127.575871] usb 3-4: Product: Bluetooth Radio
[  127.575875] usb 3-4: Manufacturer: Realtek
[  127.575878] usb 3-4: SerialNumber: 00E04C239987
[  127.596756] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[  127.598728] Bluetooth: hci0: RTL: rom_version status=0 version=1
[  127.598736] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[  127.599226] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
[  127.599368] Bluetooth: hci0: RTL: cfg_sz 6, total sz 30210
[  127.866710] Bluetooth: hci0: RTL: fw version 0xdfc6d922
[  127.965966] Bluetooth: MGMT ver 1.22
[  191.919132] Bluetooth: hci0: Opcode 0x0c1a failed: -110
[  191.919138] Bluetooth: hci0: command 0x0c1a tx timeout
[  208.009987] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input30
[  208.010197] input: Microsoft Bluetooth Mouse Keyboard as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input31
[  208.010394] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0008/input/input32
[  208.010531] hid-generic 0005:045E:082F.0008: input,hidraw7: BLUETOOTH HID v2.12 Mouse [Microsoft Bluetooth Mouse] on 00:e0:4c:a8:33:03

I'm aware that Realtek devices aren't the best ones for use with Linux, but I need a 5.0 adapter (because the XBox controller and a headphone) and I already bought two from different brands and turned out to be the same Realtek chipset.

I hope this bug report can be useful and is complete enough to be of value. I'm open to do more tests and help if needed.

fellipec commented 1 month ago

Update: I was forced to change the USB dongle. The new one, looks like the same chipset but works flawlessly:

[    2.437174] usb 3-4: Product: Bluetooth Radio
[    4.057471] Bluetooth: Core ver 2.22
[    4.057495] NET: Registered PF_BLUETOOTH protocol family
[    4.057496] Bluetooth: HCI device and connection manager initialized
[    4.057500] Bluetooth: HCI socket layer initialized
[    4.057503] Bluetooth: L2CAP socket layer initialized
[    4.057507] Bluetooth: SCO socket layer initialized
[    4.118025] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[    4.120027] Bluetooth: hci0: RTL: rom_version status=0 version=1
[    4.120033] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[    4.122743] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
[    4.123182] Bluetooth: hci0: RTL: cfg_sz 25, total sz 31189
[    4.398020] Bluetooth: hci0: RTL: fw version 0x9dc6d922
[    9.860857] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.860862] Bluetooth: BNEP filters: protocol multicast
[    9.860868] Bluetooth: BNEP socket layer initialized
[    9.862237] Bluetooth: MGMT ver 1.22
[   12.361169] Bluetooth: RFCOMM TTY layer initialized
[   12.361180] Bluetooth: RFCOMM socket layer initialized
[   12.361187] Bluetooth: RFCOMM ver 1.11
[   19.607987] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0005/input/input25
[   19.608312] input: Microsoft Bluetooth Mouse Keyboard as /devices/virtual/misc/uhid/0005:045E:082F.0005/input/input26
[   19.608520] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0005/input/input27
[   19.608656] hid-generic 0005:045E:082F.0005: input,hidraw4: BLUETOOTH HID v2.12 Mouse [Microsoft Bluetooth Mouse] on 00:e0:4c:b0:db:03
[13021.481367] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0006/input/input28
[13021.481570] input: Microsoft Bluetooth Mouse Keyboard as /devices/virtual/misc/uhid/0005:045E:082F.0006/input/input29
[13021.481732] input: Microsoft Bluetooth Mouse as /devices/virtual/misc/uhid/0005:045E:082F.0006/input/input30
[13021.481930] hid-generic 0005:045E:082F.0006: input,hidraw4: BLUETOOTH HID v2.12 Mouse [Microsoft Bluetooth Mouse] on 00:e0:4c:b0:db:03

I'll not rule out the old dongle as defective because it works very well in Windows. But for some reason, this new one, even using the same driver, work well.

I'm still open to any questions to help, if needed.

clefebvre commented 1 month ago

Thanks @fellipec, I think this should be reported upstream on Launchpad for 24.04 since it's completely upstream from us and can be reproduced with Noble directly.