Manjaro arm on Amlogic Tv box?

Hi JFL

Wifi driver stopped working because of 5.11 kernel, but installing the new updated driver solved the problem.

Hi @spikerguy
I have two Manjaro-Arm-XFCE image one using linux-vim 5.11.4-1 and another linux 5.11.4. The linux-vim default to cpupower governor “Performance” and linux kernel to “schedutil” and force to “Performance”.

FYI, I noticed with linux-vim kernel off and on there is a bit of hesitancy but not with linux kernel. No sure is specific to my situation.

User avatar

spikerguy

Posts: 29

Joined: Thu Apr 30, 2020 12:35 am

languages_spoken: english

ODROIDs: HC4

Has thanked: 8 times

Been thanked: 15 times

Contact:

Contact spikerguy

Re: [OS] Manjaro ARM for HC4

Post by spikerguy Âť Tue Mar 16, 2021 5:05 am

Added Odroid OLED PKG in repo :D
Now Odroid HC4 have full support, Only thing left is VPU encoding which I have been trying using Chewitts ffmpeg source but no luck yet.

If anyone else have interest then we all can work on it together and try to get it to work.

These users thanked the author spikerguy for the post:

jgmdev (Tue Mar 16, 2021 9:53 am)

Manjaro ARM Team

Top
@spikerguy, Looking forward to have hardware video acceleration on Manjaro Amlogic Devices using ffmpeg

1 Like

@TheMojoMan I just found out the way to fix the Bluetooth issue on my H96 Max - RK3399 by converting the dtb to dts, then editing the bluetooth parameter in dts file info the correct driver name. I am pretty sure that this method can be transferred to fix the Bluetooth of X96 Max+.
Have a look here: Manjaro ARM for Rockchip TV Boxes - #55 by rna

However the only thing that I don’t know is the driver name of the wifi. Do you have any idea what is the correct driver name?

