ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bluetooth is not working on X96MaxPlus_2101

drafort opened this issue · comments

Model: X96MaxPlus_2101
WiFi & Bluetooth chip: FN-LINK 6222B (rtl88x2cs)

IPC_2023-02-19 00 04 45 9580
IPC_2023-02-19 00 02 34 7300

IMG_20230220_142009

Armbian: Armbian 23.02.0-trunk Jammy with Linux 6.1.12-flippy-82+
Booting from sdcard
Bluetooth already installed from armbian-config, but no Bluetooth devices found, however, on installed ("from the box") at emmc Android 9, Bluetooth working perfectly.

Screenshot_20230220_131451

Screenshot_20230220_131507
Screenshot_20230220_132020

/boot/uEnv.txt change dtb: meson-sm1-x96-max-plus.dtb

https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-sm1-x96-max-plus.dts#L185-L197

Thank you to reply!
Dtb changed as pointed.
Still no Bluetooth devices available
Screenshot_20230220_154404
Screenshot_20230220_154331
Screenshot_20230220_154419
Uploading Screenshot_20230220_154507.jpg…

commented

armbian-config > Network > Install Bluetooth Support

Or it's important to change Linux kernel to 5.15 from 6.1? And to use Jammy 5.15.94?

commented

https://github.com/ophub/kernel/tree/main/pub/stable

This dtb is available in four series (5.4/5.10/5.15/6.1) kernels. You can switch freely

armbian-update -k 5.x.y

armbian-config > Network > Install Bluetooth Support

already been installed
no devices found
Screenshot_20230220_160014
Screenshot_20230220_154507

commented

Update other series of kernels to see which can drive

Update other series of kernels to see which can drive

Thanks!
I'm trying now and will give feedback here

Update other series of kernels to see which can drive

Kernel was updated to 5.15.94 using armbian-update -k
Still no Bluetooth devices found.
Bluetooth support is installed from armbian-config.

Screenshot_20230220_171411

Kernel downgraded to 5.10.168
But still no Bluetooth devices found
Screenshot_20230220_181118_org connectbot
Screenshot_20230220_182618

Kernel was downgraded to 5.4.231
But result is the same: no Bluetooth devices found. What to do?

Screenshot_20230220_192609

upd:
Tried to use Debian bullseye 5.15.94 instead Ubuntu (usb flash drive and sd card)
System is not booting up with dtb "meson .... max_plus" and "meson .... max_plus_100".
Successfully started with "meson .... x96_air_1000", but still no Bluetooth devices found (Bluetooth support was installed from debian-config).
May be problem is in dtb?

commented

unifreq/linux-5.15.y@d1a5aff

This driver is added by a third party, some people can use it, some people can't, it's unstable.
Give up if the test fails, there is no other way at present.

I have same tv box, im able to edit the dtb to activate the bluetooth. currently using 6.1.12 kernel

here is my dtb, extract, then replace meson-sm1-x96-max-plus.dtb in /boot/dtb/amlogic
dont know yet if it's stable or not, but it works on me

meson-sm1-x96-max-plus.zip

Thank you!
It's more better, but errors occurred.
Screenshot_20230222_121231
May be I do something wrong?

ps. Bluetooth support was installed from armbian-config

maybe driver issue, not sure, try another kernel.
try to use it first, if it works, u can just ignore it

maybe driver issue, not sure, try another kernel. try to use it first, if it works, u can just ignore it

not working: no device
Screenshot_20230222_122424

now I'm trying with Ubuntu 6.1 instead Debian 6.1

sudo rfkill , see if the bt device listed

sudo rfkill , see if the bt device listed

yes, it listed
Screenshot_20230222_123039

sorry, dont know much, try to change the kernel

sorry, dont know much, try to change the kernel

Thank you! I'll try and leave feedback

