Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RK3588] Radxa A8 RTL8852BE bluetooth not working #13084

Open
florian-boehm opened this issue Dec 18, 2024 · 7 comments
Open

[RK3588] Radxa A8 RTL8852BE bluetooth not working #13084

florian-boehm opened this issue Dec 18, 2024 · 7 comments

Comments

@florian-boehm
Copy link

florian-boehm commented Dec 18, 2024

Batocera build version

40 2024/08/12 00:36

Your architecture

RK3588 Rock 5b

Your Graphic Processor Unit(s) (GPU)

Integrated Mali G610MP4

Issue description

Wifi Card: Radxa A8 RTL8852BE v1 (0bda:b85b)

Bluetooth Pairing in EmulationStation does not show any devices.
Furthermore bluetootctl list on CLI shows no bluetooth controllers.

I am able to compile and flash images and am eager to help debugging.

Information about the Wifi+BT combo card: https://docs.radxa.com/en/accessories/wireless-a8

Detailed reproduction steps

I flashed batocera 40 to the Rock 5b.
After boot I tried to pair an Xbox Controller using the GUI.
The search for devices never stops and never shows results.
I also tried to scan manually with bluetootctl but it does not show any bluetooth controller.

Afterwards I compiled a newer version (41-dev-d1a1c59) with the same result.

Details of any attempts to fix this yourself

No response

Details of any modifications you have made to Batocera.

No modifications

Logs and data

Output of lsusb | grep -i 'blue':

Bus 005 Device 003: ID 0bda:b85b Realtek Semiconductor Corp. Bluetooth Radio

Output of rfkill:

ID TYPE      DEVICE      SOFT      HARD
 0 bluetooth hci0   unblocked unblocked
 1 wlan      phy0   unblocked unblocked

Output of dmesg | grep -Ei 'blue|firm|hci':

