Rtl8761b bluetooth driver fix

the module from vpeter seems to work, bu CE can’t find the BT-dongle
I manually "modprobe -r"d btsub and btrtl (blacklisting them seems not to work)
then insmod insmod ./btrtl_rev_a_and_b.ko

the rfkill does also not work, because hciconfig -a gives:

CoreELEC:~/.config/firmware # hciconfig -a
hci0:   Type: Primary  Bus: USB
        BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
        DOWN 
        RX bytes:0 acl:0 sco:0 events:0 errors:0
        TX bytes:0 acl:0 sco:0 commands:1 errors:1
        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DH1 HV1 
        Link policy: 
        Link mode: SLAVE ACCEPT 

after systemctl restart bluetooth.service CE load the fw correctly. At least it seems to, but it is not found by CE in CE-Settings

[  440.338951@0] Bluetooth: hci0 command 0xfc20 tx timeout
[  448.468438@0] Bluetooth: hci0: download fw command failed (-110)
[  742.418617@1] usbcore: deregistering interface driver btusb
[  792.733802@0] usbcore: registered new interface driver btusb
[  794.742098@3] Bluetooth: hci0 command 0x1001 tx timeout
[  802.806509@0] Bluetooth: hci0: HCI_OP_READ_LOCAL_VERSION failed (-110)
[  905.806486@2] usb 1-1.2: USB disconnect, device number 5
[  908.102307@2] usb 1-1.2: new full-speed USB device number 6 using xhci-hcd
[  908.227192@2] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8771
[  908.227200@2] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  908.227205@2] usb 1-1.2: Product: Bluetooth Radio
[  908.227210@2] usb 1-1.2: Manufacturer: Realtek
[  908.227215@2] usb 1-1.2: SerialNumber: 00E04C239987
[  908.240369@1] hci0: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[  908.240382@1] peter btrtl_setup_realtek, RTL_ROM_LMP_8761A rev 0xb
[  908.240389@1] peter btrtl_setup_realtek, RTL_ROM_LMP_8761A rev b
[  908.240393@1] peter btrtl_setup_rtl8723b, RTL_ROM_LMP_8761A rev 0xb
[  908.240398@1] peter btrtl_setup_rtl8723b, cfg_name rtl_bt/rtl8761b_config.bin
[  908.240401@1] hci0: rtl: loading rtl_bt/rtl8761b_config.bin
[  908.242785@1] hci0: rtl: loading rtl_bt/rtl8761b_fw.bin
[  908.246395@1] hci0: rom_version status=0 version=1
[  908.246484@1] cfg_sz 25, total size 23485

CE19-nighly from 10042021 on a N2-device
Thx in advance

Edit:
it seems the same lsmod difference like @Compent has

CoreELEC:~ # lsmod | grep bt
btusb                  45056  0
btbcm                  16384  1 btusb
btintel                24576  1 btusb
btrtl                  16384  1 btusb
bluetooth             425984  27 btrtl,btintel,btbcm,btusb

After a reboot, if I physically unplug and re-attach the dongle, the end of dmesg shows this:

[  216.756813@3] usb 1-1.2: USB disconnect, device number 7
[  219.051724@3] usb 1-1.2: new full-speed USB device number 8 using xhci-hcd
[  219.176802@3] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8771
[  219.176817@3] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  219.176824@3] usb 1-1.2: Product: Bluetooth Radio
[  219.176831@3] usb 1-1.2: Manufacturer: Realtek
[  219.176837@3] usb 1-1.2: SerialNumber: 00E04C239987
[  219.192259@3] Bluetooth: hci0: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[  219.192275@3] Bluetooth: hci0: rtl: loading rtl_bt/rtl8761a_config.bin
[  219.192458@3] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_config.bin failed with error -2
[  219.192468@3] Bluetooth: hci0: Failed to load rtl_bt/rtl8761a_config.bin
[  219.192473@3] Bluetooth: hci0: rtl: loading rtl_bt/rtl8761a_fw.bin
[  219.194206@3] Bluetooth: hci0: rom_version status=0 version=1
[  219.194245@3] Bluetooth: cfg_sz 0, total size 20204
[  221.287797@3] Bluetooth: hci0 command 0xfc20 tx timeout
[  229.383731@3] Bluetooth: hci0: download fw command failed (-110)

This would seem to indicate that rtl8761a_fw.bin is being referenced and not rtl8761b_fw.bin

It seems odd that if we are all following the same paths that we get differing results, with the only fundamental differences likely being the boxes that we have,

update .tar for a test: https://drive.google.com/file/d/1I8VP5X2PrC8OvwCwbAZY2vIGo6Ay1HeI/view?usp=sharing

Remove any autostart.sh or other hacks for this bt device. Also remove firmware from /storage/.config/firmware because it is included in image itself.

If it works good. If not post links