Kernel was downgraded to 5.15.94
hci0 is disappeared from rfkill list(
Bluetooth support is installed from armbian-config

Screenshot_20230222_135012

you need to replace the dtb again.

you need to replace the dtb again.

cannot start system (deb 5.15.94) with this dtb

I think that's driver problem. May be possible to inject to dtb this driver?https://codeberg.org/Hiyurigi/rtl88x2cs

hmm, try using bullseye 6.1.12

and use sudo bluetoothctl

hmm, try using bullseye 6.1.12

Already tryed, used "bluetoothctl" from root.
(see upper).

Screenshot_20230222_121231
Screenshot_20230222_123034_org connectbot

Or it's important to execute "bluetoothctl" from root with "sudo"?

then run these command

sudo systemctl edit --full bluetooth
find and edit this line to
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap

then run command sudo systemctl restart bluetooth

check if it works, good luck

'vei compiled new dtb, try this one

https://github.com/salsabilng/amlogic-s9xxx-armbian/releases/download/kernel_5.15.94/5.15.94.tar.gz

then run these command

sudo systemctl edit --full bluetooth find and edit this line to ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap

then run command sudo systemctl restart bluetooth

check if it works, good luck

Big thanks!!!
I'll try and leave feedback!

Thank you!

Tested with "fresh install" (from usb) armbian bullseye 5.15.94 and dtb "meson....x96_max_plus" from your archive above.
System cannot boot up.

use 6.1.12

by the way, ive tried many times using usb with 5.15.y kernel and older on this box, and never succeed to boot. so use 6.1.y kernel only for usb uses.

in my case, i installed the armbian into emmc, and using the mainline boot, then i can get any kernel version working,

by the way, ive tried many times using usb with 5.15.y kernel and older on this box, and never succeed to boot. so use 6.1.y kernel only for usb uses.

in my case, i installed the armbian into emmc, and using the mainline boot, then i can get any kernel version working,

Thanks!
I tested 6.1.
Screenshot_20230223_110337
Screenshot_20230223_110249
Screenshot_20230223_110149

It's still no success.

ps.
5.15. successfully started with dtb from X96-air-1000

commented

Can Bluetooth of rtl8822cs be used? Which dtb are you using?
cat /boot/uEnv.txt

i have changes the dts, so the bluetooth can be recognized. this is mine

sudo dmesg | grep Bluetooth
[ 9.251609] Bluetooth: Core ver 2.22
[ 9.254518] Bluetooth: Starting self testing
[ 9.270179] Bluetooth: ECDH test passed in 11166 usecs
[ 9.279533] Bluetooth: SMP test passed in 4612 usecs
[ 9.284159] Bluetooth: Finished self testing
[ 9.292851] Bluetooth: HCI device and connection manager initialized
[ 9.299791] Bluetooth: HCI socket layer initialized
[ 9.307051] Bluetooth: L2CAP socket layer initialized
[ 9.318039] Bluetooth: SCO socket layer initialized
[ 9.399020] Bluetooth: HCI UART driver ver 2.3
[ 9.400505] Bluetooth: HCI UART protocol H4 registered
[ 9.415186] Bluetooth: HCI UART protocol BCSP registered
[ 9.451454] Bluetooth: HCI UART protocol LL registered
[ 9.453643] Bluetooth: HCI UART protocol ATH3K registered
[ 9.459248] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 9.474270] Bluetooth: HCI UART protocol Intel registered
[ 9.506858] Bluetooth: HCI UART protocol Broadcom registered
[ 9.507697] Bluetooth: HCI UART protocol QCA registered
[ 9.507707] Bluetooth: HCI UART protocol AG6XX registered
[ 9.507756] Bluetooth: HCI UART protocol Marvell registered
[ 10.201635] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000c lmp_ver=0a lmp_subver=8822
[ 10.209214] Bluetooth: hci0: RTL: rom_version status=0 version=3
[ 10.211403] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_fw.bin
[ 10.221651] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_config.bin
[ 10.255242] Bluetooth: hci0: RTL: cfg_sz 73, total sz 40777
[ 10.602803] Bluetooth: hci0: RTL: fw version 0x05a91a4a
[ 14.824900] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 14.826059] Bluetooth: BNEP filters: protocol multicast
[ 14.831025] Bluetooth: BNEP socket layer initialized
[ 14.845046] Bluetooth: MGMT ver 1.22

bluetoothctl
Agent registered
[��CHG��] Controller 5C:C5:63:9F:C1:95 Pairable: yes
[bluetooth]# show
Controller 5C:C5:63:9F:C1:95 (public)
Name: blackBox
Alias: blackBox
Class: 0x00000000
Powered: yes
Discoverable: no
DiscoverableTimeout: 0x000000b4
Pairable: yes
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0537
Discovering: no
Roles: central
Roles: peripheral
Advertising Features:
ActiveInstances: 0x00 (0)
SupportedInstances: 0x04 (4)
SupportedIncludes: tx-power
SupportedIncludes: appearance
SupportedIncludes: local-name
SupportedSecondaryChannels: 1M
SupportedSecondaryChannels: 2M
SupportedSecondaryChannels: Coded