[    8.223807] psci: PSCIv1.1 detected in firmware.
[    9.489733] arm-scmi firmware:scmi: Enabled polling mode TX channel - prot_id:16
[    9.489791] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[    9.489827] arm-scmi firmware:scmi: SCMI Protocol v2.0 'rockchip:' Firmware version 0x0
[    9.490550] Bluetooth: Core ver 2.22
[    9.490567] NET: Registered PF_BLUETOOTH protocol family
[    9.490573] Bluetooth: HCI device and connection manager initialized
[    9.490580] Bluetooth: HCI socket layer initialized
[    9.490587] Bluetooth: L2CAP socket layer initialized
[    9.490596] Bluetooth: SCO socket layer initialized
[    9.651313] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
[    9.651331] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 1
[    9.651409] xhci-hcd xhci-hcd.3.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000800002010010
[    9.651435] xhci-hcd xhci-hcd.3.auto: irq 67, io mem 0xfcd00000
[    9.651504] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
[    9.651512] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 2
[    9.651521] xhci-hcd xhci-hcd.3.auto: Host supports USB 3.0 SuperSpeed
[    9.651611] usb usb1: Product: xHCI Host Controller
[    9.651617] usb usb1: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.651623] usb usb1: SerialNumber: xhci-hcd.3.auto
[    9.652102] usb usb2: Product: xHCI Host Controller
[    9.652109] usb usb2: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.652115] usb usb2: SerialNumber: xhci-hcd.3.auto
[    9.652519] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
[    9.652530] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 3
[    9.652615] xhci-hcd xhci-hcd.4.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000800002010010
[    9.652638] xhci-hcd xhci-hcd.4.auto: irq 68, io mem 0xfc400000
[    9.652713] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
[    9.652721] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 4
[    9.652730] xhci-hcd xhci-hcd.4.auto: Host supports USB 3.0 SuperSpeed
[    9.652805] usb usb3: Product: xHCI Host Controller
[    9.652811] usb usb3: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.652818] usb usb3: SerialNumber: xhci-hcd.4.auto
[    9.652907] ehci-platform fc880000.usb: EHCI Host Controller
[    9.652930] ohci-platform fc8c0000.usb: Generic Platform OHCI controller
[    9.653112] ehci-platform fc800000.usb: EHCI Host Controller
[    9.653127] ohci-platform fc840000.usb: Generic Platform OHCI controller
[    9.653154] ehci-platform fc800000.usb: new USB bus registered, assigned bus number 5
[    9.653231] usb usb4: Product: xHCI Host Controller
[    9.653237] usb usb4: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.653244] usb usb4: SerialNumber: xhci-hcd.4.auto
[    9.653289] ehci-platform fc800000.usb: irq 70, io mem 0xfc800000
[    9.653578] ehci-platform fc880000.usb: new USB bus registered, assigned bus number 6
[    9.653603] ohci-platform fc8c0000.usb: new USB bus registered, assigned bus number 7
[    9.653617] ohci-platform fc840000.usb: new USB bus registered, assigned bus number 8
[    9.653646] ehci-platform fc880000.usb: irq 69, io mem 0xfc880000
[    9.653740] ohci-platform fc8c0000.usb: irq 72, io mem 0xfc8c0000
[    9.653764] ohci-platform fc840000.usb: irq 71, io mem 0xfc840000
[    9.664459] ehci-platform fc800000.usb: USB 2.0 started, EHCI 1.00
[    9.664896] usb usb5: Product: EHCI Host Controller
[    9.664910] usb usb5: Manufacturer: Linux 6.1.75 ehci_hcd
[    9.677775] ehci-platform fc880000.usb: USB 2.0 started, EHCI 1.00
[    9.678070] usb usb6: Product: EHCI Host Controller
[    9.678085] usb usb6: Manufacturer: Linux 6.1.75 ehci_hcd
[    9.711965] usb usb8: Product: Generic Platform OHCI controller
[    9.711976] usb usb8: Manufacturer: Linux 6.1.75 ohci_hcd
[    9.712933] usb usb7: Product: Generic Platform OHCI controller
[    9.712945] usb usb7: Manufacturer: Linux 6.1.75 ohci_hcd
[    9.755821] sdhci: Secure Digital Host Controller Interface driver
[    9.755824] sdhci: Copyright(c) Pierre Ossman
[    9.755932] sdhci-pltfm: SDHCI platform and OF driver helper
[    9.756768] sdhci-dwcmshc fe2e0000.mmc: Looking up vmmc-supply from device tree
[    9.756779] sdhci-dwcmshc fe2e0000.mmc: Looking up vmmc-supply property in node /mmc@fe2e0000 failed
[    9.756798] sdhci-dwcmshc fe2e0000.mmc: Looking up vqmmc-supply from device tree
[    9.756806] sdhci-dwcmshc fe2e0000.mmc: Looking up vqmmc-supply property in node /mmc@fe2e0000 failed
[    9.756839] mmc0: CQHCI version 5.10
[    9.756917] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[    9.758336] optee: probe of firmware:optee failed with error -22
[    9.787675] mmc0: SDHCI controller on fe2e0000.mmc [fe2e0000.mmc] using ADMA
[    9.917840] usb 5-1: new high-speed USB device number 2 using ehci-platform
[   10.139806] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   10.474500] usb 5-1.3: new full-speed USB device number 3 using ehci-platform
[   10.689831] usb 5-1.3: Product: Bluetooth Radio
[   16.349342] panthor fb000000.gpu: [drm] Firmware protected mode entry not be supported, ignoring
[   16.358392] Bluetooth: HCI UART driver ver 2.3
[   16.358406] Bluetooth: HCI UART protocol H4 registered
[   16.358408] Bluetooth: HCI UART protocol BCSP registered
[   16.358410] Bluetooth: HCI UART protocol ATH3K registered
[   16.358463] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   16.358552] Bluetooth: HCI UART protocol Intel registered
[   16.360221] Bluetooth: HCI UART protocol Broadcom registered
[   16.360240] Bluetooth: HCI UART protocol QCA registered
[   16.360242] Bluetooth: HCI UART protocol AG6XX registered
[   16.361129] hci_uart_bcm serial0-0: Looking up vbat-supply from device tree
[   16.361376] hci_uart_bcm serial0-0: Looking up vddio-supply from device tree
[   16.361394] hci_uart_bcm serial0-0: Looking up vddio-supply property in node /serial@feb90000/bluetooth failed
[   16.361429] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[   16.616489] rtw89_8852be 0002:21:00.0: Firmware version 0.27.32.1, cmd version 0, type 1
[   16.616507] rtw89_8852be 0002:21:00.0: Firmware version 0.27.32.1, cmd version 0, type 3
[   18.621205] Bluetooth: hci0: command 0xfc18 tx timeout
[   26.727856] Bluetooth: hci0: BCM: failed to write update baudrate (-110)
[   26.727875] Bluetooth: hci0: Failed to set baudrate
[   28.861171] Bluetooth: hci0: command 0x0c03 tx timeout
[   34.544300] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   34.544361] Bluetooth: BNEP filters: protocol multicast
[   34.544388] Bluetooth: BNEP socket layer initialized
[   36.757813] Bluetooth: hci0: BCM: Reset failed (-110)