dmesg | paste
journalctl -l  | paste
1 Like

It didn’t work after the initial update but then I rebooted and it works perfectly.

Thanks very much to all that made it happen :grin:

1 Like

It works! Audio over BT is OK.

But after disconnecting the BT-device, I have a freezing picture and no sound in Live-TV. Haven’t tested video streams.
Will report back tomorrow. My wife is occupying the TV :wink:
Thx

After a good day of use, things are rock solid.

Here is my bug-report.
I don’t know, if it is BT and/or rtl8761b related or a Kodi bug:
N2 with vpeters testbuild, rtl8761b BT-dongle, CE19

Connecting and disconnecting BT device over CE-settings seems fine.
After conecting, everything plays fine, but after disconnecting (turning off) my BT-device (JBL Go2), I have a freezing pic and NO sound at all while Live-TV and e.g. amazon streams. CE showed “disconnected device” before.

If this does not fit here, please let me know or separate this post. I can also file a bug report on github, if you want

I played 2 Live-TV channels over BT, then I turned off the device and tried to play another channel, which did not work.

debug-log: File-Upload.net - Datei nicht gefunden

CoreELEC:~ # dmesg | paste
http://ix.io/2W8m
CoreELEC:~ # journalctl -l | paste
http://ix.io/2W8n
Thx

Edit:
there is another user reporting “no sound” after disconnecting. Unfortunately without any log

Latest nightly image includes this driver support ootb:
CoreELEC-Amlogic-ng.arm-19.1-Matrix_nightly_20210415.tar

Please make me a new kodi.log!

download and extract this addon to:
/storage/.kodi/addons

https://mega.nz/file/3Sx3jQ6B#JyVm5sYnrJx-QSTq0SH86JMZCXshMMZktfaj5g__bg4

So end path is:
/storage/.kodi/addons/service.coreelec.settings

Alternative:

cd /storage/.kodi/addons
megadl https://mega.nz/file/3Sx3jQ6B#JyVm5sYnrJx-QSTq0SH86JMZCXshMMZktfaj5g__bg4
sync

The zip must be extracted! It’s not a addon to be installed!

If all is copied just restart kodi:
systemctl restart kodi

Then reproduce the error and upload the kodi.log. There is a crash in the bluetooth interface added function.

Any news on this @Solo0815 ?

Sorry, I was a little bit busy lately.
Here are the logs (kodi-debug and last 5000 lines of dmesg)
https://filebin.net/mq9qva6k1ghvpw9l

If you need more details or logs, pls let me know.

Steps to reproduce:
play some video (LiveTV-stream here)
switch on BT-device (CE connects and shows message, sound is now over BT)
switch off BT-device (CE disconnects and shows message)
There is no sound anymore, Kodi buffers
stop video and try to play another video (Pic freezes ~20 sec, no sound at all)
restarting kodi helps

Please try tomorrow with new nightly again.

Unofrtunately there is no change and the bug is still present.
I deleted the installed service.coreelec.settings in $KODI/addon and updated with CE_2104 (newest from today)

It seems, that Kodi is (still) trying to play sound over the BT-device or over BT which causes the buffering and no sound.

CE detects on/off of the device correctly and displays a message.
Kodi/CE should

  1. not try to play over BT, if no BT-device is present (display message, and/or stop playing
  2. switch to default audio before BT-connection, and/or stop playing

I have no new logs, because the error is the same as before

The python3 exception should be gone now. I will create a debug image later for you. The error is located in your user settings or your Bluetooth client.

@Solo0815

Please take your matching img and create a new clean install:
https://mega.nz/folder/CeIiBTjR#ZmYIcAuzO9GF3CY6bK4kXA

Boot once into Kodi and setup the audio system that you have sound.
If it’s working connect the bt dongle and reboot.
After reboot connect your bt client and check how it works.

Please upload ce debug logs again. They are found in ce settings, complete log with kodi.log is required.

OK, but please be patient and don’t expect any results before saturday. RL keeps me busy.

btw: if I reboot with “reboot”, then it takes very long for the system to restart. With “reboot -f” (force) it is instantly. Are there any disadvantages using “-f” for rebooting?
Thx

@Portisch
Here are the debug-logs:
https://filebin.net/uij33x099t6j61pd
But in the debug-build it is working! very strange.
Turning BT-device on and off while playing switches between TV and BT-audio almost instantly.
I tried it back and forth.
So, no error or bug with this debug-build.

What can I do to make my other installation working like the debug-build? deleting userdata/addon-data?

You did setup something wrong or restored some old user data.

The exception you had did only happen on your system. So something is faulty on your setup.
Perform a complete clean install and try again with Nightly image.

After renameing kodi-dir and restarting everything is working as expected.
I’ll move addon-data back, step by step and see, whats causing the issue.
Will report back, if I find something
Thx

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.