In that post I changed the parameter from:

		bluetooth {
			compatible = "brcm,bcm43438-bt";

Into this:

		bluetooth {
			compatible = "qcom,qca9377-bt";

and it fixes my bluetooth

I need those two driver name after compatible = …

As you said in the previous post, the bluetooth driver is already in the firmware. The only thing that is needed is fixing the dtb to use that correct driver. And it has to be those two name drivers. I have tried changing the last one, but it works partially. Once you have those two name, I am pretty sure that this might solve the bluetooth issue.

I’ve tried it few times still no success. Need to find what is missing.

I did already include the correct name a while ago in my latest .dtb that you can download but unfortunately it does not fix the problem. It seems the bluetooth adapter is not active and I do not know how to wake it up, yet. Always shows error -110. With kernel 5.10 even the firmware was loaded once in a while but bluetooth adapter was still not present.

For X96Max+ it must be:

compatible = “realtek,rtl8822cs-bt”.

See Linux v5.12-rc3 - Documentation/devicetree/bindings/net/realtek-bluetooth.yaml

Glad to hear that

I know this might be a silly question, but Have you tried all of this three combination? Or the other name for the first line? Because in my H96 Max - RK3399 case, the Wifi is QCA9377, but my wifi driver is taken from Ath10k (Atheros) from the firmware. Instead of using “atheros”, the bluetooth use “qcom”. Which is a Qualcomm, I was surprised myself.

EDIT:
I Just Found Out that Atheros is the product of Qualcomm. That makes sense.

@rna after the last kernel and firmware update the -110 error is gone. But I get a new “unknown IC info” error. With just ‘compatible = “realtek,rtl8822cs-bt”’ in the bluetooth section this is how far I get:

[themojoman@X96MaxPlus Develop]$ uname -a
Linux X96MaxPlus 5.11.4-1-MANJARO-ARM #1 SMP PREEMPT Wed Mar 10 16:56:03 +03 2021 aarch64 GNU/Linux
[themojoman@X96MaxPlus Develop]$ dmesg | grep Blue
[ 11.272263] Bluetooth: Core ver 2.22
[ 11.279072] Bluetooth: HCI device and connection manager initialized
[ 11.284262] Bluetooth: HCI socket layer initialized
[ 11.289121] Bluetooth: L2CAP socket layer initialized
[ 11.289160] Bluetooth: SCO socket layer initialized
[ 11.536997] Bluetooth: HCI UART driver ver 2.3
[ 11.540113] Bluetooth: HCI UART protocol H4 registered
[ 11.543988] Bluetooth: HCI UART protocol BCSP registered
[ 11.549573] Bluetooth: HCI UART protocol LL registered
[ 11.554350] Bluetooth: HCI UART protocol ATH3K registered
[ 11.559877] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 11.566229] Bluetooth: HCI UART protocol Intel registered
[ 11.571644] Bluetooth: HCI UART protocol Broadcom registered
[ 11.576966] Bluetooth: HCI UART protocol QCA registered
[ 11.582028] Bluetooth: HCI UART protocol AG6XX registered
[ 11.587499] Bluetooth: HCI UART protocol Marvell registered
[ 12.302377] Bluetooth: : Non-link packet received in non-active state
[ 12.311446] Bluetooth: hci0: Out-of-order packet arrived (1 != 0)
[ 12.711910] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c lmp_ver=08 lmp_subver=8822
[ 12.717369] Bluetooth: hci0: RTL: unknown IC info, lmp subver 8822, hci rev 000c, hci ver 0008
[ 12.725842] Bluetooth: hci0: RTL: no config loaded

As soon as I add “device-wake-gpios = …”, “enable-gpios = …” and/or “host-wake-gpios = …” (where I still do not know some of the needed numbers) the last five lines of the above message are missing which I interpret that rtl driver is not loaded at all.
(BTW, as written before, with 5.10 kernel I sporadically even got the message that firmware for rtl8822cs-bt was loaded but then there was always error -110).

The big problem is that there are so many possible sources for bluetooth not to function (e.g. device tree, firmware, hci driver, rtl driver) …

Yes, I did, although I know that Realtek 8822CS chip is used in my box.

have you installed the Bluetooth Manager?

Haven’t tried the latest unstable kernel again, last time I switched back to stable release, because panfrost is very stable in the stable release.

I’ll try it myself once I got enough free time.

Many Thanks for the info & update. :slight_smile:

@rna I have patched and recompiled btrtl module (because I found a mismatch of hci_ver in the source file and that of my bluetooth chip) and now firmware is loading. But now download fw command failed (-110) error has returned …

Anyway, I think I have solved another small piece of the puzzle.

[themojoman@X96MaxPlus Develop]$ dmesg | grep Blue
[   10.064212] Bluetooth: Core ver 2.22
...
[   11.042864] Bluetooth: : Non-link packet received in non-active state
[   11.053824] Bluetooth: hci0: Out-of-order packet arrived (1 != 0)
[   11.453714] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c lmp_ver=08 lmp_subver=8822
[   11.457421] Bluetooth: hci0: RTL: rom_version status=0 version=3
[   11.457438] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_fw.bin
[   11.476422] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_config.bin
[   11.517450] Bluetooth: hci0: RTL: cfg_sz 33, total sz 35445
[   13.597360] Bluetooth: hci0: command 0xfc20 tx timeout
[   21.597379] Bluetooth: hci0: RTL: download fw command failed (-110)

Yes, I have “Blueman Applet” in my autostart list but it does not show anything in the panel as long as no bluetooth adapters are found

[themojoman@X96MaxPlus Develop]$ blueman-adapters 
blueman-adapters version 2.1.4 starting
blueman-adapters 15.08.53 ERROR    Adapter:53 __init__  : No adapter(s) found

what is the result of:

rfkill list

lsmod | grep -i blue

lsmod

and then, can you access bluetoothctl?

I found this post for our wifi bluetooth model on Pine64 on Armbian, maybe this can help:

Maybe we can borrow the recipe.

Since the bluetooth adapter is not present rfkill list only shows eth device and bluetoothctl list obviously does not show anything.

I know this post and have already included most of the recipe in the .dtb but the main problem are unknown values for

device-wake-gpios = <…,>;
enable-gpios = <…>;
host-wake-gpios = <…>;

to properly initialize the chip.
I have extracted some of it from the android .dtb but too much unknown stuff left. I also did some brute force tests but with no luck. :frowning_face:

Actually, I more or less gave up on it some weeks ago and now tried it again but I think it is not really worth investing too much time into into again. For me it would be nice to have working bluetooth but it is not essential.

Hi,

can these snippets help ?

bt-dev {
	compatible = "amlogic, bt-dev";
	dev_name = "bt-dev";
	status = "okay";
	gpio_reset = <0x17 0x53 0x00>;
	gpio_hostwake = <0x17 0x55 0x00>;
};

unifykey {
		key_4 {
			key-name = "mac_bt";
			key-device = "normal";
			key-permit = "read\0write\0del";
			key-type = "mac";
			phandle = <0x78>;
		};
    };

efusekey {
	key_1 {
		keyname = "mac_bt";
		offset = <0x06>;
		size = <0x06>;
		phandle = <0x85>;
	};
};

I found them on the dtb I extracted from my device (I don’t know if it’s the same you have)

The above is the piece from the Android/EmuElec .dtb.

I have translated this to

host-wake-gpios = <0x31 0x01 0x55 0x00>;
enable-gpios = <0x31 0x01 0x53 0x00>;

for the linux .dtb. Here, 0x31 points to the gpio-controller and 0x00 at the fourth position stands for GPIO_ACTIVE_HIGH. The 0x01 at second position is unknown but Pine64 H64 model B .dtb uses 0x01 there.

Values for device-wake-gpios = <...>; are completely missing. I have tested device-wake-gpios = <0x31 0x01 0x54 0x00>; and many more values at third position. I have also tested with 0x00 at second position and 0x01 at fourth position. And I also permutated the 0x53 and 0x55 to second position and between host-wake-gpios, enable-gpios and device-wake-gpios which all was not working. Unfortunately, there are thousands of combinations left …

If you want to join in: I have uploaded the .dtb/.dts and patch for btrtl driver (source and makefile as well as btrtl.ko.gz for kernel 5.11.4) to my Mega.nz folder here. btrtl.ko.gz has to be copied to /lib/firmware/rtl_bt/ followed by a reboot. If everything goes well you should be able to get the output

$ dmesg | grep Blue
...
[   11.453714] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c lmp_ver=08 lmp_subver=8822
[   11.457421] Bluetooth: hci0: RTL: rom_version status=0 version=3
[   11.457438] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_fw.bin
[   11.476422] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_config.bin
[   11.517450] Bluetooth: hci0: RTL: cfg_sz 33, total sz 35445
[   13.597360] Bluetooth: hci0: command 0xfc20 tx timeout
[   21.597379] Bluetooth: hci0: RTL: download fw command failed (-110)

after powering the box on. You will not get this after a soft reboot. So, the bluetooth chip seems to be on after a cold start.
If this works you can start to uncomment device-wake-gpios = <...>; and fiddle around with the values. With the wrong values firmware will not load and you will not get the above message.
My expectation is that the message will return and maybe even the error will vanish if you choose the right values.
BTW, values for host-wake-gpios and enable-gpios seem to be not so critical for the firmware load message to show up.

P.S.: I also tried changing values of device-wake-gpios while lines for host-wake-gpios and enable-gpios are commented out (which should be a cleaner strategy for testing).

P.P.S.: I just did another couple of tests with device-wake-gpios = ... alone (i.e. host-wake-gpios and enable-gpios commented) and the firmware load message was shown for several different numbers at third position in device-wake-gpios. But when I additionally uncommented host-wake-gpios and enable-gpios the message was not shown anymore.
Result: You cannot test parameters independently which makes it much more difficult (or maybe even impossible). You know why I gave up on it?

1 Like

Manjaro Arm for tv boxes both Rk and Aml thread have become huge.

Maybe users can split up and create new device specific threads for other users to make use of the information shared in the thread.

Lets make new thread with single objective on a single device/Soc.

Sound good ?

4 Likes

@spikerguy Just updated to the latest Stable-2021-03-20 updates. XFCE-linux-vim-5.11.4-1. Reboot.

FYI, ran glmark2-es2 --fullscreen and had a system freeze or kernel panic at ([desktop] blur-radius=5:effect=blur).

Power recycle, booted ok and re-run glmark2-es2 --fullscreen, all went well, no system freeze.

1 Like

Hi TheMojoMan.

I’m new to this so I would appreciate your assistance. I have Manjoro running on a Beelink GT King. No WiFi of course so reading this thread, I see that you added the dkms-rtl8822cs on github… The problem I have is that I don’t know how to install it… I also realize that some dependencies need to be installed. Can you take this one from the top with an instruction set please?

I appreciate anything you can do to assist.
Thanks.
TIm.

Hi TC2021,

I am running Manjaro on GT King Pro using the default meson-g12b-gtking-pro.dtb and ethernet, wifi and sound all available. Are you using the meson-g12b-gtking.dtb from Manjaro image itself? Is your GT King a newer model with wifi 6?

Is it a concern that every time after a shutdown or reboot and whenever CLI
[jfl@MNJROGTKPro ~]$ sudo fsck /dev/mmcblk1p1

[sudo] password for jfl: 
fsck from util-linux 2.36.2
fsck.fat 4.2 (2021-01-31)
Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
[12?q]? 1
*** Filesystem was changed ***
The changes have not yet been written, you can still choose to leave the
filesystem unmodified:
1) Write changes
2) Leave filesystem unchanged
[12?q]? 1
/dev/mmcblk1p1: 211 files, 17186/54628 clusters
[jfl@MNJROGTKPro ~]$ 
    indent preformatted text by 4 spaces

It always return " Dirty bit is set. Fs was not properly unmounted and some data may be corrupt." be when the Manjaro shutdown properly (i.e. device LED shut/turn off) or when device does not seems to shutdown properly with device LED still ON but No signal to computer monitor/display.

Even if I “Remove dirty bit” and reboot cleanly, “sudo fsck /dev/mmcblk1p1” the warning " Dirty bit is set. Fs was not properly unmounted and some data may be corrupt" is still there.