Output of lsmod:

Module                  Size  Used by
nfsd                  479232  3
bnep                   24576  2
8021q                  28672  0
garp                   20480  1 8021q
stp                    16384  1 garp
mrp                    20480  1 8021q
llc                    16384  2 stp,garp
ipv6                  516096  92
rtw89_8852be           16384  0
rtw89_8852b           303104  1 rtw89_8852be
pwm_fan                20480  0
rtw89_pci              49152  1 rtw89_8852be
rtw89_core            270336  2 rtw89_8852b,rtw89_pci
hci_uart              114688  0
btqca                  20480  1 hci_uart
r8169                  86016  0
panthor               114688  4
btusb                  57344  0
btmtk                  16384  1 btusb
btrtl                  20480  2 hci_uart,btusb
drm_gpuvm              28672  1 panthor
drm_exec               16384  2 drm_gpuvm,panthor
btbcm                  24576  2 hci_uart,btusb
drm_shmem_helper       20480  1 panthor
btintel                36864  2 hci_uart,btusb
gpu_sched              36864  1 panthor

Output of hciconfig -a:

hci0:   Type: Primary  Bus: UART
        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:14 acl:0 sco:0 commands:2 errors:0
        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DH1 HV1 
        Link policy: 
        Link mode: PERIPHERAL ACCEPT 
@dmanlfc
Copy link
Collaborator

dmanlfc commented Dec 19, 2024

Try v41, either do an upgrade to the beta or the the image from here: https://mirrors.o2switch.fr/batocera/rock-5b/butterfly/last/

@florian-boehm
Copy link
Author

florian-boehm commented Dec 21, 2024

I did multiple things to get bluetooth (with this specific card) working again:

  1. Compile recent commit 07204a8 => bluetooth still did not work
  2. Reverted the changes in the file "rk3588-rock-5b.dts" brought in by commit 4fe6cf1 on the armbian repository => bluetooth still did not work
  3. Added a new package based on lwfinger/rtw89-BT#5c20a3c => bluetooth still did not work
  4. Manually replaced /lib/firmware/rtl_bt/rtl8552bu_config.bin and /lib/firmware/rtl_bt/rtl8552bu_fw.bin with files from this radxa-pkg/radxa-firmware#e69296a. After modprobe -rv btusb && modprobe -v btusb => bluetooth now works

I still need time and help to figure out:

  • Which of these steps are actually necessary (maybe the last two are sufficient)
  • How to add the firmware of step 4 automatically with buildroot (all other steps were simple)
  • How to do these changes without breaking any other rk3588 boards or wifi/bt cards

Changes for step 2 and 3 can be found in my branch https://github.com/florian-boehm/batocera.linux/tree/fix-rtl8552be-bluetooth

Output of hciconfig -a:

hci0:   Type: Primary  Bus: USB
        BD Address: 2C:05:47:79:75:F7  ACL MTU: 1021:6  SCO MTU: 255:12
        UP RUNNING 
        RX bytes:201193 acl:7042 sco:0 events:683 errors:0
        TX bytes:42764 acl:148 sco:0 commands:388 errors:0
        Features: 0xff 0xff 0xff 0xfa 0xdb 0xbf 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF PARK 
        Link mode: PERIPHERAL ACCEPT 
        Name: 'Radxa_ROCK_5B'
        Class: 0x6c0000
        Service Classes: Rendering, Capturing, Audio, Telephony
        Device Class: Miscellaneous, 
        HCI Version: 5.2 (0xb)  Revision: 0xdfb7
        LMP Version: 5.2 (0xb)  Subversion: 0x6f6f
        Manufacturer: Realtek Semiconductor Corporation (93)

Scanning and pairing with bluetoothctl worked. Automatic reconnect of the bluetooth devices worked.

@florian-boehm
Copy link
Author

florian-boehm commented Jan 1, 2025

I further investigated the root cause. Removing board/batocera/rockchip/rk3588/linux_patches/002-radxa-wireless-a8-workaround.patc and using the firmware blobs from radxa-firmware/commit/e69296a is all that is needed to get BT working. However, I am not fully satisfied since dmesg still gives some errors. It still tries to do something with the hci1 device that does not work. And for the BT card (which is hci0) it can not read codec capabilities. So I think it will only allow me to use SBC audio right now.