cat /etc/ophub-release
PLATFORM='amlogic'
VERSION_CODEID='debian'
VERSION_CODENAME='bullseye'
SOC='s905x3'
MODEL_NAME='X96-Max+_100Mb'
FDTFILE='meson-sm1-x96-max-plus.dtb'
UBOOT_OVERLOAD='u-boot-x96maxplus.bin'
MAINLINE_UBOOT='/usr/lib/u-boot/x96maxplus-u-boot.bin.sd.bin'
BOOTLOADER_IMG='/usr/lib/u-boot/hk1box-bootloader.img'
FAMILY='meson-sm1'
BOARD='s905x3'
KERNEL_VERSION='6.1.12'
KERNEL_BRANCH='stable'
K510='0'
ROOTFS_TYPE='btrfs'
BOOT_CONF='uEnv.txt'
DISK_TYPE='emmc'
MLUBOOT_STATUS='yes'
AMPART_STATUS='yes'
PACKAGED_DATE='2023-01-16'

personally, i never use the bluetooth, so i dont know will it works for transfering file or just streaming a music via bluetooth. The bluetooth can discover my other device and pair to it.

by the way, ive tried many times using usb with 5.15.y kernel and older on this box, and never succeed to boot. so use 6.1.y kernel only for usb uses.
in my case, i installed the armbian into emmc, and using the mainline boot, then i can get any kernel version working,

Thanks! I tested 6.1. Screenshot_20230223_110337 Screenshot_20230223_110249 Screenshot_20230223_110149

It's still no success.

ps. 5.15. successfully started with dtb from X96-air-1000

i suspect because your not using mainline uboot, but eh i'm not sure

just a few hours ago, chewitt add new dts to support banana pi that has RTL8822CS, although it has different cpu, may be we can adopt the bluetooth part to the x96 max plus dts. currently i cant do it myself because i have many homework.
@ophub @drafort

chewitt/linux@dc15871

this is what i already adopted

chewitt/linux@bbf2bea

i've done the changes if you still concern here is the step i through

  1. i use dev 6.1.13 kernel, to get this run armbian-update -k 6.1.13 -v dev if you want you can try mainline boot, add -m yes in that command
  2. replace dtb meson-sm1-x96-max-plus.dtb with this compiled dtb https://github.com/salsabilng/amlogic-s9xxx-armbian/releases/download/kernel_5.15.95/5.15.95.tar.gz
  3. reboot and good luck

I've added new dtb called meson-sm1-x96-max-plus-2101.dts, this will enable the rtl8822cs bluetooth and the Wifi on 2101 box. The Wifi are stable and show no error. I have open PR on unifreq 6.1. hope it will accepted soon

unifreq/linux-6.1.y#13

commented

I left a message for him. You submitted this dts to 5.15 and the other three lts kernels

I'm sorry for the delay.
Thank you for help!
I'll make test today and will leave feedback

Result for me:
(kernel was updated without adding "-m yes", dtb was used as attached - for "max_plus" )
Screenshot_20230227_185119
As I see: no Bluetooth devices.

I left a message for him. You submitted this dts to 5.15 and the other three lts kernels

thanks! will do,

im able to reproduce your error, it turns out only boot from emmc works. so you need to install it to emmc

Hello!
Is it possible to inform then "meson-sm1-x96-max-plus-2101.dts" will be included in "iso" release?

commented

Can bluetooth and wireless work normally?

havent tried bluetooth for transfer any files, but it can pair and discover any device. for wireless, i have decrease the max frequency, little slow but stable for couple days now

recall that i use 6.1.y kernel,

commented

You submitted this dts to 5.4/5.10/5.15 kernels

done. waiting for approval. thanks!

As I understand it, Bluetooth will work only when system installed on EMMC. To install on EMMC, you must specify the type of device from "armbian-install" menu. Now 2101 is not specified in device list.
Now I tested to run 6.1 (ophub) form usb with 2101.dtb from salsabilng. In rfkill hci0 is listed, but in "hcitool dev" - no devices.

armbian-install , select x96-max-plus. then copy 2101 dtb to /boot/dtb/amlogic . edit uEnv.txt change line to FDT=/dtb/amlogic/meson-sm1-x96-max-plus-2101.dtb

i have question @ophub, whats the difference between usb and mmc boot process, why the bluetooth only works in mmc?

commented

The u-boot boot sequence is different.
Generally, the situation encountered is the opposite of yours. It is normal to start and use it on the usb, but it cannot be used when writing to emmc. You have filled in the blank again.

Don't forget to submit your dts to the internal kernel library. Because other kernels don't have it, you can't add this option to the default installation list. Otherwise, other kernels can't use it because they don't have a dtb.

Thank you!
However, is it possible to make Bluetooth work when booting from usb in the near future? Because now I need to have two systems: Android on emmc and armbian on usb.