Manjaro arm on Amlogic Tv box?

Hello

is there a chance to run manjaro arm server / desktop on tv box mxq pro 4k amilogic s905x?

or how does the process of building such a system look like?

Probably not.

I don’t believe it is likely that there will be enough free time from the Manjaro developers to get this system and make the required adjustments needed to create a setup for it.

If I were you, I would check the Gentoo forums or Libreelec first to find out more about the process, uboot and other required changes needed to run Linux on it. If those are in place, you could compare the setup to other amlogic boards supported by Manjaro ARM on their GitLab repo and maybe make your own :smile: : devices ¡ master ¡ manjaro-arm / applications / arm-profiles ¡ GitLab

I think one has to distinguish between “random-cheap-tv-box-with-varying-specs-despite-same-model-name-and-manufacturer” and “solid, well documented, box from reputable manufacturer”. (The demands from people having boxes in the first category is what seems to have put a large stress on the developers in a related Linux/SBC community recently.) For (select) boxes in the second category I think it is definitely doable, but it should then be done as a “community effort” with as little pressure as possible on the developers/maintainers.

As an example, I have Manjaro ARM xfce 20.10 happily running on my Ugoos Am6 plus (s922x-j) with everything working (including WiFi) using only some small “hacks and a little massage here and there”. (If there is popular demand I can post the steps I took.) I think there are similar boxes (Beelink GT king) that are from “good” manufacturers and have support in the mainline kernel (and in related communities, e.g. LibreElec) and are sufficiently similar to Manjaro ARM supported boxes, like the Vim3. Such boxes could easily be supported via a community effort, I think.

2 Likes

I’m running right now manjaro on A95x F2. Just you have to know a dtb file that works with your TV box, and if can boot and how.

thank you all for your answer

I understand that creating an official os for all Chinese tv boxes doesn’t make much sense and most of these projects are comunity driver.

But :slight_smile:

I took a closer look at the manjaro for vim1 and it has a very similar hardware to my tvbox so I tried it and it works: D

The trick is that earlier I found an armbian os that worked on my tv box and i tried to install it on internal memory using a script that was in .img but I was able to install only boot partition so without sd card it throws errors :slight_smile:
armbian os: forum.armbian-com/topic/12162-single-armbian-image-for-rk-aml-aw-aarch64-armv8/

But after inserting the sd card it probable boot from internal boot partition and next load majaro os from sd :slight_smile: probable because it us the same extlinux.conf file

when i tried use tooth pick method with manjaro to boot directly from SD i get android revovery menu.

in vim1 image there is a folder with .dtb files just like in armbian and there is a file that works for me in both cases ‘meson-gxl-s905x-p212.dtb’

so I have a .dtb
can i reuse uboot from arbian or need i compile new
like in this howto: wiki.loverpi-com/faq:sbc:libre-aml-s805x-howto-compile-u-boot ?

1 Like

I don’t know if the @manjaro-arm would support this.

1 Like

It seems the Vim1 image works for the user in question. So in a way we do. :slight_smile:

1 Like

You can reuse armbian dtb but it is not sure that everything will work.

If this is working then you don’t need to use armbian image or build uboot.
Just change the name of dtb in UEnv and it should boot fine.

Let me know if you need any help.

I do have a plan to add support to those devices I can get my hands on. But there are wayy too many device to support.

I think that anyone here that have Manjaro ARM running in specific boxes, should post a tutorial on how to do it In the ARM section, we can even create a category for it, that could help others with similar models and also help ARM devs in the future with similar hardware.

2 Likes

Well I did a franken-mix, however (since plugged into UPS) uptime 239d
With armbian, could not get reliable boot, except with “tricks”
An oddball (and this is common) rk3328 H96max+, serial would show SD die after kernel load
The dtb was wrong, loss of power to SD socket
I edited/hacked about 20 dtb, with only partial success, thanks hexdump, yr dtb did it
So I installed manjaro on SD, replaced kernel, modules,dtb with armbian (4.4.186)
checked boot scr, deleted extlinux
My mirrorlist is not quite right, but it works, but everything rather slow overall
Last point, quite important, get serial so you can tell just what is happening
I have had to logout about 5 times and replug wifi dongle maybe dozen times

This is well supported i think you’re using wrong uboot rk3328 have 2 variant one evb and other without evb.

I am not so familiar with rk3328 except for 2 boards that I have which u use for testing router builds.

Idk why you need to use 4.4 when it can work on later kernel.

I cannot say much about this device as every arm device is unique in its own way depending on how the manufacturer and connection the IO to its cpu map.

To support arm device we need its kernel support by a kernel developer first then we can add its support to the distro.

Do write a tutorial if you can get it to work smoothly.

Good luck.

At that time, about a year ago, I tried every dtb in the directory (for 3328),
all the while watching the serial messages. As soon as the dtb was loaded by the kernel, the SD disappeared. Maybe it is better now
This box only has 2 usb sockets, 1 is usb2, 1 is usb3,
if the root fs was mirrored to usb, it would boot from that
AND, it is fairly “fussy” about usb3 hubs, most lock up within a week
Even the one I have in now locks every month or so, not so good for fs

Micro-tutorial on how to boot/run Manjaro ARM on Ugoos Am6 Plus (s922x-j):

I have tried these steps using the image for Khadas VIM3, release 20.06 (xfce and kde) :

(1) On your PC, burn Manjaro image to SD card and edit /boot/uEnv.ini so that the FDT variable refers to the dtb file meson-g12b-ugoos-am6.dtb
(2) On the Manjaro image, also copy u-boot.sd to u-boot.ext.
(3) Boot your Ugoos from the SD card. The Ugoos has multiboot enabled by default so this should work. (Possibly you have to “activate” multiboot with the “toothpick method”. I don’t remember exactly.)
(4) After the initial configurations in the Manjaro install, you should have a running system with graphical desktop (with Bluetooth), but without WiFi and possibly without ethernet and sound. To fix these things, see below. Note: There is some form of initialization issue with the Ugoos so that reboots have to be done as cold boots (turn off power/pull plug, wait until the light goes out, and then wait some more (the light flickers once more), then restart).

Sound: If sound doesn’t work, run (as root, I guess) the script /usr/bin/g12_sound.sh You might have to reboot and you should then have some “Analog” sound source in pulseaudio (which should also route through hdmi). (See what you have with aplay -L)

Ethenernet: I have only been able to get reliable ethernet with the speed set (e.g. via Network Manager) to 100Mbit/s. (You have to configure this manually, since with the default autonegation you will probably end up with 1GBit/s, which is not reliable, at least for me. Apparently, the meson dwmac driver/glue-code (for ethernet) has been problematic and is probably not quite finished in mainline.)

WiFi: To enable the built in WiFi (the chip is brcm 4359 in a AP6398S package, shared with the Bluetooth) you need to hack the dtb (preferrably natively, on the Ugoos): Decompile (with dtc) the dtb to dts and locate the section sd@ffe03000 { …}. Edit the line
max-frequency = < 0x5f5e100 >;
to read
max-frequency = < 0x2b594d1>;
(i.e lower the clock from 100MHz to 45.454545MHz). Compile the edited dts file to dtb and install in /boot/dtbs/amlogic and update uEnv.ini accordingly (if you use a new name for the new dtb). You also need to copy (or link) /lib/firmware/brcm/nvram_ap6398s.txt to /lib/firmware/brcm/brcmfmac4359sdio.ugoos,am6.txt
The reason for the clock hack seems (since it runs at almost 200MHz on Android) to be related to a speed cap in the current mainline mmc driver: The WiFi module communicates over the SDIO bus and appears there as an mmc device; see /sys/kernel/debug/mmc0/ios (The weird clock frequency 45.454545MHz (it was the highest I could get to work) seems to be due to Amlogic and their history.)