Help appreciated since I am not sure how to fix the remaining issues:

[    8.224303] psci: PSCIv1.1 detected in firmware.
[    9.489914] arm-scmi firmware:scmi: Enabled polling mode TX channel - prot_id:16
[    9.489970] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[    9.490006] arm-scmi firmware:scmi: SCMI Protocol v2.0 'rockchip:' Firmware version 0x0
[    9.490735] Bluetooth: Core ver 2.22
[    9.490752] NET: Registered PF_BLUETOOTH protocol family
[    9.490757] Bluetooth: HCI device and connection manager initialized
[    9.490764] Bluetooth: HCI socket layer initialized
[    9.490769] Bluetooth: L2CAP socket layer initialized
[    9.490778] Bluetooth: SCO socket layer initialized
[    9.641081] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
[    9.641098] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 1
[    9.641175] xhci-hcd xhci-hcd.3.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000800002010010
[    9.641202] xhci-hcd xhci-hcd.3.auto: irq 67, io mem 0xfcd00000
[    9.641266] xhci-hcd xhci-hcd.3.auto: xHCI Host Controller
[    9.641289] xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 2
[    9.641297] xhci-hcd xhci-hcd.3.auto: Host supports USB 3.0 SuperSpeed
[    9.641383] usb usb1: Product: xHCI Host Controller
[    9.641389] usb usb1: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.641395] usb usb1: SerialNumber: xhci-hcd.3.auto
[    9.641860] usb usb2: Product: xHCI Host Controller
[    9.641866] usb usb2: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.641872] usb usb2: SerialNumber: xhci-hcd.3.auto
[    9.642269] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
[    9.642278] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 3
[    9.642363] xhci-hcd xhci-hcd.4.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000800002010010
[    9.642385] xhci-hcd xhci-hcd.4.auto: irq 68, io mem 0xfc400000
[    9.642455] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller
[    9.642463] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 4
[    9.642471] xhci-hcd xhci-hcd.4.auto: Host supports USB 3.0 SuperSpeed
[    9.642544] usb usb3: Product: xHCI Host Controller
[    9.642550] usb usb3: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.642556] usb usb3: SerialNumber: xhci-hcd.4.auto
[    9.642618] ehci-platform fc880000.usb: EHCI Host Controller
[    9.642637] ohci-platform fc8c0000.usb: Generic Platform OHCI controller
[    9.642832] ehci-platform fc800000.usb: EHCI Host Controller
[    9.642839] ohci-platform fc840000.usb: Generic Platform OHCI controller
[    9.642917] ohci-platform fc840000.usb: new USB bus registered, assigned bus number 5
[    9.642920] ehci-platform fc800000.usb: new USB bus registered, assigned bus number 6
[    9.642972] ohci-platform fc840000.usb: irq 71, io mem 0xfc840000
[    9.642998] usb usb4: Product: xHCI Host Controller
[    9.643003] usb usb4: Manufacturer: Linux 6.1.75 xhci-hcd
[    9.643009] usb usb4: SerialNumber: xhci-hcd.4.auto
[    9.643062] ehci-platform fc800000.usb: irq 70, io mem 0xfc800000
[    9.643328] ehci-platform fc880000.usb: new USB bus registered, assigned bus number 7
[    9.643346] ohci-platform fc8c0000.usb: new USB bus registered, assigned bus number 8
[    9.643393] ehci-platform fc880000.usb: irq 69, io mem 0xfc880000
[    9.643456] ohci-platform fc8c0000.usb: irq 72, io mem 0xfc8c0000
[    9.657976] ehci-platform fc800000.usb: USB 2.0 started, EHCI 1.00
[    9.658415] usb usb6: Product: EHCI Host Controller
[    9.658429] usb usb6: Manufacturer: Linux 6.1.75 ehci_hcd
[    9.671285] ehci-platform fc880000.usb: USB 2.0 started, EHCI 1.00
[    9.671590] usb usb7: Product: EHCI Host Controller
[    9.671604] usb usb7: Manufacturer: Linux 6.1.75 ehci_hcd
[    9.702028] usb usb5: Product: Generic Platform OHCI controller
[    9.702031] usb usb5: Manufacturer: Linux 6.1.75 ohci_hcd
[    9.702229] usb usb8: Product: Generic Platform OHCI controller
[    9.702232] usb usb8: Manufacturer: Linux 6.1.75 ohci_hcd
[    9.744019] sdhci: Secure Digital Host Controller Interface driver
[    9.744023] sdhci: Copyright(c) Pierre Ossman
[    9.744223] sdhci-pltfm: SDHCI platform and OF driver helper
[    9.744863] sdhci-dwcmshc fe2e0000.mmc: Looking up vmmc-supply from device tree
[    9.744874] sdhci-dwcmshc fe2e0000.mmc: Looking up vmmc-supply property in node /mmc@fe2e0000 failed
[    9.744896] sdhci-dwcmshc fe2e0000.mmc: Looking up vqmmc-supply from device tree
[    9.744903] sdhci-dwcmshc fe2e0000.mmc: Looking up vqmmc-supply property in node /mmc@fe2e0000 failed
[    9.744945] mmc0: CQHCI version 5.10
[    9.745048] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[    9.746571] optee: probe of firmware:optee failed with error -22
[    9.774612] mmc0: SDHCI controller on fe2e0000.mmc [fe2e0000.mmc] using ADMA
[    9.908154] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    9.911297] usb 6-1: new high-speed USB device number 2 using ehci-platform
[   10.458010] usb 6-1.3: new full-speed USB device number 3 using ehci-platform
[   10.673197] usb 6-1.3: Product: Bluetooth Radio
[   11.835572] Bluetooth: hci0: RTL: examining hci_ver=0b hci_rev=000b lmp_ver=0b lmp_subver=8852
[   11.836514] Bluetooth: hci0: RTL: rom_version status=0 version=1
[   11.836543] Bluetooth: hci0: RTL: loading rtl_bt/rtl8852bu_fw.bin
[   11.841290] Bluetooth: hci0: RTL: loading rtl_bt/rtl8852bu_config.bin
[   11.843367] Bluetooth: hci0: RTL: cfg_sz 14, total sz 34971
[   11.855804] Bluetooth: HCI UART driver ver 2.3
[   11.855818] Bluetooth: HCI UART protocol H4 registered
[   11.855824] Bluetooth: HCI UART protocol BCSP registered
[   11.855830] Bluetooth: HCI UART protocol ATH3K registered
[   11.856497] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   11.856616] Bluetooth: HCI UART protocol Intel registered
[   11.856693] Bluetooth: HCI UART protocol Broadcom registered
[   11.856720] Bluetooth: HCI UART protocol QCA registered
[   11.856722] Bluetooth: HCI UART protocol AG6XX registered
[   11.857734] hci_uart_bcm serial0-0: Looking up vbat-supply from device tree
[   11.857869] hci_uart_bcm serial0-0: Looking up vddio-supply from device tree
[   11.857876] hci_uart_bcm serial0-0: Looking up vddio-supply property in node /serial@feb90000/bluetooth failed
[   11.857891] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[   11.865480] panthor fb000000.gpu: [drm] Firmware protected mode entry not be supported, ignoring
[   12.084495] Bluetooth: hci0: RTL: fw version 0xdfb76f6f
[   12.116590] rtw89_8852be 0002:21:00.0: Firmware version 0.27.32.1, cmd version 0, type 1
[   12.116608] rtw89_8852be 0002:21:00.0: Firmware version 0.27.32.1, cmd version 0, type 3
[   12.161485] Bluetooth: hci0: Failed to read codec capabilities (-22)
[   14.141448] Bluetooth: hci1: command 0xfc18 tx timeout
[   22.248107] Bluetooth: hci1: BCM: failed to write update baudrate (-110)
[   22.248131] Bluetooth: hci1: Failed to set baudrate
[   24.381343] Bluetooth: hci1: command 0x0c03 tx timeout
[   26.014480] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   26.014534] Bluetooth: BNEP filters: protocol multicast
[   26.014557] Bluetooth: BNEP socket layer initialized
[   26.016488] Bluetooth: MGMT ver 1.22
[   26.033399] Bluetooth: RFCOMM TTY layer initialized
[   26.033461] Bluetooth: RFCOMM socket layer initialized
[   26.033484] Bluetooth: RFCOMM ver 1.11
[   26.113486] Bluetooth: hci0: Failed to read codec capabilities (-22)
[   32.274724] Bluetooth: hci1: BCM: Reset failed (-110)

