batocera-linux / batocera.linux

batocera.linux
https://batocera.org
Other
1.98k stars 513 forks source link

Tinkerboard no internal BT device #3369

Open crcerror opened 3 years ago

crcerror commented 3 years ago

For stable B30 release, there is no internal BT device available

edit

# dmesg | grep blue
[    1.294876] of_get_named_gpiod_flags: parsed 'uart_rts_gpios' property of node '/wireless-bluetooth[0]' - status (0)
[    1.294879] [BT_RFKILL]: bluetooth_platdata_parse_dt: get property: uart_rts_gpios = 139.
[    1.294885] of_get_named_gpiod_flags: can't parse 'BT,power_gpio' property of node '/wireless-bluetooth[0]'
[    1.294895] of_get_named_gpiod_flags: parsed 'BT,reset_gpio' property of node '/wireless-bluetooth[0]' - status (0)
[    1.294898] [BT_RFKILL]: bluetooth_platdata_parse_dt: get property: BT,reset_gpio = 149.
[    1.294908] of_get_named_gpiod_flags: parsed 'BT,wake_gpio' property of node '/wireless-bluetooth[0]' - status (0)
[    1.294911] [BT_RFKILL]: bluetooth_platdata_parse_dt: get property: BT,wake_gpio = 146.
[    1.294921] of_get_named_gpiod_flags: parsed 'BT,wake_host_irq' property of node '/wireless-bluetooth[0]' - status (0)
[    1.294924] [BT_RFKILL]: bluetooth_platdata_parse_dt: get property: BT,wake_host_irq = 151.
[    1.294928] [BT_RFKILL]: bluetooth_platdata_parse_dt: clk_get failed!!!.
mrfixit2001 commented 3 years ago

I believe the reason the tinkerboard's bluetooth stopped working is because this patch was removed when bluez was updated: https://github.com/batocera-linux/batocera.linux/blob/master/board/batocera/rockchip/rk3288/tinkerboard/patches/bluez5_utils-5.47/bluez5_utils-add-rtl-bt.patch

in this commit: https://github.com/batocera-linux/batocera.linux/commit/18605fa4e89e571f9c5743f53119933c36385c99#diff-fd1a04763c75333e8fe555828bb72fdc635b5b79be620bd07d2e96018e53a5f9

As far as I know, the ability to attach realtek firmware in bluez was not upstreamed. I pieced that patch together myself to add the ability into bluez without the need for yet another binary. Without hciattach including the rtk_h5 driver, then the batocera bluetooth stack won't correctly load the firmware on bootup.

I haven't tried reworking the patch for your bluez bump, and sadly won't have time for awhile. It might be a quick rework though!

The other option would be to add another buildroot package to compile a tool used only for tinkerboard in place of hciattach.

crcerror commented 3 years ago

@mrfixit2001 would this resolve the 1Pad bug? The Tinker internal BT module was only able to handle a single BT connection means you can not connect to a second Pad.

mrfixit2001 commented 3 years ago

This missing patch will result in the tinkerboard bluetooth not working at all due to firmware not loading.

If I had to guess about the 1-pad issue, it's because my patch was based on the hciattach_rtk version 2.5. I believe they are up to 3.1.8 now. The file "tools/hciattach_rtk_h5.c" in my patch would need to be reworked to include the updates from the newer version.

But that's just my best guess.