You are not logged in.

#1 2020-10-23 12:38:55

jns-v
Member
Registered: 2020-10-23
Posts: 5

BH456A Bluetooth Dongle: rtk_btusb: load firmware failed! [SOLVED]

Dear folks,

I've finally moved to Arch Linux having spent years on OpenSUSE. I've so far set up the base system in a kind of OpenSUSE flavor (btrfs, snapper etc) and really don't regret the change. Especially for the vast amout of available software.

To get to the actual problem:
I bought an MPOW BH456A bluetooth dongle with Realtek RTL8761BU chip on it. I indeed bought it because of the advertised linux support and took a look at the driver package downloadable on their website. It contained a bunch of different firmware files, driver source as well as a Readme and the Makefiles to build it. Therefore I thought I was good to go.

The dongle actually shipped with a driver CD containing only the usb driver source and the firmware files, so I went with that one:

$ lt Linux_BT_USB_v3.10_20191023_8761BU_BTCOEX_20190327-0202/
Permissions   Size User  Group Date Modified Name
drwxr-xr-x       - jonas users 23 Okt 11:49  Linux_BT_USB_v3.10_20191023_8761BU_BTCOEX_20190327-0202
drwxr-xr-x       - jonas users 23 Okt 12:54  ├── 8761BU
.r--------     361 jonas users 23 Okt 12:54  │  ├── Makefile
.r--------      14 jonas users 24 Okt  2019  │  ├── rtl8761bu_config
.r--------    29Ki jonas users 24 Okt  2019  │  └── rtl8761bu_fw
drwxr-xr-x       - jonas users 23 Okt 11:50  ├── bluetooth_usb_driver
.r--------     311 jonas users 24 Okt  2019  │  ├── Makefile
.r--------    38Ki jonas users 24 Okt  2019  │  ├── rtk_bt.c
.r--------   3,9Ki jonas users 24 Okt  2019  │  ├── rtk_bt.h
.rw-r--r--   339Ki root  root  23 Okt 11:49  │  ├── rtk_btusb.ko.xz
.rw-r--r--     299 root  root  23 Okt 11:49  │  ├── rtk_btusb.mod
.r--------    75Ki jonas users 24 Okt  2019  │  ├── rtk_coex.c
.r--------  10,0Ki jonas users 24 Okt  2019  │  ├── rtk_coex.h
.r--------    48Ki jonas users 24 Okt  2019  │  ├── rtk_misc.c
.r--------   2,6Ki jonas users 24 Okt  2019  │  └── rtk_misc.h
.r--------     812 jonas users 23 Okt 11:49  ├── Makefile
.r--------   2,7Ki jonas users 24 Jul  2018  └── Readme.txt

I edited ./bluetooth_usb_driver/Makefile as follows as I read somewhere, that the driver has to be xz'd to work (looking into /lib/modules/5.9.1-arch1-1/kernel/drivers/bluetooth/ I could verify that indeed all the .ko files have a .xz extention). As a result it looks like this:

$ cat Makefile
SRC_DIR	:= ./bluetooth_usb_driver
MDL_DIR	:= /lib/modules/$(shell uname -r)
DRV_DIR	:= $(MDL_DIR)/kernel/drivers/bluetooth

FIRMWARE_DIR := 8761BU
##########################################
install:
	make -C $(FIRMWARE_DIR)

	- rmmod btusb
	- mv $(DRV_DIR)/btusb.ko.xz $(DRV_DIR)/btusb_bak
	- rmmod rtk_btusb
	make -C $(SRC_DIR)
	xz $(SRC_DIR)/rtk_btusb.ko
	cp -f $(SRC_DIR)/rtk_btusb.ko.xz $(DRV_DIR)/rtk_btusb.ko.xz
	depmod -a $(shell uname -r)
	make -C $(SRC_DIR) clean
	echo "install rtk_btusb success!"