@m33ts4k0z
Copy link
Contributor

m33ts4k0z commented Jan 2, 2025

Hello.

I am experiencing the same issue with my Orange pi 5 plus that uses the same module (RTL8852BE). Strangely enough, I couldn't find anything documented about this anywhere on batocera. I assumed that it was supposed to work but apparently not. I also tried v41.

@florian-boehm I tried replacing these files from Radxa but it doesnt seem to work in my case. I wonder though, if the real problem here is the symlink of the config file. Batocera points it to rtl8761bu_config.bin but maybe the Radxa config points it to another?

EDIT: Ok I think I now know what is happening. This chip was supported upstream from kernel 6.10. V41 of batocera is running 6.1.75 so it still doesnt support the BT part of this module. Once the kernel is bumped, it should work out of the box. v42 should solve it since it runs 6.12.6

@florian-boehm
Copy link
Author

florian-boehm commented Jan 2, 2025

@m33ts4k0z

Do you mean the following symlinks? In my case they point to the correct files. I did not change them.

[root@BATOCERA /userdata/system]# ls -lah /lib/firmware/ | grep rtl8852
lrwxrwxrwx   1 root root    41 Dec 30 04:35 rtl8852bu_config -> /lib/firmware/rtl_bt/rtl8852bu_config.bin
lrwxrwxrwx   1 root root    37 Dec 30 04:35 rtl8852bu_fw -> /lib/firmware/rtl_bt/rtl8852bu_fw.bin

