Xiaomi Mi Box 3 (xiaomi-once)

From postmarketOS
Jump to navigation Jump to search
Xiaomi Mi Box 3
Running XFCE4
Running XFCE4
Manufacturer Xiaomi
Name Mi Box 3
Codename xiaomi-once
Released 20XX
Category testing
Original software Android TV
Original version 6.0.1
Extended version 9
Hardware
Chipset Amlogic S905X-H
CPU Quad-core 1.5 GHz Cortex-A53
GPU Mali-450 MP3
Display HDMI
Storage 4/8 GB
Memory 1/2 GB
Architecture aarch64
Features
USB Networking
Flashing
Broken
Touchscreen
Unavailable
Display
Works
WiFi
Works
FDE
Mainline
Works
Battery
Unavailable
3D Acceleration
Works
Audio
Partial
Bluetooth
Works
Camera
Unavailable
GPS
Unavailable
Mobile data
Unavailable
SMS
Unavailable
Calls
Unavailable
USB OTG
NFC
Unavailable
Sensors
Accelerometer
Unavailable
Magnetometer
Unavailable
Ambient Light
Unavailable
Proximity
Unavailable
Hall Effect
Unavailable
Barometer
Unavailable
Power Sensor
Misc
Camera Flash
Keyboard
Unavailable
Touchpad
Unavailable
USB-A
Unavailable
HDMI/DP
Ir TX
Ir RX
Stylus
Haptics
Ethernet
FOSS bootloader
Works



Note This port is only tested on the mda-16-ab variant. If you get it working on the mda-16-aa variant then please let us know. Thanks!

There are 2 variants:

  • Mi Box 3/mda-16-ab, running Android TV and sold everywhere else.
  • Mi Box 3C/mda-16-aa, running MIUI TV and sold in China. Seems to only have 4GB of storage and 1GB of RAM.

Some people succeeded at flashing the mda-16-ab firmware to an mda-16-aa set-top box though.

Note that these instructions are only expected to work on the mda-16-ab variant.

Note about the stock u-boot

If running Android 8/7/6

It can be intercepted when it is booting.

It will load either aml_autoscript (more info) or recovery.img (android recovery mode image), both at the root of a USB stick, the latter being booted when Android TV and the recovery mode aren't bootable.

If running Android 9

You're out of luck! You need to downgrade to Android 8.

Installation

Icon WARNING: DO NOT PLUG multiple USB devices to the TV box when it boots. DO NOT PLUG USB drives that had pmOS installed to the TV box when it boots into Android because Android will destroy file permissions!

Before doing everything here, please follow the instructions in #Downgrading from Android 9 to Android 8.

Only installing to a USB drive works currently.

Use pmbootstrap to build your own image, like so:

$ pmbootstrap init
$ pmbootstrap install --sdcard=/dev/sdX # change 'sdX' with the path of your USB drive

After you created the image, connect the UART to your Mi Box.

Next, intercept U-Boot when it's booting. You should get a shell.

Note U-Boot will run commands that are saved in the bootcmd environment variable. By default bootcmd contains commands to load Android TV.

Run these commands to modify the default boot behavior and reboot:

once# setenv bootandroid ${bootcmd}
once# setenv bootcmd "usb start;ext4load usb 0:1 ${loadaddr} aml_autoscript;autoscr ${loadaddr}"
once# saveenv
once# reset

Downgrading from Android 9 to Android 8

Icon WARNING: THIS WILL ERASE ALL DATA ON YOUR MI BOX. CONSIDER YOURSELF WARNED.

There's a guide for downgrading from Android 9 to 8: https://forum.xda-developers.com/t/mi-box-3-mdz-16-ab-downgrade-android-9-pie-to-android-8-oreo.4194075/

If that guide doesn't work, try this:

  1. Plug a USB drive into your computer and format it as FAT32
  2. Download https://mega.nz/file/gh0xCCrR#ctdPivezVFNAuMLq19eOepO1LHJCfVNhowmZz7Fx87s
  3. Extract update.zip and xiaomi_update from the zip file, as well as recovery.img from update.zip and put them at the root of your USB drive
  4. Power your Mi Box on and boot it into the recovery mode
  5. Plug your USB drive to it
  6. 'Apply update from EXT' > 'From Udisk' > update.zip (note: "Udisk" is a translation error in the recovery)
  7. Flash and reboot! Your Mi Box should reboot a few times. You should see a progress bar after that. (It only flashed U-Boot, and Android 9 isn't bootable from it, and thus it loads recovery.img from the USB drive, which runs xiaomi_update)
  8. After that, it's going to boot into Android 8, which will fail. It's then going to boot into recovery mode and you should see the following error message: "Cannot load Android system. Your data may be corrupt. If you continue to get this message, you may need to perform a factory data reset and erase all user data stored on this device."
  9. 'Factory data reset' > 'Yes'
  10. Then it should reboot automatically by itself
  11. Done!

Recover back to the default booting behavior

Run these commands:

once# setenv bootcmd ${bootandroid}
once# setenv bootandroid 
once# saveenv

Unlock the bootlocker

This device has a locked bootloader that can only signed boot image supposedly.However exkc find out it can chainboot a unlocked bootloader from the locked bootloader.There are some work on unlocking the android 6 bootloader which allow you to boot unsigned boot image directly from the stock bootloader.

Maintainer

Users owning this device

See also