The build succeeded and the files (driver and firmware are in the right place as far as I can tell:

$ ll /lib/modules/5.9.1-arch1-1/kernel/drivers/bluetooth/rtk_btusb.ko.xz
Permissions  Size User Group Date Modified Name
.rw-r--r--  339Ki root root  23 Okt 11:49  /lib/modules/5.9.1-arch1-1/kernel/drivers/bluetooth/rtk_btusb.ko.xz
$ ll /lib/firmware/rtl_bt/rtl8761bu*
Permissions Size User Group Date Modified Name
.rw-r--r--    14 root root  23 Okt 11:49  /lib/firmware/rtl_bt/rtl8761bu_config
.rw-r--r--  29Ki root root  23 Okt 11:49  /lib/firmware/rtl_bt/rtl8761bu_fw

I noticed, that all the files in /lib/firmware/rtl_bt/ have a .bin extension, but actually it didn't make a difference adding the extension to the newly installed files.

I rebooted and found that the bluetooth adapter is still not being recognized:

$ bluetoothctl devices
No default controller available

Blueberry tray app tells me it is searching for devices but nothing more. Blueman tells me there is no adapter.

Checking dmesg:

$ dmesg | grep rtk
[    2.910430] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.0fcdcfd.20191024-192930
[    2.910430] rtk_btcoex: rtk_btcoex_init: version: 1.2
[    2.910431] rtk_btcoex: create workqueue
[    2.910476] rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
[    2.910488] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[    2.910489] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[    2.910489] rtk_btusb: patch_add
[    2.910489] rtk_btusb: auto suspend is disabled
[    2.910490] rtk_btusb: pid = 0x8771
[    2.910490] rtk_btusb: patch_add: Reset gEVersion to 0xff
[    2.910492] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[    2.910534] rtk_btusb: btusb_probe: done
[    2.910544] usbcore: registered new interface driver rtk_btusb
[    2.910557] rtk_btusb: btusb_open start
[    2.910558] rtk_btusb: btusb_open hdev->promisc ==0
[    2.910558] rtk_btusb: download_patch start
[    2.910559] rtk_btusb: chip type value: 0x74
[    2.910560] rtk_btusb: HCI reset.
[    2.921762] rtk_btusb: read_ver_rsp->lmp_subver = 0x8761
[    2.921762] rtk_btusb: read_ver_rsp->hci_rev = 0xb
[    2.921763] rtk_btusb: patch_entry->lmp_sub = 0x8761
[    2.921763] rtk_btusb: load_firmware start
[    2.921763] rtk_btusb: lmp_version = 0x8761
[    2.921764] rtk_btusb: config filename rtl8761bu_config
[    2.921783] rtk_btusb: fw name is  rtl8761bu_fw
[    2.921790] rtk_btusb: load firmware failed!
[    2.921791] rtk_btusb: Rtk patch end -1
[    2.921791] rtk_btusb: btusb_open failed

It looks to me as if the driver works but for some reason it is not able to load the firmware. Still I consider this progress as the last attempt resulted in the driver not even recognizing the chip as RTL8761BU but an RTL8761B instead. In the meantime I have completely reinstalled for other reasons though...

I took a look at the arch wiki page Kernel module and checked the outputs of the commands described:
The output of lsmod tells me that the driver is loaded I guess?

$ lsmod | grep bluetooth
bluetooth             741376  9 bnep,rtk_btusb
ecdh_generic           16384  1 bluetooth
rfkill                 28672  5 asus_wmi,bluetooth
crc16                  16384  1 bluetooth

I can't make out anything wrong with modinfo either

$ modinfo rtk_btusb
filename:       /lib/modules/5.9.1-arch1-1/kernel/drivers/bluetooth/rtk_btusb.ko.xz
license:        GPL
version:        3.1.0fcdcfd.20191024-192930
description:    Realtek Bluetooth USB driver ver 3.1.0fcdcfd.20191024-192930
author:
srcversion:     D91CFC95C5FC7F6EFBCBA49
alias:          usb:v1358p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v0489p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v13D3p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v0BDAp*d*dc*dsc*dp*icE0isc01ip01in*
depends:        bluetooth
retpoline:      Y
name:           rtk_btusb
vermagic:       5.9.1-arch1-1 SMP preempt mod_unload
$ modprobe -c | grep rtk
alias usb:v0489p*d*dc*dsc*dp*icE0isc01ip01in* rtk_btusb
alias usb:v0BDAp*d*dc*dsc*dp*icE0isc01ip01in* rtk_btusb
alias usb:v1358p*d*dc*dsc*dp*icE0isc01ip01in* rtk_btusb
alias usb:v13D3p*d*dc*dsc*dp*icE0isc01ip01in* rtk_btusb

Inserting the dongle I verfied it was being recognized:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 002: ID 045e:0730 Microsoft Corp. Digital Media Keyboard 3000
Bus 001 Device 005: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I'm not sure wether the info provided is enough for you to make something out of it but I already feel like it's mostly meaningless...

As to my research on trying to solve this problem, the most meaningful thread I found was one over on ubuntuforums.
Actually there are two solutions provided:
1. Some messing around with secure boot which I did not follow as I did not understand what it will actually do. In UEFI settings I have Secure Boot set to "Other OS" though
2. Compiling the kernel manually and patching it based on this. As far as I understand this patch only tells the kernel(/driver?) which fw file to load. However according to the dmesg the correct fw file is being recognized. It just fails to load and I don't understand why as the output doesn't mention any cause for it.

I also checked the linux kernel github and tried to find some hints regarding my chipset but unfortunately I didn't have much luck finding the file where this is actually implemented.

So it seems I've hit the limits of what I can do to track down this issue and need some professional help here...
I did my best to gather the information provided and I do hope I did not offend any rules applying.
I'd really appreciate your input smile

Regards jns

EDIT: Rookie mistake i guess:

$ uname -r
5.9.1-arch1-1

Last edited by jns-v (2020-10-27 23:35:05)

Offline

#2 2020-10-24 10:18:29

jns-v
Member
Registered: 2020-10-23
Posts: 5

Re: BH456A Bluetooth Dongle: rtk_btusb: load firmware failed! [SOLVED]

I think I made some progress. I symlinked the firmware files from /lib/firmware/rtl_bt/ to /lib/firmware. It seems the firmware is now loaded correctly. However Blueberry is still looking for devices endlessly. Blueman says there is no adapter.

$ dmesg | grep rtk_btusb
[    2.724885] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.0fcdcfd.20191024-192930
[    2.724943] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[    2.724943] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[    2.724944] rtk_btusb: patch_add
[    2.724944] rtk_btusb: auto suspend is disabled
[    2.724945] rtk_btusb: pid = 0x8771
[    2.724945] rtk_btusb: patch_add: Reset gEVersion to 0xff
[    2.724948] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[    2.725005] rtk_btusb: btusb_probe: done
[    2.725021] usbcore: registered new interface driver rtk_btusb
[    2.725021] rtk_btusb: btusb_open start
[    2.725022] rtk_btusb: btusb_open hdev->promisc ==0
[    2.725022] rtk_btusb: download_patch start
[    2.725023] rtk_btusb: chip type value: 0x74
[    2.725023] rtk_btusb: HCI reset.
[    2.736156] rtk_btusb: read_ver_rsp->lmp_subver = 0xb56f
[    2.736157] rtk_btusb: read_ver_rsp->hci_rev = 0x98a
[    2.736157] rtk_btusb: patch_entry->lmp_sub = 0x8761
[    2.736158] rtk_btusb: Firmware already exists
[    2.736158] rtk_btusb: global_version is not set, get it!
[    2.736158] rtk_btusb: rtk_get_eversion: gEVersion 255
[    2.737152] rtk_btusb: eversion->status = 0x0, eversion->version = 0x1
[    2.737153] rtk_btusb: Rtk patch end 1
[    2.737153] rtk_btusb: btusb_open set HCI_RUNNING
[    2.737156] rtk_btusb: btusb_open end
[    2.759129] rtk_btusb: btusb_notify: hci0 evt 3
[    2.786160] rtk_btusb: btusb_flush add delay
[    2.796183] rtk_btusb: btusb_close
$ bluetoothctl show
No default controller available
$ hciconfig -a
hci0:	Type: Primary  Bus: USB
	BD Address: 44:01:BB:9F:FD:10  ACL MTU: 1021:6  SCO MTU: 255:12
	DOWN
	RX bytes:1132 acl:0 sco:0 events:58 errors:0
	TX bytes:720 acl:0 sco:0 commands:58 errors:0
	Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
	Link policy: RSWITCH HOLD SNIFF PARK
	Link mode: SLAVE ACCEPT
$ sudo hciconfig hci0 up
Can't init device hci0: Protocol not supported (93)

Offline

#3 2020-10-27 23:28:04

jns-v
Member
Registered: 2020-10-23
Posts: 5

Re: BH456A Bluetooth Dongle: rtk_btusb: load firmware failed! [SOLVED]

I got it to work by

pacman -S linux-lts linux-lts-headers

Plus recompiling and reinstalling the driver.
Actually I tried that before without success...
I'm afraid I can't figure out to edit the title to mark this as solved.

Last edited by jns-v (2020-10-27 23:35:50)

Offline

#4 2020-10-28 11:11:06

Spoekenkieker
Member
Registered: 2020-10-28
Posts: 1

Re: BH456A Bluetooth Dongle: rtk_btusb: load firmware failed! [SOLVED]

Hey,

I've had the exact same problem with the exact same device and followed you through some of this (the parts that I understood). After installing the long term support kernel and recompiling the driver, the dongle started working for me as well. But I couldn't adhere to the most basic of principles and changed the running system.

So, what I did was disconnecting the dongle and reconnecting it, because I wanted to use a different USB port. Then, a new problem showed itself. While it seemed like the old problem at first, in the sense that the dongle just wasn't working, the output of

journalctl -f

was quite different:

Okt 28 11:06:18 anonym-desktop kernel: usb 2-5: new full-speed USB device number 6 using xhci_hcd
Okt 28 11:06:18 anonym-desktop kernel: usb 2-5: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
Okt 28 11:06:18 anonym-desktop kernel: usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Okt 28 11:06:18 anonym-desktop kernel: usb 2-5: Product: Bluetooth Radio
Okt 28 11:06:18 anonym-desktop kernel: usb 2-5: Manufacturer: Realtek
Okt 28 11:06:18 anonym-desktop kernel: usb 2-5: SerialNumber: 00E04C239987
Okt 28 11:06:18 anonym-desktop kernel: usbcore: registered new interface driver btusb
Okt 28 11:06:18 anonym-desktop kernel: rtk_btusb: Realtek Bluetooth USB driver ver 3.1.9321f79.20200610-155144
Okt 28 11:06:18 anonym-desktop kernel: rtk_btcoex: rtk_btcoex_init: version: 1.2
Okt 28 11:06:18 anonym-desktop kernel: rtk_btcoex: create workqueue
Okt 28 11:06:18 anonym-desktop kernel: rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
Okt 28 11:06:18 anonym-desktop kernel: Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
Okt 28 11:06:18 anonym-desktop kernel: usbcore: registered new interface driver rtk_btusb
Okt 28 11:06:18 anonym-desktop systemd[1]: Starting Load/Save RF Kill Switch Status...
Okt 28 11:06:18 anonym-desktop kernel: Bluetooth: hci0: RTL: rom_version status=0 version=1
Okt 28 11:06:18 anonym-desktop kernel: Bluetooth: hci0: RTL: loading rtl_bt/rtl8761a_fw.bin
Okt 28 11:06:18 anonym-desktop kernel: Bluetooth: hci0: RTL: loading rtl_bt/rtl8761a_config.bin
Okt 28 11:06:18 anonym-desktop kernel: bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_config.bin failed with error -2
Okt 28 11:06:18 anonym-desktop kernel: Bluetooth: hci0: RTL: cfg_sz -2, total sz 20204
Okt 28 11:06:18 anonym-desktop systemd[690]: Reached target Bluetooth.
Okt 28 11:06:18 anonym-desktop kernel: audit: type=1130 audit(1603879578.614:80): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Okt 28 11:06:18 anonym-desktop audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Okt 28 11:06:18 anonym-desktop systemd[1]: Reached target Bluetooth.
Okt 28 11:06:18 anonym-desktop systemd[1]: Started Load/Save RF Kill Switch Status.
Okt 28 11:06:20 anonym-desktop kernel: Bluetooth: hci0: command 0xfc20 tx timeout
Okt 28 11:06:23 anonym-desktop systemd[1]: systemd-rfkill.service: Succeeded.
Okt 28 11:06:23 anonym-desktop audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Okt 28 11:06:23 anonym-desktop kernel: audit: type=1131 audit(1603879583.614:81): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-rfkill comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Okt 28 11:06:29 anonym-desktop bluetoothd[2581]: No Bluetooth address for index 0
Okt 28 11:06:29 anonym-desktop kernel: Bluetooth: hci0: RTL: download fw command failed (-110)

It seems like it tried using the wrong firmware. I only noticed this after recompiling and reinstalling the driver again, copying a few files, doing some stuff that I hope won't haunt me in the future.

Anyways, it started working again after unloading the basic module with

sudo modprobe -r btusb

and reconnecting the dongle. I gathered this much from some suggestions in the Wiki and the Linux Mint Forum.
But having to use an old kernel and unloading modules does not seem like an optimal solution to me. I know, the hardware officially only support kernels up to version 5.3. But nevertheless, since it's obviously possible to use it, I think there should be an easier way as well. Hopefully, I will find some time to revisit this problem and to understand a bit more about your other "ansatzes". Maybe I'll be forced to do so when the next lts kernel is released. Or everything will be fixed by then.

Offline

#5 2021-02-25 17:23:24

victorbrca
Member
From: Toronto
Registered: 2017-09-11
Posts: 3
Website

Re: BH456A Bluetooth Dongle: rtk_btusb: load firmware failed! [SOLVED]

If it starts to fail again, there's a package in the AUR for this chip - rtl8761b-fw

aur info rtl8761b-fw
:: Querying AUR...
 -> Missing AUR Packages:  mplayer
Repository      : aur
Name            : rtl8761b-fw
Keywords        : bluetooth  firmware  realtek  RTL8761B
Version         : 20200816-1
Description     : Realtek bluetooth firmware for RTL8761B based devices
URL             : https://github.com/Realtek-OpenSource/android_hardware_realtek
AUR URL         : https://aur.archlinux.org/packages/rtl8761b-fw
Groups          : None
Licenses        : unknown
Provides        : None
Depends On      : None
Make Deps       : None
Check Deps      : None
Optional Deps   : None
Conflicts With  : None
Maintainer      : redchenjs
Votes           : 12
Popularity      : 2.862211
First Submitted : Wed 19 Aug 2020 05:54:52 AM EDT
Last Modified   : Wed 25 Nov 2020 02:30:06 AM EST
Out-of-date     : No

---------------------------------------------------------------------------------------
User 437407 with the Linux Counter

Offline

Board footer

Powered by FluxBB