MD5 hash sums for comparison:

[root@BATOCERA /userdata/system]# md5sum /lib/firmware/rtl_bt/rtl8852bu*
e9a0ee7f815f901ff9347dee4f1e2e11  /lib/firmware/rtl_bt/rtl8852bu_config.bin
8eac74dbbd44b4a910f8ce68cf207b4e  /lib/firmware/rtl_bt/rtl8852bu_fw.bin

If you do manual changes there, you should run "batocera-save-overlay" before rebooting. Otherwise the changes are lost.

If you have a batocera version which was compiled with this patch file the kernel module "btusb" will just fully ignore the RTL8852BE. As I understand it correctly it will not even load those firmware files then. You could try to replace it with my btusb.ko.gz. Put it into /lib/modules/6.1.75/kernel/drivers/bluetooth/btusb.ko and run modprobe -rv btusb && modprobe -v btusb.

EDIT: Hopefully the newer kernel solves the problem 👍

@m33ts4k0z
Copy link
Contributor

m33ts4k0z commented Jan 2, 2025

@florian-boehm I will try to compile from master now just to check v42. I will let you know how it goes and if I even succeed compiling it as I haven't done it before 😁

PS: I don't think there is anything wrong with the firmware as they are mainline.

PS2: Indeed replacing the patched file with yours and using the Radxa firmware made bluetooth work for me as well. However the batocera UI still doesnt show devices but I was able to find ALL available devices near me using scan on from the command line. Let's see how it goes with v42 😁

PS3: The reason of the existance of this patch seems to be a conflict with the wifi chip. Using your driver file, I got both the BT and WiFi working at the same time so I think this patch is no longer needed. It's 2 years old now anyway.

PS4: Actually scratch what I said about kernel 6.12.6. Obviously this is only for x86_64 since rockchip has only released 6.11 firmware for their devices. I am not that sure about the state of it though as HDMI wasn't working before but it may be patched now ( a patch was submitted in October on mainline)

@m33ts4k0z
Copy link
Contributor

m33ts4k0z commented Jan 5, 2025

So after some tries, I think I now know what is happening.

First, as @florian-boehm said, the patch that blacklists the BT USB device, needs to be removed since this is how Realtek assigns these 2 devices on this module: PCIE for WiFi and USB for BT.

Then the main issue:

The RK3588 has this instruction in the .config file: BR2_PACKAGE_ALLLINUXFIRMWARES=y
This causes the mainline firmware files to be pulled and is also required by BR2_PACKAGE_FIRMWARE_RK3588=y

The problem with this is that the mainline firmware file is not compatible with the latest stable rockchip kernel for the RK3588 (v6.1.75)

So what is apparently needed is to use an approach like it is done here, that is to upload the firmware files in the package itself, and then copy them to the output/target filesystem manually before we create the final image.

This feels like the right approach that will not break anything with any RK3588 board since they are all still locked to the custom kernel version provided by Rockchip (Although mainline progress is made by Collabora)

This also doesn't seem to affect wifi, as it seems to still work well after removing the patch.

That said I created a PR that does exactly that but I am totally new to any of this so feel free to tweak it as you find best 😁

For the time being, I uploaded 2 images (v42-dev) with working BT that you can try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants