[How To] Install run Manjaro ARM on Amlogic TV Boxes with S922X - S905X3 SOC

I have now replaced the ffmpeg included with manjaro with ffmpeg -m2m and then I had to rebuild mpv which I did by using the Arch PKGBUILD but unfortunately hw video decoding doesn’t work:

$ mpv --hwdec=auto --hwdec-codecs=all VID_20210511_140223.mp4
 (+) Video --vid=1 (*) (h264 3840x2160 30.009fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
Cannot load libcuda.so.1
[vaapi] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Failed to open VDPAU backend libvdpau_meson.so: cannot open shared object file: No such file or directory
AO: [pulse] 48000Hz stereo 2ch float
[ffmpeg/video] h264_v4l2m2m: capture VIDIOC_REQBUFS failed: Cannot allocate memory
[ffmpeg/video] h264_v4l2m2m: can't request capture buffers
Error while decoding frame (hardware decoding)!
[ffmpeg/video] h264_v4l2m2m: capture VIDIOC_REQBUFS failed: Cannot allocate memory
[ffmpeg/video] h264_v4l2m2m: can't request capture buffers
Error while decoding frame (hardware decoding)!
[ffmpeg/video] h264_v4l2m2m: capture VIDIOC_REQBUFS failed: Cannot allocate memory
[ffmpeg/video] h264_v4l2m2m: can't request capture buffers
Error while decoding frame (hardware decoding)!
[ffmpeg/video] h264_v4l2m2m: VIDIOC_STREAMON capture error: -22
VO: [gpu] 3840x2160 yuv420p
AV: 00:00:00 / 00:00:30 (1%) A-V:  0.443 Dropped: 5

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:11 / 00:00:30 (39%) A-V:  0.000 Dropped: 204

Exiting... (Quit)

I don’t think there is any support for audio jack for such tv boxes.
Check if you can find it in the dts file.

For Wi-Fi you need to check which chip is used and check in the forum if anyone else have exact same box

This is broken with the new chainloader. So don’t try this.

Ah thank you for informing. Ive forgotten it.

1 Like

Hi spikerguy

As I said, my audio jack works under Android and linux-meson kernel page says the kernel supports the S905X3 audio subsystem (not HDMI audio) so we shall see what happens if I can re-install the stock Android and extract the dtb.

It sounds like the new chainloader is a downgrade if the older version could boot from eMMC but its replacement can’t. What advantages does the new chainloader bring? Is it not u-boot that does this?

I’m going to report the mpv decoding prob after trying it with the latest git version to see if we can get some feedback or help from the mpv devs.

Thanks for updating the instructions!

1 Like

I have wifi working under Manjaro on my T95 Max plus!

When I say working, I can connect to my wireless network but its slooooow despite network manager saying I have a 75+% strength signal. I’ve not tried removing the case or attaching an external antenna yet which could well improve it. I’m not too bothered as I mainly use ethernet anyway.

Manjaro runs muuuuch better on this box than the Android it comes pre-installed with, which is pretty horrible and gave me a bad first impression of the hardware.

I’m still using the same meson-sm1-sei610.dtb but I have copied the wifi firmware config txt file from the Android partion, after I restored the stock firmware using aml-flash-tool under Ubuntu.

To fix wifi, I installed the Linux terminal emulator app under Android, opened it and ran:

dmesg | grep txt

Which showed me the path to the nvram.txt file. I copied this file onto an external disk by copying the file to /sdcard . Running the same dmesg | grep txt command under Manjaro told me where it was expecting the config file:

sudo cp nvram.txt /lib/firmware/brcm/brcmfmac4330-sdio.txt

I haven’t got the analogue audio output working yet and X is a bit flickerly but I think this is running well enough to add to the supported devices list. Next I’ll be upgrading mesa to the git version to see if I can improve X. I am running it at 4K so its got its work cut out.

Coreelec create an image for the T95 Max plus and they say it uses sm1_s905x3_4g.dtb. I have tried booting using the coreelec dtb but it didn’t boot. I expect it has to be for the exact same version kernel to get away with that. Could you include sm1_s905x3_4g in the next kernel build spikerman, or is it someone else who packages the vim3 kernels?

Thanks!

You are using a wifi configuration for other Linux firmware so behaves slowly. Your chipset is well supported in linux. I think you must know your exact chipset with dmesg in Android and then install a good driver.

Your lucky the chip is activated and with a little more work you will get there.

1 Like

I have X96Max+ 4GB/32GB. I have tested Manjaro-ARM-kde-plasma-vim3-21.04.img with meson-sm1-sei610.dtb with a 16GB micro sd card.

Working
Most of the things work, it has opengl 3.1 and opengl es 3.1.
Sound through HDMI and WiFi works out of the box.
Shutdown

Almost working
Firefox doesn’t have gpu accelaration.
Chromium has gpu accelaration if you forced enable it with a chromium.conf file.
Web browsing ia as slow as the android tv 9 version.

Doesn’t work
V4L2 m2m hardware video decoding doesn’t work.
vainfo failed to initialize libva-v4l2-request.
v4l2-ctl -a shows hardware accelaration only for vp9.
Bluetooth doesn’t work.
Access to embeded emmc doesn’t work, it has unknown filesystem type.
Vulkan
Front screen, which shows the time.

Unknown
I haven’t test the ethernet.
IR

1 Like

Seems to work on GT King Pro but not sure how to actually confirm. CPU usage is reasonably low for most of the CPU cores.

[jfl@MNJROGTKPro ~]$ mpv --hwdec=v4l2m2m-copy https://www.youtube.com/watch?v=CwzjlmBLfrQ
 (+) Video --vid=1 (*) (h264 1920x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
Using hardware decoding (v4l2m2m-copy).
VO: [gpu] 1920x1080 nv12
AV: 00:05:36 / 00:05:36 (100%) A-V:  0.000 Dropped: 2 Cache: 0.0s

This how to is great, I am using x96-max dtb, my device is hiplay 8K HD, my problems are :

  1. the default resolution is 4K so it’s not working with my desktop LCD which only 1K
  2. the manjaro could not detect the WiFI device while the original Android can detect it

any help with those problems ?

Add to extlinux.conf video=HDMI-A-1:1280x720@60 in the APPEND line. You can also use the analog video to boot and modify your LCD from there.

Your wifi device maybe supported in the old linux android kernel but not in 5.X kernel, who knows? You have first to know which is your chipset with a web search.

These tasks are not easy. I dont have wifi support for my box, and this is normal because many hardware manufacturers dont care about linux. I use a cheap usb wifi adapter with a free comunnity driver .

Thanks for sharing. Works well on my X96Max+ too except Wifi dosn’t work and that with the meson-sm1-sei610.dtb ethernet wans’t working neither (but works fine with the meson-sm1-x96maxplus-vim1000m.dtb). For information (if others have the same problem) my network chiset is RTL8211F for Ethernet and RTL8822BS for Wifi and BT. I’ve to figure-out why Wifi is not working.

You have driver for RTL8822BS, try installing.

Thanks. I don’t know if you are refferring to this one (GitHub - ChalesYu/rtl8822bs-aml: unoffical driver for linux). I’ tried to compile but I didn’t succeed (I’m a bit a newbie :wink: If you have any pointer on how to install or compile the driver I would really appreciate. I’m also wandering if it’s not a problem with the dtb.

Try this sudo pacman -S dkms-rtl8822cs.
I managed to get wifi working on my X96Max+ for earlier kernel, but not for latest/

==> Unable to install module rtl8822cs/2020.11.20 for kernel 5.14.10-1-MANJARO-ARM: Missing kernel modules tree.

look here https://forum.manjaro.org/t/manjaro-arm-on-amlogic-tv-box/34662/648?u=loop223

Did you install the kernel header files of 5.14.10-1 kernel?

I tried several times. I had an error with the dkms command (likely due to the GRO_DROP/GRO_MERGED_FREE issue). But managed to run the original make procedure provided by @TheMojoMan Manjaro arm on Amlogic Tv box? - #658 by TheMojoMan. I see the module running with lsmod. But the Wifi is not working. I wonder if is not due to a difference in chipset (mine is RTL8822BS and the driver is for 8822CS). I’ll try again with a re-install from scratch …

For testing purposes I have upgraded from linux-aml-5.13.rc5-1 to linux-vim-5.14.10-1. So I downloaded linux-vim und linux-vim-header files and installed them using

sudo pacman -U linux-vim-5.14.10-1-aarch64.pkg.tar.zst linux-vim-headers-5.14.10-1-aarch64.pkg.tar.zst

The rtl8822cs dkms driver then built successfully and after reboot wifi is still working with the 5.14 kernel!

However, I get a new strange error which currently renders the new system unusable for me:

My mouse cursor is invisible/not drawn anymore. Or to be more precise, after XFCE desktop is loaded it works normal for some seconds but then when the panel is fully drawn the mouse pointer is only drawn at its last position. When I e.g. move my mouse to the bottom right I can still left click and get the reboot options or if I move it the the bottom right I can click and the Manjaro menu opens. So the mouse is still functioning but the pointer is not drawn/updated.

I still need to search if this is a known error and if there is already a solution to it. Maybe I just have to fully switch to unstable branch so that the other packages are updated as well (only wanted to test if wifi still works with 5.14 so I did not switch branches and also did not do a full upgrade).

I guess you pinpointed the problem. Try to find the BS version of the driver and compile it.

As mentioned, I tried a last time to re-install all from scratch and apply the dkms. I did the following:

  • burned on SD the version Manjaro-ARM-xfce-vim3-21.03.img (it’s one of the very few that works on my box) with meson-sm1-x96maxplus-vim100m.dtb
  • Then sudo pacman -Syyu linux-vim
  • Then sudo pacman -S base-devel git bc dkms linux-vim-headers

When I do uname -a I get → Linux X96 5.11.4-11MANJARO-ARM
However, when I try to install the headers : sudo pacman -S linux-vim-headers
the system propose to install the version linux-vim-headers-5.14.10-1
And the difference of headers versions leads to a fail of the driver install (dkms-rtl8822cs).
Do you know why the system desn’t pick-up the right header version ? Thanks for any advice.

What is the result of this command ?

The only driver I could find is this one : GitHub - ChalesYu/rtl8822bs-aml: unoffical driver for linux
I tried to run the make but it didn’t work. I’m a newbie … I’ve to investigate a bit further how to build a driver (simply running the make doesn’t seem to work :wink: