AndroidHardware

Armbian for beginners of Amlogic TV Box – focus on X96 MAX+ S905X3

This guide is for beginners,
so don’t be surprised to find explanations to simple terms or commands.

X96 MAX + (Plus) Amlogic S905X3
How determine the hardware version

In all X96 Max + (Plus) on the factory Android firmware you should look at the system information in the settings (System / About info / Build number), it will be displayed the version:
Plus, Plus2, Plus_100, (my box is Plus 2101W) etc.
However the reseller can fake this information and the stickers outside and inside.
Using Device Info HW or AIDA64 you can determine if there is a 1000Mb LAN and which radio module in installed inside (turning on WiFi).
If the device was flashed with the firmware of another version of set-top box, then the information may be missing or unreliable:
you need to open the box and check the presence of the LAN 1000 chip and the radio module soldered on PCB.
The radio module can be identified by the marking on the chip or by the sticker on the board.

For accurate Info and images of the hardware check:
https://4pda.to/forum/index.php?showtopic=1013103&st=40
X96 Max +
is an early versions of set-top boxes, until the end of 2020 in config 2/16. without BT and with wifi 2.4 Ghz only.
X96 Max +2
early versions until autumn 2020 in config 4GB ram and 32-64GB rom, with BT and wifi 2.4+5Ghz 2*2MIMO.
X96 Max + with these Versions: 100, Q1, Q2, M, T, A2, A100, 5, 2101, 2101W etc
all set-top boxes from the end of 2020. Here there can be any type of hardware inside.
Today the abbreviation “+2” does not mean anything.


Donwload and prepare the Armbian system to Flash

Source: https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/documents
Download Armbian Aml (AMLogic) jammy (ubuntu based) or bullseye (debian based) for your device.
Download from here -> https://github.com/ophub/amlogic-s9xxx-armbian/releases
example: for S905X3 -> Armbian_23.02.0_amlogic_s905x3_bullseye_5.15.98_server_2023.03.06.img.gz
not S905x3-b (it is another variant of SoC); 5.15.98 is the kernel.
At the moment on my Model X96 Max Plus 2101w the kernel 6.1.15 won’t boot after installation on eMMC.

Flash Armbian.img with balenaetcher (videotutorial)
Before install Armbian putting the SDcard in the TVbox, disconnect and reconnect that SDcard to PC.
Using the Armbian release above, is not necessary to copy any hk1box-bootloader.img in the root folder of the ROOTFS partition.
The ROOTFS partition of the SDcard has a not visible file-system for Microsoft Windows without 3th party software (it is visible in Linux).

The BOOT partition is visible in Windows with a letter as a disk, example X:\
(>BOOT partition on Github<)

If you download Armbian with kernel 5.4.y or 5.15.y you can skip the Phase 1.
Phase 1
Enter in the root of the BOOT partition and rename the file u-boot.ext (if exists) in u-boot.ext.old (for backup)
make a copy of u-boot-x96maxplus.bin and rename it in u-boot.ext ( it is needed when booting from SDcad or USB as for the first boot).
Not necessary: you should rename a copy of u-boot-x96maxplus.bin in u-boot.emmc if using eMMC,
but this copy operation will be done automatically by scripts such as install/update
(the installation of Armbian from SDcard to eMMC that you can read below).
There is no need to add u-boot.emmc in the Armbian with kernels 5.4.y and 5.15.y,
but you can try to manually copy and add when you encounter problems such as incomplete memory recognition.

Phase 2
Choose the correct .DTB file for your TVbox version (listed below) that you can find in the X:\dtb\amlogic\ folder.
Example: for X96 Max Plus 2101 choose meson-sm1-x96-max-plus-2101.dtb

so insert the “filename.dtb” in the file in X:\uEnv.txt
change line to FDT=/dtb/amlogic/meson-sm1-x96-max-plus-2101.dtb

The file will be:
LINUX=/zImage
INITRD=/uInitrd
FDT=/dtb/amlogic/meson-sm1-x96-max-plus-2101.dtb
APPEND=root=UUID=7cc2d644-bb23-4ab5-8e26-16a263ccd262 rootflags=data=writeback rw rootfstype=ext4 console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

mfs -u


# Deprecated old procedure editing extlinux\extlinux.conf
Skip this procedure…
The file in X:\extlinux\extlinux.conf will be:
label Armbian
kernel /zImage
initrd /uInitrd
fdt /dtb/amlogic/meson-sm1-x96-max-plus.dtb
append root=UUID=70e0c3c3-49d9-47d0-9719-97897708f5c2 rootflags=data=writeback rw rootfstype=ext4 console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 loglevel=1 voutmode=hdmi disablehpd=false overscan=100 sdrmode=auto

If you find
root=UUID=70e0c3c3-49d9-47d0-9719-97897708f5c2
and further on have issues,
change it in
append root=LABEL=ROOTFS
At the end of the modifications in extlinux.conf
sudo update-initramfs -u

DTS files of Armbian

This DTS version written in uEnv.txt will be used by Armbian booted from sdcard,
but when later you will install Armbian on eMMC with the command sudo armbian-install
it will prompt to choose manually the variant to use in the eMMC installation: model 501, 502 etc…
https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-files/platform-files/amlogic/bootfs/dtb/amlogic
https://github.com/unifreq/linux-5.15.y/tree/main/arch/arm64/boot/dts/amlogic
https://github.com/unifreq/linux-6.1.y/tree/main/arch/arm/boot/dts

Model Database

> Amlogic_model_database.md <> Detailed Database <
Example (the list can be updated):
501 is for theX96-Max+_100Mb (Lan 100 Megabit/s) s905x3 and use meson-sm1-x96-max-plus-100m.dtb
502 is for the X96-Max+_1GB s905x3 (LAN 1 Gigabit/s) use meson-sm1-x96-max-plus.dtb
524: X96-Max+_2101 s905x3 use meson-sm1-x96-max-plus-2101.dtb

If a .DTS file for your devices (your model of TVBox) is not listed when later type sudo armbian-install,
insert your .DTS file in BOOT partition in /dtb/amlogic/
and edit the file /etc/amlogic_model_database.conf in ROOTFS partition, adding, for example:
5011: X96 Max+MYMODELT:s905x3:meson-sm1-x96-max-plus-MYMODEL.dtb:u-boot-x96maxplus.bin:/usr/lib/u-boot/x96maxplus-u-boot.bin.sd.bin:/usr/lib/u-boot/hk1box-bootloader.img

Database of Amlogic models and Other Socs (Allwinner, Rockchip)
List of supported devices

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/amlogic_model_database.md
https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/armbian-files/common-files/etc/model_database.conf

X96 Max+ (Plus) hardware variants

Source: https://4pda.to/forum/index.php?s=&showtopic=1013103&view=findpost&p=102780026
meson-sm1-x96-max-plus.dtb (2100Mhz) (LAN max-speed = <1000>) 1000 Megabit/s
meson-sm1-x96-max-plus-oc.dtb (OC= OverClocked to 2208Mhz – opp-microvolt = <1021000)
meson-sm1-x96-max-plus-100m.dts (LAN max-speed = <100>)

X96 Max Plus
LAN 100Mb, No 1000Mb Ethernet chip, No Bluetooth, RTL8189FS radio module, one antenna for 2.4Ghz Wi-Fi, no 5Ghz antenna.

X96 Max Plus2
LAN 1Gb RTL8211F, RTL8822CS radio module, two antennas
You can make sure by connecting to a device that supports 1Gb or using Device Info HW, or check inside the presence of a chip on the board.

X96 Max Plus2
RTL8822BS
radio module (Fn-Link 6222B-SR B ), there is a problem with the radio module on the Yugos (Ugoos?) ports.
The difference from Plus2 above, only 2GB of RAM and firmware 202009: a special firmware for 2GB RAM from JAW.

X96 Max Plus 100
LAN 100Mb, BT radio module RTL8822CS, WiFi 2.4G 5G, two antennas.
There were also a variant with factory firmware Plus 100 with RTL8723BS radio module, one antenna.

X96 Max Plus XKN
LAN 100Mb, RTL8189FTV 802.11bgn 2.4G radio module, memory 2/16.

X96 Max Plus Q1

LAN 100Mb, Cdtech 4761743 radio module, two antennas.

meson-sm1-x96-max-plus-q2.dtb (include “meson-sm1-h96-max.dts” – compatible = x96-air-q1000
X96 Max Plus Q2
LAN 1Gb, bt (qcom,qca9377-b), RTL8211F, Cdtech 4761743 radio module, two antennas.

X96 Max Plus2 M
LAN 1Gb RTL8211F, BT, radio module Mediatek MT7661RSN, WiFi 2.4G and 5G, two antennas.

meson-sm1-x96-max-plus-ip1001m.dtb (include OC – ethernet-phy@3)
meson-sm1-x96-max-plus-ip1001m-2.dtb (include OC – ethernet-phy@1)
X96Max Plus2 AI
LAN 1Gb IP1001M, BT (DTB AM7256 broadcom brcm4354), radio module AM7256 – WiFi 2.4G and 5G, two antennas.

X96Max Plus A100
LAN 100Mb, BT, radio module AM7256 – WiFi 2.4G and 5G, two antennas.

X96Max Plus 5
Memory 2/16, Amlogic W150S1 WiFi chip, one antenna, board without BT antenna track.

X96 Max Plus 2101
LAN 1Gb JL2101, BT, RTL8822CS radio module (Fn-Link 6222B-SR C ) Wi-Fi 2.4G 5G, two antennas.
recently the dts is added for model ID 524 >Link<

X96 Max Plus 2101W
LAN 1Gb JL2101, W522A radio module (Fn-Link K255B-SR), Wi-Fi 2.4G 5G, two antennas.
No DTS available, use 501 variant: no BT/Wi-Fi support. (Choose a Mediatek Wifi USB dongle)
You can find a backup of Android TV in my >Armbian TV box Images shared folder<


X96 Max Plus 100W
LAN 100Mb, W522A radio module, two antennas.

Other DTB files

https://coreelec.org/dtb/

Boot ARMBIAN from SDCARD

With the last builds of Armbian, I found that is no more necessary the procedure with toothpick explain below to boot the TVBox from the SDcard.
Now it will boot simply inserting the sdcard in the TF card Slot or use a USB card MicroSD reader in an USB port and then power on the TVbox connecting the 5v DC cable.

If the TVBox won’t boot in this way, try as explained below.
Disconnect the power Connector from the set-top box
and disconnect all other usb devices, like dongle for wireless mouse/keyboard.
You have to flash Armbian.img to SDcard with Balenaetcher,
following the typical tutorials online.
If you cannot use the sdcard slot of TV box,
you can use an USB-MicroSD card reader and connect it to USB 3.0 of the set-top box (try USB 2.0 too).
Use a toothpick inserted fully into AV 3.5mm jack until pressing the switch inside,
holding the switch pressed for about 5 seconds
from reconnect the Power connector (DC 5.5mm).

Summarizing: with a toothpick press and hold the switch inside the hole of the AV connector,
connect the DC cable, wait 5 seconds and release the switch removing the toothpick.

Errors on first boot

During the first boot if you got errors for UUID not found or UUID does not exist (initramfs), type the command
blkid
to see the correct UUID and the Label.
If you see only:
/dev/mmcblk2p1: LABEL_FATBOOT=”BOOT_EMMC“…
/dev/mmcblk2p2: LABEL=”ROOTFS_EMMC“…
you have to change the DTS in uEnv.txt because you cannot found ROOTFS (the partition of the sdcard)

if you see LABEL=”ROOTFS” UUID=”7cc2d644-bb23-4ab5-8e26-16a263ccd262
you have to modify the file you edited before (uEnv.txt) with the correct UUID showed by blkid
putting the UUID in the row
APPEND=root=UUID=7cc2d644-bb23-4ab5-8e26-16a263ccd262
or try a boot with
APPEND=root=LABEL=ROOTFS

Example: on my X96 Max Plus 2101W I try to boot with wrong DTS file (meson-sm1-x96-air.dtb)
and got the error UUID does not exist.
I connected sdcard with USB card reader to USB 3.0 port so
blkid now can see also
/dev/sda1 : LABEL_FATBOOT="BOOT"…
/dev/sda2 : LABEL="ROOTFS" UUID="correct UUID" (corresponding to UUID in uEnv.txt)
and I still cannot boot, but I can boot if use
APPEND=root=LABEL=ROOTFS in uEnv.txt


If instead editing uEnv.txt, you edited extlinux\extlinux.conf with the old procedure
edit the row with
append root=UUID=70e0c3c3-49d9-47d0-9719-97897708f5c2
or try
append root=LABEL=ROOTFS

Remember that the other partitions label on sdcard are “BOOT” and “ROOTFS”,
meanwhile on the eMMC the Labels are: “BOOT_EMMC” and “ROOTFS_EMMC”.

First Boot of Armbian on TVBox

When the Armbian system is booted, it will ask for choose the shell
Bash or Zsh (z shell), type the password for root user, the name and password of the first user account, the timezone etc…

Install Armbian on eMMC

Source: https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/documents#8-install-armbian-to-emmc
Type in the shell
armbian-install
(or sudo armbian-install if not logged as root)
choose the Model ID as explained above in according to the .DTS campatible with your TVBox hardware.
With X96-Max+_2101 type: 524
Then choos ext4 or btrfs file system, it will start to copy the partition data on eMMC.
At the end, remove the SDcard, re-insert the DC cable and the TVBox will boot with Armbian installed on the eMMC.

Flashing Stock Android Firmware
with USB Burning Tool.

You can find Amlogic software and drivers in my >Armbian TV box Images shared folder<
Flash the Firmware with >Amlogic USB Burning Tool<.

Use a short cable USB_Male <-> USB_Male and connect the USB 3.0
of the set-top box to any USB of the PC.
Avoid to use adapters like USB_Male to USB Type_C Female
in conjunction with the Smartphone cable:
maybe OTG function of the adapter prevents the recognition of the device.

Soft Brick after flashing Android Firmware of another version

On my Version 2101W, I wrongly flashed the X96 Max Plus2 Android Firmware.
So when I reached the Android Launcher, I gave a Bluetooth Error and no Wifi Connection, because of different hardware.
Then I discovered a time of boot of about 4 minutes!
So when I decided to reflash the correct Stock Firmware,
I had to hold the toothpick at the boot for about 4 minutes before seeing the recognized device in USB Flashing Tool.

Other Armbian for Amlogic TV Box

Sources: https://github.com/ophub/amlogic-s9xxx-armbian
http://mrbluecoat.blogspot.com/2020/10/install-linux-on-x96-max-x96-max.html?m=1
https://github.com/devmfc/debian-on-amlogic
https://fw.jethome.ru/devices/jethome/D1P/

Many Android / ATV=Android TV / ARMBIAN U-BOOT Images
(RK_AML_AW= Rockchip AMlogic AllWinner)

https://disk.yandex.ru/d/_rQgn_FosYuW0g
https://slimboxtv.ru/x96max-plus/

https://cloud.mail.ru/public/6vVy/RkAJ7UbXW

How to choose USB wifi adapter for Linux

https://github.com/morrownr/USB-WiFi/blob/main/home/USB_WiFi_Adapter_Information_for_Linux.md

Turn ON LED Display Clock

armbian-openvfd

Source: https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/led_screen_display_control.md
In terminal do
sudo armbian-openvfd
choose your model, example: type 12 to use x96maxplus.conf
or use
sudo armbian-openvfd 12
If you got errors, try to change DTS file for boot.

To turn off the leds: usb, apps, setup, sd, hdmi, cvbs (turn on only the clock)
edit the file /usr/share/openvfd/conf/x96maxplus.conf (or your_x96.conf file)
sudo nano /usr/share/openvfd/conf/x96maxplus.conf
change
functions='usb apps setup sd hdmi cvbs'
in
functions=''
save the file, stop the service
armbian-openvfd 0
start the service for x96maxplus.conf
armbian-openvfd 12

To update the script or restore the edited files:
armbian-openvfd -u

Autostart Openvfd as service

sudo nano /etc/systemd/system/openvfd.service
[Unit]
Description=openvfd
StartLimitIntervalSec=5
StartLimitBurst=5

[Service]
Type=oneshot
ExecStart=armbian-openvfd 12
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target


save and close.

sudo systemctl daemon-reload
sudo systemctl enable openvfd.service
sudo systemctl stop openvfd
sudo systemctl start openvfd.service
sudo systemctl status openvfd.service

en_GBEnglish (UK)