Xiaomi Mi Box 3 (xiaomi-once)
| pmOS can't run on its internal storage.However, it's possible to boot pmOS from USB Stick. |
| This device is supported as part of a generic port. Refer to Amlogic Generic TV Box (amlogic-tvbox) for installation instructions and more information. |
|
Running XFCE4 | |
| Manufacturer | Xiaomi |
|---|---|
| Name | Mi Box 3 |
| Codename | xiaomi-once |
| Released | 20XX |
| Type | set-top box |
| 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 |
| Software | |
Original software The software and version the device was shipped with. |
Android (TV) 6.0.1 |
Extended version The most recent supported version from the manufacturer. |
Android (TV) 9 |
| Optional software | MIUI TV |
| FOSS bootloader | yes |
| postmarketOS | |
| Category | testing |
Mainline Instead of a Linux kernel fork, it is possible to run (Close to) Mainline. |
yes |
| Generic port | Amlogic Generic TV Box (amlogic-tvbox) |
| Device package |
device-amlogic-tvbox out-of-tree |
| Kernel package |
|
Flashing Whether it is possible to flash the device with pmbootstrap flasher. |
Broken
|
|---|---|
USB Networking After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system). |
Untested
|
Screen Whether the display works; ideally with sleep mode and brightness control. |
Works
|
| Multimedia | |
3D Acceleration |
Works
|
Audio Audio playback, microphone, headset and buttons. |
Partial
|
IR TX |
Works
|
| Connectivity | |
WiFi |
Works
|
Bluetooth |
Works
|
| Miscellaneous | |
FDE Full disk encryption and unlocking with unl0kr. |
Untested
|
USB OTG USB On-The-Go or USB-C Role switching. |
Untested
|
HDMI/DP Video and audio output with HDMI or DisplayPort. |
Partial
|
| Sensors | |
Power Sensor Sensor to monitor current, voltage and power. Not fuel gauge! |
Untested
|
This port is only tested on the mdz-16-ab variant. If you get it working on the mdz-16-aa variant then please let us know. Thanks! |
This port has been dropped from postmarketOS repos. It may be re-added at a later time if someone steps up. In the meantime, use the generic Amlogic reference board port.
There are 2 variants:
- Mi Box 3/
mdz-16-ab, running Android TV and sold everywhere else, this one can be intercepted on boot using a UART adapter if it is running android 8. - Mi Box 3C/
mdz-16-aa, running MIUI TV and sold in China. Seems to only have 4GB of storage and 1GB of RAM, this one might be able to be intercepted on boot, although with limited success.
Some people succeeded at flashing the mdz-16-ab firmware to an mdz-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 can not intercept the Mi Box while booting.
In order to install postmarketOS on a Mi Box currently running android 9, follow the guide for #Downgrading from Android 9 to Android 8.
Installation
| WARNING: DO NOT PLUG multiple USB stick to the TV box when it boots.If you do have multiple USB stick plugged in during boot, please make sure the usb 0 in u boot is the pm os usb stick. |
| WARNING: DO NOT PLUG USB drives that had pmOS installed to the TV box when it boots into Android because Android will destroy file permissions! |
| A UART-to-TTY adapter is required to intercept U-Boot, alternative methods have not been worked out yet. |
This guide requires pmbootstrap, you will need a device running a linux operating system to use it. (see pmbootstrap/Installation) |
Before doing everything here, please follow the instructions in #Downgrading from Android 9 to Android 8 if your Mi Box is currently running Android 9.
Only installing to a USB drive works currently.
Follow instructions in Amlogic Generic AArch64 TV Box (amlogic-aarch64-tvbox) to put pmOS on a USB stick, select device "p241".
plasma-desktop (among other Wayland-based desktops) will most likely never work with the Mi Box, XFCE4 is recommended. |
After you created the image, connect the UART and USB to your Mi Box (refer to the image on the right of the page, note that a shared ground connection may be required, which can be achieved by connecting ground to the metal heat shield).

Next, intercept U-Boot when it's booting using your UART adapter, you should get a shell.
U-Boot will run commands that are saved in the bootcmd environment variable. By default bootcmd contains commands to load Android TV. |
Run the following commands to modify the default boot behavior for making pmOS automatically boot when it powered on and a pm os usb stick is pluged in:
once# setenv bootandroid "${bootcmd}"
once# setenv bootcmd "usb start;ext4load usb 0:1 ${loadaddr} aml_autoscript;autoscr ${loadaddr};run bootandroid"
once# saveenv
Run those command to reboot after you have modified the default boot behavior
once# reset
You can still boot into android by unplugging the pmOS usb stick after you have modify the default boot behavior, you should NEVER have your USB drive plugged into the Mi Box if you're booting android as this destroys file permissions, you should also refrain from updating to Android 9 as this may stop you from intercepting boot.
You can manually boot pmOS if you dont want to modify the default boot behavior.
Run these commands to boot pmOS:
once# usb start
once# ext4load usb 0:1 ${loadaddr} aml_autoscript
once# autoscr ${loadaddr}
Downgrading from Android 9 to Android 8
| WARNING: THIS WILL ERASE ALL DATA ON YOUR MI BOX. CONSIDER YOURSELF WARNED. |
| WARNING: DO NOT PLUG USB DRIVE BEFORE RECOVERY MODE IS ON IN STEP 3 |
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:
| WARNING: DO NOT unplug the Mi Box from it's power connector or the USB drive until the update is complete, otherwise you may brick your device. |
- Plug a USB drive into your computer and format it as FAT32
- Download via BitTorrent or MEGA
- Extract
update.zipandxiaomi_updatefrom the zip file, as well asrecovery.imgfromupdate.zipand put them at the root of your USB drive - Power your Mi Box on and boot it into the recovery mode
- Plug your USB drive to it
- 'Apply update from EXT' > 'From Udisk' >
update.zip(note: "Udisk" is a translation error in the recovery) - 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.imgfrom the USB drive, which runsxiaomi_update) - 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."
- 'Factory data reset' > 'Yes'
- Then it should reboot automatically by itself
- Done!
Recover back to the default booting behavior
Run these commands:
once# setenv bootcmd ${bootandroid}
once# setenv bootandroid
once# saveenv
Recovery
The following instructions would show a wobble circle with a progress bar.
| WARNING: This might cause your device to be in a state of endless bootloop |
Boot into recovery mode
- Unplug power from Mi Box 3
- Remove batteries from remote control
- Press and hold middle select button + back button on the remote
- While holding select+back, put batteries back in remote
- Reconnect power to the Mi Box 3
- Hold the remote close to the Mi Box 3 and wait for recovery screen
Source: https://l.opnxng.com/r/AndroidTV/comments/g3mw3s/xiaomi_mi_box_3_reboot_into_recovery_mode
Unlocking the bootlocker
This device has a locked bootloader (It seems only mda-16-ab have this kind of bootloader) and thus, can only run Xiaomi signed images.
exkc found out the Mi Box can chainboot an unlocked bootloader from the locked bootloader via "multiboot" mode. There has been some work on unlocking the android 6 bootloader which could allow you to boot an unsigned boot image directly from the stock bootloader, however this work has not been made publicly available.
Maintainer
Users owning this device
See also
- pmaports!3955 initial PR
- stock rom download
- UART
- What different between Mi box 4(china variant)、4c(china variant)、3s(china variant)、3c(china variant)、3 enhanced(china variant) (Simplify Chinese)
- How to flash mda-19-ab's os on mda-19-aa? (Cantonese with Mandarin subtitles)
- Locations of UART connection points
- unlock bootloader