<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.manjaro.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Danboid</id>
	<title>Manjaro - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.manjaro.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Danboid"/>
	<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php/Special:Contributions/Danboid"/>
	<updated>2026-04-04T04:25:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=48528</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=48528"/>
		<updated>2023-04-06T21:21:19Z</updated>

		<summary type="html">&lt;p&gt;Danboid: sm1 is an invalid SoC type for use with flash-tool. g12a should be used.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Amlogic TV boxes = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use a different WiFi/Bluetooth chipset or use an entirely different SoC. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to get the best performance out of your TV box but this shouldn't be required for normal use. Most Amlogic-based TV boxes have proven to be quite reliable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Manjaro can be installed from and to micro uSD card or USB disk. After installation it is possible to use /boot/install-aml-emmc.sh to copy your installation onto eMMC on some Amlogic TV boxes. Beelink S922x based boxes are known not to currently work with this script and there are likely other models that also won't work booting from eMMC so use the script at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Configure uEnv.ini === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the [https://github.com/manjaro-arm/am6-plus-images AM6 Plus] or [https://github.com/manjaro-arm/gtking-pro-images GT King Pro] Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/uEnv.ini'''. You must edit the line that begins with '''dtb_name=''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
If there isn't an exact match dtb for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-g12a-x96-max.dtb''', '''meson-g12a-sei510.dtb''' or '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dtb_name=/dtbs/amlogic/meson-g12a-x96-max.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
'''aml-flash-tool''' requires that you install the old (0.1.x) libusb libraries. Debian and Ubuntu users have to install '''libusb-dev''' whilst Arch and Manjaro Linux users have to install '''libusb-compat'''. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links === &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
The Ugoo AM6 images use the linux-khadas kernel by default. You are more likely to get your TV box's onboard wifi working by installing the linux-odroid kernel instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
'''X92 v2''' - meson-gxm-q201.dtb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi and HDMI audio. No support for onboard audio or LED display. Onboard bluetooth was working but it has stopped working under recent Manjaro releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands === &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks == &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control === &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script === &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
If you've bricked your AMlogic TV box but suspect the hardware is still OK you could try [https://www.cnx-software.com/2016/11/19/how-to-create-a-bootable-recovery-sd-card-for-amlogic-tv-boxes/ creating a bootable recovery uSD card] to or you could try using the Amlogic burn card maker tool under Windows to re-flash your firmware from a uSD card but I've not had any success with these methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
The best bet for unbricking your TV box is to search for the location of the maskrom contact pads or pins as you can usually revive your box by [https://www.youtube.com/watch?v=OyZJVD5SbSY shorting a couple of contact pads or chip legs on the motherboard]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:TV{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=36408</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=36408"/>
		<updated>2022-11-19T14:09:33Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add libusb-dev requirement to flash tool instructions, improve intro and unbricking sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Amlogic TV boxes = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use a different WiFi/Bluetooth chipset or use an entirely different SoC. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to get the best performance out of your TV box but this shouldn't be required for normal use. Most Amlogic-based TV boxes have proven to be quite reliable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Manjaro can be installed from and to micro uSD card or USB disk. After installation it is possible to use /boot/install-aml-emmc.sh to copy your installation onto eMMC on some Amlogic TV boxes. Beelink S922x based boxes are known not to currently work with this script and there are likely other models that also won't work booting from eMMC so use the script at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Configure uEnv.ini === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the [https://github.com/manjaro-arm/am6-plus-images AM6 Plus] or [https://github.com/manjaro-arm/gtking-pro-images GT King Pro] Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/uEnv.ini'''. You must edit the line that begins with '''dtb_name=''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
If there isn't an exact match dtb for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-g12a-x96-max.dtb''', '''meson-g12a-sei510.dtb''' or '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dtb_name=/dtbs/amlogic/meson-g12a-x96-max.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''aml-flash-tool''' requires that you install the old (0.1.x) libusb libraries. Debian and Ubuntu users have to install '''libusb-dev''' whilst Arch and Manjaro Linux users have to install '''libusb-compat'''. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=sm1}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links === &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
The Ugoo AM6 images use the linux-khadas kernel by default. You are more likely to get your TV box's onboard wifi working by installing the linux-odroid kernel instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X92 v2''' - meson-gxm-q201.dtb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi and HDMI audio. No support for onboard audio or LED display. Onboard bluetooth was working but it has stopped working under recent Manjaro releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands === &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks == &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control === &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script === &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
If you've bricked your AMlogic TV box but suspect the hardware is still OK you could try [https://www.cnx-software.com/2016/11/19/how-to-create-a-bootable-recovery-sd-card-for-amlogic-tv-boxes/ creating a bootable recovery uSD card] to or you could try using the Amlogic burn card maker tool under Windows to re-flash your firmware from a uSD card but I've not had any success with these methods.&lt;br /&gt;
&lt;br /&gt;
The best bet for unbricking your TV box is to search for the location of the maskrom contact pads or pins as you can usually revive your box by [https://www.youtube.com/watch?v=OyZJVD5SbSY shorting a couple of contact pads or chip legs on the motherboard]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:TV{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=36149</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=36149"/>
		<updated>2022-08-22T09:26:24Z</updated>

		<summary type="html">&lt;p&gt;Danboid: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Amlogic TV boxes = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Manjaro can be installed from and to micro uSD card or USB disk. After installation it is possible to use /boot/install-aml-emmc.sh to copy your installation onto eMMC on some Amlogic TV boxes. Beelink S922x based boxes are known not to currently work with this script and there are likely other models that also won't work booting from eMMC so use the script at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Configure uEnv.ini === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the [https://github.com/manjaro-arm/am6-plus-images AM6 Plus] or [https://github.com/manjaro-arm/gtking-pro-images GT King Pro] Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/uEnv.ini'''. You must edit the line that begins with '''dtb_name=''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
If there isn't an exact match dtb for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-g12a-x96-max.dtb''', '''meson-g12a-sei510.dtb''' or '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dtb_name=/dtbs/amlogic/meson-g12a-x96-max.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links === &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
The Ugoo AM6 images use the linux-khadas kernel by default. You are more likely to get your TV box's onboard wifi working by installing the linux-odroid kernel instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X92 v2''' - meson-gxm-q201.dtb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi and HDMI audio. No support for onboard audio or LED display. Onboard bluetooth was working but it has stopped working under recent Manjaro releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands === &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks == &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control === &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script === &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
If you've bricked your AMlogic TV box but suspect the hardware is still OK you can try [https://www.cnx-software.com/2016/11/19/how-to-create-a-bootable-recovery-sd-card-for-amlogic-tv-boxes/ creating a bootable recovery uSD card] to re-flash your firmware.&lt;br /&gt;
&lt;br /&gt;
As a last resort, several users have unbricked their boxes by [https://www.youtube.com/watch?v=OyZJVD5SbSY shorting a couple of pins on the motherboard]. This requires opening your TV box which will likely invalidate your warranty, if you have one and is a bit tricky because the exact pins to short and their location varies between devices.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:TV{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=35422</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=35422"/>
		<updated>2022-06-02T16:56:13Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add note on installing linux-odroid kernel, change to using meson-g12a-x96-max.dtb as the default recommended dtb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Amlogic TV boxes = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Manjaro can be installed from and to micro uSD card or USB disk. After installation it is possible to use /boot/install-aml-emmc.sh to copy your installation onto eMMC on some Amlogic TV boxes. Beelink S922x based boxes are known not to currently work with this script and there are likely other models that also won't work booting from eMMC so use the script at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Configure uEnv.ini === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the [https://github.com/manjaro-arm/am6-plus-images AM6 Plus] or [https://github.com/manjaro-arm/gtking-pro-images GT King Pro] Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/uEnv.ini'''. You must edit the line that begins with '''dtb_name=''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
If there isn't an exact match dtb for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-g12a-x96-max.dtb''', '''meson-g12a-sei510.dtb''' or '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dtb_name=/dtbs/amlogic/meson-g12a-x96-max.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links === &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
The Ugoo AM6 images use the linux-khadas kernel by default. You are more likely to get your TV box's onboard wifi working by installing the linux-odroid kernel instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi and HDMI audio. No support for onboard audio or LED display. Onboard bluetooth was working but it has stopped working under recent Manjaro releases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands === &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks == &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control === &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script === &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
If you've bricked your AMlogic TV box but suspect the hardware is still OK you can try [https://www.cnx-software.com/2016/11/19/how-to-create-a-bootable-recovery-sd-card-for-amlogic-tv-boxes/ creating a bootable recovery uSD card] to re-flash your firmware.&lt;br /&gt;
&lt;br /&gt;
As a last resort, several users have unbricked their boxes by [https://www.youtube.com/watch?v=OyZJVD5SbSY shorting a couple of pins on the motherboard]. This requires opening your TV box which will likely invalidate your warranty, if you have one and is a bit tricky because the exact pins to short and their location varies between devices.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:TV{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=33199</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=33199"/>
		<updated>2022-03-10T21:07:51Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Update 'Configure uEnv.ini' section to recommend using a AM6 Plus or GT King Pro image instead of a vim3 image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Amlogic TV boxes = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Manjaro can be installed from and to micro uSD card or USB disk. After installation it is possible to use /boot/install-aml-emmc.sh to copy your installation onto eMMC on some Amlogic TV boxes. Beelink S922x based boxes are known not to currently work with this script and there are likely other models that also won't work booting from eMMC so use the script at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Configure uEnv.ini === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the [https://github.com/manjaro-arm/am6-plus-images AM6 Plus] or [https://github.com/manjaro-arm/gtking-pro-images GT King Pro] Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/uEnv.ini'''. You must edit the line that begins with '''dtb_name=''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-g12a-sei510.dtb''' or '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dtb_name=/dtbs/amlogic/meson-g12a-sei510.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links === &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands === &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks == &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control === &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script === &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
If you've bricked your AMlogic TV box but suspect the hardware is still OK you can try [https://www.cnx-software.com/2016/11/19/how-to-create-a-bootable-recovery-sd-card-for-amlogic-tv-boxes/ creating a bootable recovery uSD card] to re-flash your firmware.&lt;br /&gt;
&lt;br /&gt;
As a last resort, several users have unbricked their boxes by [https://www.youtube.com/watch?v=OyZJVD5SbSY shorting a couple of pins on the motherboard]. This requires opening your TV box which will likely invalidate your warranty, if you have one and is a bit tricky because the exact pins to short and their location varies between devices.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:TV{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=30596</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=30596"/>
		<updated>2022-01-30T13:50:39Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Update commands for new /boot structure, mention eMMC install script, add new link to unbricking guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Amlogic TV boxes = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Manjaro can be installed from and to micro uSD card or USB disk. After installation it is possible to use /boot/install-aml-emmc.sh to copy your installation onto eMMC on some Amlogic TV boxes. Beelink S922x based boxes are known not to currently work with this script and there are likely other models that also won't work booting from eMMC so use the script at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Configure uEnv.ini === &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/uEnv.ini'''. You must edit the line that begins with '''dtb_name=''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-g12a-sei510.dtb''' or '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;dtb_name=/dtbs/amlogic/meson-g12a-sei510.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB === &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode === &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool === &amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh === &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links === &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files == &amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files === &amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands === &amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks == &amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback === &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto videofile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control === &amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script === &amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking === &amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
If you've bricked your AMlogic TV box but suspect the hardware is still OK you can try [https://www.cnx-software.com/2016/11/19/how-to-create-a-bootable-recovery-sd-card-for-amlogic-tv-boxes/ creating a bootable recovery uSD card] to re-flash your firmware.&lt;br /&gt;
&lt;br /&gt;
As a last resort, several users have unbricked their boxes by [https://www.youtube.com/watch?v=OyZJVD5SbSY shorting a couple of pins on the motherboard]. This requires opening your TV box which will likely invalidate your warranty, if you have one and is a bit tricky because the exact pins to short and their location varies between devices.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page{{#translation:}}]]&lt;br /&gt;
[[Category:TV{{#translation:}}]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22945</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22945"/>
		<updated>2021-06-30T13:46:28Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add link to Russian X96 Max Plus identification post on 4pda&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are [https://4pda.to/forum/index.php?showtopic=1002233&amp;amp;st=9500#entry102780026 several versions of the X96 Max Plus]. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback ===&lt;br /&gt;
&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto &amp;lt;videofile&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22944</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22944"/>
		<updated>2021-06-30T10:58:08Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Hardware accelerated video playback' section and add link to the X96 Max Plus dtb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
'''X96 Max Plus''' - [https://drive.google.com/file/d/1yHJFJl2CdAwLfR-3tJKHU4I-B9iB2Iqm/view?usp=sharing meson-sm1-x96maxplus-vim100m.dtb] - There are several versions of the X96 Max Plus. This dtb is configured for those with the rtl8822cs WiFi chipset in which case you should get HDMI audio, WiFi, Bluetooth and 100Mb ethernet if you install the rtl8822cs DKMS kernel module package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware accelerated video playback ===&lt;br /&gt;
&lt;br /&gt;
The '''meson-vdec''' kernel module offers support for decoding MPEG 1/2/4, h264, h265/HEVC and VP9 in hardware but it currently only seems to work with '''mpv''' for some codecs up to Full HD / 1080p resolution @ 30 fps, despite the hardware supporting 4K.&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=mpv --vo=gpu --hwdec=v4l2m2m-copy --hwdec=auto &amp;lt;videofile&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You can add these options to '''~/.config/mpv/mpv.conf''' to avoid typing them every time you run '''mpv'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22943</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22943"/>
		<updated>2021-06-28T15:40:28Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add Evolution TV and SLIMBOX links to Android firmware section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes.] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes.]&lt;br /&gt;
&lt;br /&gt;
[https://www.evolutiontv-vs.com/uncategorized/%D0%B1%D0%BB%D0%BE%D0%B3-%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%BD%D1%8B%D1%85-%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2.html Evolution TV] has firmware downloads for several TV boxes.&lt;br /&gt;
&lt;br /&gt;
[https://forum.xda-developers.com/t/project-slimbox.4152049/ SLIMBOX] is a custom Android firmware for Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22942</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22942"/>
		<updated>2021-06-28T11:47:58Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22941</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22941"/>
		<updated>2021-06-27T22:44:28Z</updated>

		<summary type="html">&lt;p&gt;Danboid: There are at least 8 versions of the X96 Air series&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least eight versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22940</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22940"/>
		<updated>2021-06-27T16:04:59Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Rewrite Flashing Android section to improve readability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash Android. If you have a suitable installation image for your box and a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. Be careful to only flash images built specifically for your box or you could 'brick' your box, which means it won't boot and you can't enable multi-boot mode.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22939</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22939"/>
		<updated>2021-06-27T14:11:41Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Edit 'Reflashing Android with flash-tool.sh' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box and you have a USB A to A cable then you can use '''aml-flash-tool''' to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. You must be careful to only flash images built specifically for your box or else you can 'brick' your box, which means it won't boot and you can't enable multi-boot mode either.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22915</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22915"/>
		<updated>2021-06-27T13:54:17Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add warning about flashing images, add more details on using the HDMI audio script and add 'Unbricking' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multi-boot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multi-boot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your boxnand you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''' You must back up everything stored on your TV box before flashing an image because all data stored on the eMMC will be  wiped. You must also be careful to only flash images built for your box or else you can brick your box, which means it won't boot and in some cases you won't be able to enable multi-boot mode either.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh g12_sound.sh] has fixed their HDMI audio. If you are having HDMI audio issues, you will likely already have '''g12_sound.sh''' installed so run the script then:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=sudo systemctl enable sound}}&lt;br /&gt;
&lt;br /&gt;
Reboot and test!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Unbricking ===&lt;br /&gt;
&lt;br /&gt;
Some TV box users have successfully unbricked their boxes by [https://www.youtube.com/watch?v=fsyS3p5asZs shorting a couple of pins on the eMMMC chip]. This requires opening your TV box which will likely invalidate your warranty, if you have one.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22902</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22902"/>
		<updated>2021-06-24T16:45:02Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Update Beelink GT King Pro notes and remove archlinuxdroid section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - works with the older '''linux-vim''' 5.9.y or 5.10.y series and current mainline linux 5.12.y kernels.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running '''g12_sound.sh''' from [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install/-/blob/master/g12_sound.sh this repo] has fixed their HDMI audio.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22901</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22901"/>
		<updated>2021-06-24T11:21:52Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Replace Mali with Panfrost&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''. It is worth trying both to see which works best for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - only works with the older '''linux-vim''' 5.9.y or 5.10.y kernels&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The mesa Mali driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Updating mesa graphics drivers ===&lt;br /&gt;
&lt;br /&gt;
The Panfrost mesa graphics driver is still under quite heavy development and you may find you get much improved GPU performance by installing a newer build of mesa. The easiest way to update mesa is via the [http://archlinuxdroid.tk/archlinuxdroid/aarch64/ archlinuxdroid] repo.&lt;br /&gt;
&lt;br /&gt;
Download and install the latest '''archlinuxdroid-repo''' package then update to the latest daily mesa build by installing '''mesa-devel-git'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running '''g12_sound.sh''' from [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install this repo] has fixed their HDMI audio.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22900</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22900"/>
		<updated>2021-06-24T09:58:18Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add GT King Pro dtb details and kernel package options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to an SD card or USB disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel. A DTB file is required on ARM Linux devices to configure and enable certain types of hardware supported by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
If you [https://wiki.manjaro.org/index.php/Switching_Branches switch to the Manjaro unstable branch], you have a choice between the '''linux-aml''' and '''linux-vim''' kernel packages but only one can be installed at a time. Some users report better results with '''linux-aml''' whilst others can only boot using '''linux-vim'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi or bluetooth.&lt;br /&gt;
&lt;br /&gt;
'''Beelink GT King Pro''' - meson-g12b-gtkingpro-pro.dtb or meson-g12b-ugoos-am6.dtb - only works with the older '''linux-vim''' 5.9.y or 5.10.y kernels&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The Mali mesa driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Updating mesa graphics drivers ===&lt;br /&gt;
&lt;br /&gt;
The Mali graphics driver is still under quite heavy development and you may find you get much improved GPU performance by installing a newer build of mesa. The easiest way to update mesa is via the [http://archlinuxdroid.tk/archlinuxdroid/aarch64/ archlinuxdroid] repo.&lt;br /&gt;
&lt;br /&gt;
Download and install the latest '''archlinuxdroid-repo''' package then update to the latest daily mesa build by installing '''mesa-devel-git'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running '''g12_sound.sh''' from [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install this repo] has fixed their HDMI audio.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22899</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22899"/>
		<updated>2021-06-23T15:32:55Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Formatting fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi/bluetooth. &lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The Mali mesa driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Updating mesa graphics drivers ===&lt;br /&gt;
&lt;br /&gt;
The Mali graphics driver is still under quite heavy development and you may find you get much improved GPU performance by installing a newer build of mesa. The easiest way to update mesa is via the [http://archlinuxdroid.tk/archlinuxdroid/aarch64/ archlinuxdroid] repo.&lt;br /&gt;
&lt;br /&gt;
Download and install the latest '''archlinuxdroid-repo''' package then update to the latest daily mesa build by installing '''mesa-devel-git'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running '''g12_sound.sh''' from [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install this repo] has fixed their HDMI audio.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22898</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22898"/>
		<updated>2021-06-23T13:03:51Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add HDMI audio script link and SoC codenames&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as [https://www.balena.io balenaEthcher] or '''gnome-disks''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
'''A95X F2''' - meson-g12a-u200.dtb - Boots but no ethernet, wifi/bluetooth. &lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
=== dtb/SoC code names ===&lt;br /&gt;
&lt;br /&gt;
This is the dtb naming scheme used for the various Amlogic SoC's, which may help you find a working dtb:&lt;br /&gt;
&lt;br /&gt;
gxbb → S905&lt;br /&gt;
gxl → S905X&lt;br /&gt;
g12a → S905X2&lt;br /&gt;
g12b → S922X&lt;br /&gt;
gxm → S912&lt;br /&gt;
sm1 → S905X3&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The Mali mesa driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Updating mesa graphics drivers ===&lt;br /&gt;
&lt;br /&gt;
The Mali graphics driver is still under quite heavy development and you may find you get much improved GPU performance by installing a newer build of mesa. The easiest way to update mesa is via the [http://archlinuxdroid.tk/archlinuxdroid/aarch64/ archlinuxdroid] repo.&lt;br /&gt;
&lt;br /&gt;
Download and install the latest '''archlinuxdroid-repo''' package then update to the latest daily mesa build by installing '''mesa-devel-git'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== HDMI audio script ===&lt;br /&gt;
&lt;br /&gt;
Some users have reported running '''g12_sound.sh''' from [https://gitlab.manjaro.org/manjaro-arm/packages/community/oc4-post-install this repo] has fixed their HDMI audio.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22897</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22897"/>
		<updated>2021-06-23T11:01:45Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add link to panfrost docs, formatting tweaks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
'''X96 Air Q1000''' - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The Mali mesa driver, [https://docs.mesa3d.org/drivers/panfrost.html Panfrost], is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Updating mesa graphics drivers ===&lt;br /&gt;
&lt;br /&gt;
The Mali graphics driver is still under quite heavy development and you may find you get much improved GPU performance by installing a newer build of mesa. The easiest way to update mesa is via the [http://archlinuxdroid.tk/archlinuxdroid/aarch64/ archlinuxdroid] repo.&lt;br /&gt;
&lt;br /&gt;
Download and install the latest '''archlinuxdroid-repo''' package then update to the latest daily mesa build by installing '''mesa-devel-git'''.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22896</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22896"/>
		<updated>2021-06-23T09:47:10Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Updating mesa graphics drivers' sections, add note about Wayland&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
X96 Air Q1000 - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Tested with linux-aml kernel 5.12. Working gigabit ethernet, WiFi, Bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor] - Tool to split a kernel image with appended dtbs into separated kernel and dtb files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
The Mali mesa driver is optimised for use under Wayland so you should get better GPU performance using Wayland-based desktops.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Updating mesa graphics drivers ===&lt;br /&gt;
&lt;br /&gt;
The Mali graphics driver is still under quite heavy development and you may find you get much improved GPU performance by installing a newer build of mesa. The easiest way to update mesa is via the [http://archlinuxdroid.tk/archlinuxdroid/aarch64/ archlinuxdroid] repo.&lt;br /&gt;
&lt;br /&gt;
Download and install the latest '''archlinuxdroid-repo''' package then update to the latest daily mesa build by installing '''mesa-devel-git'''.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22895</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22895"/>
		<updated>2021-06-23T02:16:03Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add kernel version note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
X96 Air Q1000 - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Testing with Linux 5.12. Working gigabit ethernet, WiFi, bluetooth and HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22894</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22894"/>
		<updated>2021-06-23T01:58:13Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'dtb files' and 'Tips and tricks' sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .dtb files ==&lt;br /&gt;
&lt;br /&gt;
A DTB file is a Linux Device Tree Blob. Device Tree Compiler (dtc) converts between the human editable device tree source &amp;quot;dts&amp;quot; format and the compact device tree blob &amp;quot;dtb&amp;quot; representation usable by the Linux kernel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recommended .dtb files ===&lt;br /&gt;
&lt;br /&gt;
This is a list of Amlogic TV boxes and the dtbs that offer the best support. Please provide a download link if the dtb is not packaged with the Manjaro vim or aml kernel.&lt;br /&gt;
&lt;br /&gt;
X96 Air Q1000 - [https://github.com/danboid/meson-sm1-sei610-qca9377-bt meson-sm1-sei610-qca9377-bt] - Working gig eth, Wifi, BT, HDMI audio. No support for onboard audio or LED display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Useful device tree commands ===&lt;br /&gt;
&lt;br /&gt;
Decompile dtb to dts:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -I dtb -O dts -o devicetree.dts devicetree.dtb }}&lt;br /&gt;
&lt;br /&gt;
Compile a dts to a dtb:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=dtc -O dtb -o devicetree.dtb devicetree.dts}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PabloCastellano/extract-dtb DTB extractor]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Enable graphics acceleration ===&lt;br /&gt;
&lt;br /&gt;
Edit '''/etc/X11/xorg.conf.d/01-panfrost.conf''' and change '''AccelMethod''' from '''none''' to '''glamor'''.&lt;br /&gt;
&lt;br /&gt;
=== CH340-fan-control ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/danboid/CH340-fan-control CH340-fan-control] is a python script to control a USB fan.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22893</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22893"/>
		<updated>2021-06-22T22:17:27Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Rooting Android' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rooting Android ==&lt;br /&gt;
&lt;br /&gt;
Having root access under Android is useful because this lets you copy your dtb file(s). Whilst you cannot use Android dtbs with the Manjaro mainline kernels, you can decompile them to dts files and this info can be useful when customising dts/dtb files that work with your kernel, if you have the skills and time to dedicate towards developing or modifying device tree files.&lt;br /&gt;
&lt;br /&gt;
Some TV boxes come pre-rooted whilst others include an app to easily enable root/sudo access. You can use the Android Root Checker app to test if you have root access. If your TV box doesn't offer any root support then you can use '''TWRP''' and '''Magisk''' to root it. Note this isn't a permanent root solution and you will be required to boot off a Magisk modified SD card to enable root access.&lt;br /&gt;
&lt;br /&gt;
Download the latest [https://twrp.me/amlogic/amlogicu212.html X96 Max (u212) build of TWRP]. This build of TWRP should boot on most Amlogic TV boxes, not just the X96 Max.&lt;br /&gt;
&lt;br /&gt;
Format a micro SD card as FAT32 and copy the twrp image ('''twrp-3.5.2_9-0-u212.img''') onto it and rename it to '''recovery.img'''. Insert the micro SD into your TV box then hold in the multiboot AV button in whilst inserting the power until you see the boot screen. Your TV box should then reboot into TWRP.&lt;br /&gt;
&lt;br /&gt;
Swipe (drag the button with your USB mouse) to allow modifications. On the main '''TWRP''' menu, choose '''Backup'''. The only partition we want to backup is the '''Boot''' partition, which should already be selected. Deselect the '''Data''' partition if that is auto-selected then click '''Select Storage''', choose the '''Micro SD card''' then swipe to backup the boot partition. It should only take a few seconds before you are given the option to reboot.&lt;br /&gt;
&lt;br /&gt;
Next, install and run [https://github.com/topjohnwu/Magisk/releases Magisk] under Android. When installing Magisk, choose '''Recovery mode''' then select the '''Select and Patch a File''' method. You will then be asked to locate the backup of the boot partition we created with TWRP so navigate to '''SD card/TWRP/BACKUPS/1234567890/SOMEDATE/boot.emmc.win''' and double-click the boot partition image file then choose '''Let's go'''. Magisk will then patch the ramdisk within the boot image and create a new recovery image called '''magisk_patched-something.img''' that gets saved to your Android '''Downloads''' directory. Copy this new image file from '''Downloads''' onto a micro SD card and rename it '''recovery.img''' so that you can multiboot from it, rooted.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22891</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22891"/>
		<updated>2021-06-22T13:15:00Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add links to external firmware download sites&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;br /&gt;
&lt;br /&gt;
=== External Amlogic TV box firmware download links ===&lt;br /&gt;
&lt;br /&gt;
Download and flash these firmware files at your own risk! These sites and manufacturers are in no way connected to Manjaro and so the Manjaro developers will not provide any support for installing these.&lt;br /&gt;
&lt;br /&gt;
[https://tinhte.vn/thread/tong-hop-cac-ban-firmware-cua-android-tv-box-x96-air.3050996/ Firmware for the X96 Air family of boxes] &lt;br /&gt;
&lt;br /&gt;
[https://www.turewell.com/pages/tvbox-document Turewell firmware for the T95 boxes]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22890</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22890"/>
		<updated>2021-06-22T12:38:45Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Reflashing with flash-tool.sh' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reflashing Android with flash-tool.sh ==&lt;br /&gt;
&lt;br /&gt;
In emergency situations, like when Manjaro stops booting due to your bootloader having been modified or corrupted, you may need to reflash the Android OS on your TV box eMMC. If you have got a suitable installation image for your box, they are usually a couple of gigabytes in size, and you have a USB A to A cable then you can perform the following steps to reflash your TV box under Linux.&lt;br /&gt;
&lt;br /&gt;
=== Installing aml-flash-tool ===&lt;br /&gt;
&lt;br /&gt;
Clone the '''aml-flash-tool''' repo:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=git clone https://github.com/osmc/aml-flash-tool.git}}&lt;br /&gt;
&lt;br /&gt;
Copy '''aml_image_v2_packer''' and the amlogic '''update''' program into your path:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cp ./aml-flash-tool/tools/linux-x86/* ~/.local/bin}}&lt;br /&gt;
&lt;br /&gt;
You are now prepared to run '''flash-tool.sh'''&lt;br /&gt;
&lt;br /&gt;
=== Reflashing with flash-tool.sh ===&lt;br /&gt;
&lt;br /&gt;
Disconnect the power from your TV box and plug a USB A to USB A cable into your TV box. It varies which port to use but usually only one port will work for reflashing. Now insert a pin or similar into the AV hole, depress the button and keep it pressed as you connect the USB A to A cable to your other machine. You will know when your TV box is ready to be flashed with '''flash-tool.sh''' because you will see an Amlogic device listed when you run '''lsusb'''.&lt;br /&gt;
&lt;br /&gt;
When you can see your TV box is connected, you can flash it using a command such as:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=./flash-tool.sh --img=X96AIR_Q1000_20210127-2121.img --parts=all --wipe --soc=g12a}}&lt;br /&gt;
&lt;br /&gt;
Replacing '''X96AIR_Q1000_20210127-2121.img''' with the path to the image you wish to flash. You do not need to run '''flash-tool.sh''' as root.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22889</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22889"/>
		<updated>2021-06-22T11:15:06Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Enable multiboot mode' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting from USB ===&lt;br /&gt;
&lt;br /&gt;
If you are booting Manjaro from a USB disk or via a USB SATA adapter/enclosure, there is a good chance that you will be required to add a '''usb-storage.quirks''' kernel parameter to the '''APPEND''' statement in '''extlinux.conf''' like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;APPEND root=PARTUUID=5418e4d8-02 rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=152d:1561:u&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must replace '''152d:1561''' with the correct USB vendor and product IDs for your USB device. You can find these identifiers by running '''lsusb''' when you have your disk or adapter connected to a Linux box. It is recommended you boot from USB without setting the USB storage quirks parameter where possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Enable multiboot mode ===&lt;br /&gt;
&lt;br /&gt;
If this is your first time attempting to boot from an SD card or USB disk, you must enable multiboot mode. Insert your Manjaro micro SD card or attach the Manjaro USB disk then hold down the button in the AV port by inserting a paper clip, a pin or something similar and keep it depressed while powering the device on. Keep the button pressed until you see the boot screen of your box. After a few seconds it should reboot off your SD card or USB disk. You are only required to do this once unless you reflash your eMMC.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22887</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22887"/>
		<updated>2021-06-22T01:43:03Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Configure extlinux.conf' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Manjaro can be installed from and to micro SD card or USB disk. It is not currently possible to install Manjaro to eMMC on Amlogic TV boxes.&lt;br /&gt;
&lt;br /&gt;
=== Configure extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
After using a disk imaging tool such as '''dd''' to write one of the vim3 Manjaro ARM images to a disk, mount the disk and edit '''BOOT_MNJRO/extlinux/extlinux.conf'''. You must edit the line that begins with '''FDT /dtbs/amlogic/''' to point to the dtb file that you wish to use to configure your device tree.&lt;br /&gt;
&lt;br /&gt;
If there isn't a matching dtb file for your box within the dtbs folder and you can't find a suitable dtb on this wiki or in the Manjaro forums then you should try '''meson-sm1-sei610.dtb''' first:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FDT /dtbs/amlogic/meson-sm1-sei610.dtb&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22886</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22886"/>
		<updated>2021-06-22T01:06:54Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add 'Identifying your box' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Identifying your box ==&lt;br /&gt;
&lt;br /&gt;
Under Android, go to '''Settings -&amp;gt; System -&amp;gt; About phone'''&lt;br /&gt;
&lt;br /&gt;
The device name given under '''About phone''' is often the best one to use to identify your box but you can also run:&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|command=cat /proc/device-tree/amlogic-dt-id}}&lt;br /&gt;
&lt;br /&gt;
Under an Android terminal to show your boxes device tree ID.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22885</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22885"/>
		<updated>2021-06-22T00:49:04Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Tweak warning some more&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors. These TV boxes can be purchased for a fraction of the price of a similar spec single board computer whilst coming complete with a case, remote and cables but there are a few catches to be aware of.&lt;br /&gt;
&lt;br /&gt;
The Android TV box market is awash with fakes and clones. It has been known for manufacturers to re-use the exact same model name yet use an entirely different chipset. For example, there are at least six versions of the X96 Air but they all have exactly the same case. The TV box manufacturers rarely if ever provide updates for their Android-based OS's and they provide zero support for users wanting to run alternate operating systems so achieving full support for every box is almost impossible. &lt;br /&gt;
&lt;br /&gt;
Physical build quality is another frequent issue with TV boxes, in particular poor thermal designs are quite common. You may have to cut a hole or two in the case and place a USB powered fan over the SoC to perform CPU intensive tasks without throttling or overheating.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22884</id>
		<title>Amlogic TV boxes</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Amlogic_TV_boxes&amp;diff=22884"/>
		<updated>2021-06-21T23:54:46Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Start Warning section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Amlogic TV boxes =&lt;br /&gt;
&lt;br /&gt;
== General disclaimer and warning ==&lt;br /&gt;
&lt;br /&gt;
It is possible to install and run Manjaro on several affordable Android TV boxes using Amlogic chipsets such as the S905, S922 and A311 series of processors.&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
	<entry>
		<id>https://wiki.manjaro.org/index.php?title=Manjaro-ARM&amp;diff=22883</id>
		<title>Manjaro-ARM</title>
		<link rel="alternate" type="text/html" href="https://wiki.manjaro.org/index.php?title=Manjaro-ARM&amp;diff=22883"/>
		<updated>2021-06-20T22:53:34Z</updated>

		<summary type="html">&lt;p&gt;Danboid: Add Android TV boxes section with link to separate (new) wiki page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
The Manjaro distribution, but for ARM devices.&lt;br /&gt;
&lt;br /&gt;
Based on Arch Linux ARM, combined with Manjaro tools, themes and infrastructure to make install images for your ARM device, like the Pinebook and Raspberry Pi. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
===Downloading===&lt;br /&gt;
&lt;br /&gt;
You can find installation images in the downloads section of the [https://manjaro.org/download/#ARM Manjaro Website] or at [https://osdn.net/projects/manjaro-arm/ OSDN]&amp;lt;br&amp;gt;&lt;br /&gt;
Find the image that matches your target device and desired edition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Writing the Installation Media===&lt;br /&gt;
&lt;br /&gt;
The images are in a .xz file. These files can be burned directly to an SD card with Etcher or with dd directly.&amp;lt;br&amp;gt;&lt;br /&gt;
To manually install to your SD card with dd:&lt;br /&gt;
&lt;br /&gt;
Extract the image.&lt;br /&gt;
&lt;br /&gt;
 unxz Manjaro-ARM-[Edition]-[Device]-[Version].xz&lt;br /&gt;
&lt;br /&gt;
Get it on the SD card&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=Manjaro-ARM-[Edition]-[Device]-[Version].img of=/dev/[device] bs=4M&lt;br /&gt;
Where ''[device]'' is your SD card's device, as seen by lsblk. Usually mmcblk0 or sdb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Cleanup and First Boot===&lt;br /&gt;
Once you have the image on the SDCard, you should be able to put the card into your device and plug it in. If everything worked correctly, it should boot to the OEM setup. Here you define your username, passwords locales etc. Once that is done, the script will clean up after itself, resize the partition and reboot the device. After that reboot, it should boot to the Operating System Depending on the edition you have installed, this could be a simple TTY login or a graphical desktop environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Resizing the partitions===&lt;br /&gt;
Since 18.09 this is now done automatically. The device will boot to OEM setup, which will handle the resizing, and then reboot before the login screen would appear. When it's booted to the login screen, the filesystem has been resized to fill out the remaining space on the SD card.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Login===&lt;br /&gt;
Login depends on what you set up during the OEM setup.&lt;br /&gt;
There are 1 users by default on the image. root.&lt;br /&gt;
And by default it has no password and autologin enabled.&lt;br /&gt;
This gets changed when the OEM script is run, to disable the autologin and set the password defined during the setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Supported Devices=&lt;br /&gt;
&lt;br /&gt;
==Hardkernel==&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;width: 100%;&amp;quot;-- Header --&amp;gt; &lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
!  colspan=&amp;quot;4&amp;quot; | Hardkernel&lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;width: 12%&amp;quot;|&lt;br /&gt;
&amp;lt;strong&amp;gt;Model&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Odroid-C2&lt;br /&gt;
| Odroid-C4 &lt;br /&gt;
| Odroid-N2 &lt;br /&gt;
| Odroid-N2+ &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Release Year&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2016 &lt;br /&gt;
| 2020 &lt;br /&gt;
| 2019 &lt;br /&gt;
| 2020 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;SoC Manufacturer&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Amlogic &lt;br /&gt;
| Amlogic &lt;br /&gt;
| Amlogic &lt;br /&gt;
| Amlogic &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Lithography&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 28nm &lt;br /&gt;
| 12nm &lt;br /&gt;
| 12nm &lt;br /&gt;
| 12nm &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| S905 &lt;br /&gt;
| S905X3 &lt;br /&gt;
| S922X &lt;br /&gt;
| S922X &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Topology&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A55 &lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;4 x Cortex-A73&amp;lt;br&amp;gt;2 x Cortex-A53 &lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;4 x Cortex-A73&amp;lt;br&amp;gt;2 x Cortex-A53 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Frequency&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 4 x 1.5GHz &lt;br /&gt;
| 4 x 2.0GHz &lt;br /&gt;
| 4 x 2.0GHz&amp;lt;br&amp;gt;2 x 1.8GHz &lt;br /&gt;
| 4 x 2.4GHz&amp;lt;br&amp;gt;2 x 1.9GHz &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;GPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Mali-450 MP3 &lt;br /&gt;
| Mali-G31 MP2 &lt;br /&gt;
| Mali-G52 MP4 &lt;br /&gt;
| Mali-G52 MP4 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Memory&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2GB&amp;lt;br&amp;gt;DDR3&lt;br /&gt;
| 4GB&amp;lt;br&amp;gt;DDR4 &lt;br /&gt;
| 2&amp;amp;ndash;4GB&amp;lt;br&amp;gt;DDR4&lt;br /&gt;
| 2&amp;amp;ndash;4GB&amp;lt;br&amp;gt;DDR4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Khadas==&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;width: 100%;&amp;quot;-- Header --&amp;gt; &lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
!  colspan=&amp;quot;4&amp;quot; | Khadas&lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;width: 12%&amp;quot;|&lt;br /&gt;
&amp;lt;strong&amp;gt;Model&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Edge-V &lt;br /&gt;
| Vim 1&lt;br /&gt;
| Vim 2 &lt;br /&gt;
| Vim 3 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Release Year&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2018 &lt;br /&gt;
| 2016 &lt;br /&gt;
| 2017 &lt;br /&gt;
| 2019 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;SoC Manufacturer&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Rockchip &lt;br /&gt;
| Amlogic &lt;br /&gt;
| Amlogic &lt;br /&gt;
| Amlogic &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Lithography&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 28nm &lt;br /&gt;
| 28nm &lt;br /&gt;
| 28nm &lt;br /&gt;
| 12nm &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| RK3399 &lt;br /&gt;
| S905X &lt;br /&gt;
| S912 &lt;br /&gt;
| A311D &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Topology&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;2 x Cortex-A72&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Octa-core:&amp;lt;br&amp;gt;8 x Cortex-A53 &lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;4 x Cortex-A73&amp;lt;br&amp;gt;2 x Cortex-A53 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Frequency&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2 x 1.8GHz&amp;lt;br&amp;gt;4 x 1.5GHz &lt;br /&gt;
| 4 x 1.5GHz &lt;br /&gt;
| 8 x 1.5GHz &lt;br /&gt;
| 4 x 2.2GHz&amp;lt;br&amp;gt;2 x 1.8GHz &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;GPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Mali-T860 MP4 &lt;br /&gt;
| Mali-450 MP3 &lt;br /&gt;
| Mali-T820 MP3 &lt;br /&gt;
| Mali-G52 MP4 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Memory&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2&amp;amp;ndash;4GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
| 2GB&amp;lt;br&amp;gt;DDR3&lt;br /&gt;
| 2&amp;amp;ndash;3GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
| 2&amp;amp;ndash;4GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Pine64==&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;width: 100%;&amp;quot;-- Header --&amp;gt; &lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
!  colspan=&amp;quot;5&amp;quot; | Pine64&lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;width: 12%&amp;quot;|&lt;br /&gt;
&amp;lt;strong&amp;gt;Model&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Rock64 &lt;br /&gt;
| RockPro64 &lt;br /&gt;
| Pinebook &lt;br /&gt;
| Pinebook Pro &lt;br /&gt;
| PinePhone &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Release Year&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2017 &lt;br /&gt;
| 2017 &lt;br /&gt;
| 2017 &lt;br /&gt;
| 2019 &lt;br /&gt;
| 2019 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;SoC Manufacturer&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Rockchip &lt;br /&gt;
| Rockchip &lt;br /&gt;
| Allwinner &lt;br /&gt;
| Rockchip &lt;br /&gt;
| Allwinner &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Lithography&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 28nm &lt;br /&gt;
| 28nm &lt;br /&gt;
| 40nm &lt;br /&gt;
| 28nm &lt;br /&gt;
| 40nm &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| RK3328 &lt;br /&gt;
| RK3399 &lt;br /&gt;
| A64 &lt;br /&gt;
| RK3399 &lt;br /&gt;
| A64 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Topology&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;2 x Cortex-A72&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;2 x Cortex-A72&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Frequency&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 4 x 1.5GHz &lt;br /&gt;
| 2 x 2.0GHz&amp;lt;br&amp;gt;4 x 1.5GHz &lt;br /&gt;
| 4 x 1.152GHz &lt;br /&gt;
| 2 x 2.0GHz&amp;lt;br&amp;gt;4 x 1.5GHz &lt;br /&gt;
| 4 x 1.2GHz &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;GPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Mali-450 MP2 &lt;br /&gt;
| Mali-T860 MP4 &lt;br /&gt;
| Mali-400 MP2 &lt;br /&gt;
| Mali-T860 MP4 &lt;br /&gt;
| Mali-400 MP2 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Memory&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 1&amp;amp;ndash;4GB&amp;lt;br&amp;gt;LPDDR3&lt;br /&gt;
| 2&amp;amp;ndash;4GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
| 2GB&amp;lt;br&amp;gt;LPDDR3&lt;br /&gt;
| 4GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
| 2&amp;amp;ndash;3GB&amp;lt;br&amp;gt;LPDDR3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radxa==&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;width: 100%;&amp;quot;-- Header --&amp;gt; &lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
!  colspan=&amp;quot;1&amp;quot; | Radxa&lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;width: 12%&amp;quot;|&lt;br /&gt;
&amp;lt;strong&amp;gt;Model&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Rock Pi 4 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Release Year&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2019 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;SoC Manufacturer&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Rockchip &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Lithography&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 28nm &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| RK3399 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Topology&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Hexa-core:&amp;lt;br&amp;gt;2 x Cortex-A72&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Frequency&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2 x 2.0GHz&amp;lt;br&amp;gt;4 x 1.5GHz &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;GPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Mali-T860 MP4 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Memory&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 1&amp;amp;ndash;4GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Raspberry==&lt;br /&gt;
&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;width: 100%;&amp;quot;-- Header --&amp;gt; &lt;br /&gt;
! &amp;amp;nbsp;&lt;br /&gt;
!  colspan=&amp;quot;4&amp;quot; | Raspberry&lt;br /&gt;
|- &lt;br /&gt;
| style=&amp;quot;width: 12%&amp;quot;|&lt;br /&gt;
&amp;lt;strong&amp;gt;Model&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Pi 3B &lt;br /&gt;
| Pi 3B+ &lt;br /&gt;
| Pi 4B &lt;br /&gt;
| Pi 400 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Release Year&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 2016 &lt;br /&gt;
| 2018 &lt;br /&gt;
| 2019 &lt;br /&gt;
| 2020 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;SoC Manufacturer&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Broadcom &lt;br /&gt;
| Broadcom &lt;br /&gt;
| Broadcom &lt;br /&gt;
| Broadcom &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Lithography&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 28nm &lt;br /&gt;
| 28nm &lt;br /&gt;
| 28nm &lt;br /&gt;
| 28nm &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| BCM2837 &lt;br /&gt;
| BCM2837B0 &lt;br /&gt;
| BCM2711 &lt;br /&gt;
| BCM2711 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Topology&amp;lt;/strong&amp;gt;&lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A53 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A72 &lt;br /&gt;
| Quad-core:&amp;lt;br&amp;gt;4 x Cortex-A72 &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;CPU Frequency&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 4 x 1.2GHz &lt;br /&gt;
| 4 x 1.4GHz &lt;br /&gt;
| 4 x 1.5GHz &lt;br /&gt;
| 4 x 1.5GHz &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;GPU&amp;lt;/strong&amp;gt;&lt;br /&gt;
| VideoCore IV &lt;br /&gt;
| VideoCore IV &lt;br /&gt;
| VideoCore VI &lt;br /&gt;
| VideoCore VI &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;strong&amp;gt;Memory&amp;lt;/strong&amp;gt;&lt;br /&gt;
| 1GB&amp;lt;br&amp;gt;LPDDR2&lt;br /&gt;
| 1GB&amp;lt;br&amp;gt;LPDDR2&lt;br /&gt;
| 1&amp;amp;ndash;8GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
| 4GB&amp;lt;br&amp;gt;LPDDR4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Raspberry Pi===&lt;br /&gt;
&lt;br /&gt;
====Sensors====&lt;br /&gt;
&lt;br /&gt;
For temperature and humidity sensor see this tutorial on the forums: https://forum.manjaro.org/t/howto-raspberry-pi-temperature-and-humidity-sensor-dht22-dht11-am2302/34685&lt;br /&gt;
&lt;br /&gt;
====Overclocking====&lt;br /&gt;
&lt;br /&gt;
You can manage voltage and frequency settings in your &amp;lt;code&amp;gt;/boot/config.txt&amp;lt;/code&amp;gt;. The following are the most common values for the Raspberry Pi:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 over_voltage=6&lt;br /&gt;
 arm_freq=2100&lt;br /&gt;
 gpu_freq=650&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
&lt;br /&gt;
====Pi 400 Power Button====&lt;br /&gt;
&lt;br /&gt;
If you have trouble using the power button on your Pi 400 with the XFCE desktop (or xfce4-power-manager) then make sure logind is handling button events:&lt;br /&gt;
 xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-power-key -n -t bool -s true&lt;br /&gt;
&lt;br /&gt;
====Blocked Update====&lt;br /&gt;
&lt;br /&gt;
There are device-dependent workarounds if you experience an error similar to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: failed to prepare transaction (conflicting dependencies)&lt;br /&gt;
:: brcm-patchram-plus and pi-bluetooth are in conflict&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the '''Pi 3B''':&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl disable brcm43438.service&lt;br /&gt;
 sudo pacman -S -dd  brcm-patchram-plus-pi3b firmware-raspberrypi&lt;br /&gt;
 sudo systemctl enable attach-bluetooth-pi3.service&lt;br /&gt;
&lt;br /&gt;
For the '''Pi 3B+''':&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl disable brcm43438.service&lt;br /&gt;
 sudo pacman -S -dd  brcm-patchram-plus firmware-raspberrypi&lt;br /&gt;
 sudo systemctl enable attach-bluetooth.service&lt;br /&gt;
&lt;br /&gt;
For the '''Pi 4B''':&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl disable brcm43438.service&lt;br /&gt;
 sudo pacman -S -dd  brcm-patchram-plus firmware-raspberrypi&lt;br /&gt;
 sudo systemctl enable attach-bluetooth.service&lt;br /&gt;
&lt;br /&gt;
For the '''Pi 400''':&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl disable brcm43438.service&lt;br /&gt;
 sudo pacman -S -dd  brcm-patchram-plus-pi400 firmware-raspberrypi&lt;br /&gt;
 sudo systemctl enable attach-bluetooth-pi400.service&lt;br /&gt;
&lt;br /&gt;
====Missing Bluetooth after raspberrypi-bootloader/-x update 20210208-1====&lt;br /&gt;
&lt;br /&gt;
First, check whether the bootloader has been updated:&lt;br /&gt;
 pacman -Ss raspberrypi-bootloader&lt;br /&gt;
&lt;br /&gt;
Possible results:&lt;br /&gt;
 core/raspberrypi-bootloader '''20210208-1''' [installed]&lt;br /&gt;
    Bootloader files for Raspberry Pi&lt;br /&gt;
 core/raspberrypi-bootloader-x '''20210208-1''' [installed]&lt;br /&gt;
    Bootloader with extra codecs for Raspberry Pi&lt;br /&gt;
&lt;br /&gt;
If it is the case, changing the occurrences of '''ttyAMA0''' in /boot/cmdline.txt to '''serial0''' may fix missing Bluetooth ([https://forum.manjaro.org/t/new-raspberry-pi-kernels-related-packages/4721/344 Source]).&lt;br /&gt;
&lt;br /&gt;
=Android TV boxes=&lt;br /&gt;
&lt;br /&gt;
With a couple of small tweaks it is possible to boot and install the vim3 builds of Manjaro on some [[Amlogic TV boxes]]. Running Manjaro on TV boxes is not recommended for less experienced users of Linux nor serious production use.&lt;br /&gt;
&lt;br /&gt;
=Tips and Tricks=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
https://wiki.archlinux.org/index.php/Category:ARM_architecture&amp;lt;br /&amp;gt;&lt;br /&gt;
https://archlinuxarm.org/wiki&amp;lt;br /&amp;gt;&lt;br /&gt;
https://osdn.net/projects/manjaro-arm/&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents Page]]&lt;/div&gt;</summary>
		<author><name>Danboid</name></author>
	</entry>
</feed>