Manjaro/Khadas-image specific hacks:
The script /usr/bin/bluetooth-khadas.sh needs to be edited to reflect the Ugoos identifier for the 4359 chip (at least as it appears after the WiFi speed hack in dtb). The correct (chip) model string is now obtained from /sys/bus/mmc/devices/mmc0:0001/device
The Manjaro image probably lacks some firmware files for video (g12a_h264.bin, g12a_hevc_mmu.bin and g12a_vp9.bin).
The khadas systemd service (khadas-utils.service) can be disabled since it only relates to fans (the Ugoos is fanless).

Bonus points: The little system led can be polled/controlled with gpioget/gpioget from the package gpiod (until the leds get supported in the dtb):
gpioset gpiochip1 11=1 (gives red)
and
gpioset gpiochip1 11=0 (blue)
(I have not been able to get the nice strong white mode going.)

Thanks to @spikerguy an the Manjaro ARM community for the great work.

4 Likes

Hi Tripole,

I am interested in trying out Manjaro 20.10 on Beelink GT King Pro. Ugoos Am6 Plus on paper looks similar to Beelink GT King Pro. I don’t seems to be able to find the image in Manjaro Arm Download page for Ugoos Am6 Plus or Beelink GT King Pro. Appreciate if you would share how which image you download and how to get it to work on Ugoos Am6 Plus or suggestion how to get it to work on Beelink GT King Pro.

Thanks.

Sure, I forgot to mention that it was the VIM3 image that I used (it has a dtb for the Ugoos). (I will update the post above to reflect this). Thanks for pointing this out.
(There is currently no dtb for the Beelink GT Pro in the Manjaro ARM VIM3 image but it is in the mainline tree and other ARM distros have it. Edit: I thought it was included in Armbian for TV box, but I was mistaken.)

Edit2: From the dts in the kernel source tree it looks like the GT King Pro is very much like the Am6 (both are based on the w400 reference design with a small “diff”, see e.g. meson-g12b-gtking-pro.dts), mostly related to sound… Therefore, I guess you should be able to get your box up and running using the procedure for Ugoos above (with the Ugoos dtb).

1 Like

Hi Tripole,

Thanks for the detailed hacked to get Manjaro to work on Ugoos Am6 Plus. I am very new to Linux OS, thus I only able to do the first step that is burn VIM3 image and edit the uEnv.ini to reflec meson-g12b-gtking-pro.dtb. Boot it and have a green screen boot up. When I try to do apt update and apt upgrade I ran into kernel panic or GT King Pro freezes.

On you 2) command copy u-boot.sd to u-boot.ext, do you mean rename u-boot.sd to u-boot.ext? Does be step 2 will fix the green screen boot up?

Yes, the green screen issue is fixed by copying (or renaming; I think both works) u-boot.sd to u-boot.ext
As for the apt; I think you should use the Arch/Manjaro package manager pacman (Arch Linux has a very extensive wiki page on the subject).

1 Like

Hi Tripole,

As I am new to Linux I have no clue how to hack the dtb to modify it so that wifi works. Most likely your Ugoos Am6 Plus image will work on Beelink GT King Pro. I have tried Armbian Image before using Ugoos Am6 dtb and it boot up on GT King Pro. The issue with the mainline Armbian image on Beelink GT King Pro is Kernel Panic and freezes randomly and also seems to corrupt the USB Stick or SD Card.

Possible to share your Ugoos Arm6 Plus image that you built so that other Beelink GT King Pro users can try it? Thanks.

It is really simple to decompile/compile dtb/dts images using the device tree compiler (dtc). Install dtc (pacman is your friend) and then proceed like so (perhaps you have to be root):

Decompile a dtb into dts:
#dtc -I dtb -O dts -o myhackfile.dts myoriginalfile.dtb

Do edits and stuff on myhackfile.dts and then…

Compile a dts into dtb:
#dtc -I dts -O dtb -o myhackfilecompiled.dtb myhackfile.dts

There is lots of info about this on the interwebz.

Edit: I have not built an Ugoos image, I have used the VIM3 image from Manjaro Arm 20.06.
Edit2: Ok, so I see, we use the work “image” a bit carelessly here (also I), to refer both to the Manajro distro image and the dtb. Still, I encourage you to try to apply the dtb hack yourself; it is not difficult. :wink: