Xiaomi Box S 3rd Gen as a Dual-boot CE Box

Sorry, haven’t been following closely. Should I put a note in post #1 that installing CE may not longer be possible w/newer firmware? If so, wondering if it’s possible to stop firmware update when first setting up new box, installing CE, and blocking OTA updates via adb.

1 Like

it is actually the same android version in my case. but nevertheless, to no avail.

One device is on the way to dev and will see how it went.

1 Like

You also need to make sure that it is an original device Xiaomi TV Box S (3rd Gen) and not a counterfeit.
The packaging, device, and remote almost completely replicate the original.
For a 100% check, it’s enough to run AIDA64.
Currently, a popular counterfeit uses the Allwinner H313/H616 processor (at 1512 MHz) and a Mali-31 GPU.

1 Like

Fortunately, the box I have is an original one. And after some trial and error, I even got all the formats and the automatic refresh rate switching working (apparently some HDMI cables were incompatible with certain HDMI ports on my receiver). Actually, all that’s missing is Atmos (which is converted to PCM in Kodi), and then I could almost manage without CoreELEC for now.

On the original Xiaomi Android TV, Atmos via Dolby Digital works fine :slight_smile:
And on the latest Xiaomi firmware, UKG3.250826.001.V816.0.7.0.UZFAABX
Atmos via TrueHD also works reliably.

1 Like

i updated just now to the newer android version and now all passthrough in kodi is botched.

1 Like

I did got my box and I updated Android also to this firmware.
First it did not work to setup CE, this is how I got it working and boot CE again:

Pre-setup when clean, fresh CE boot media:

  • Connect Android to Network
  • Enable ADB USB debugging
  • adb connect <your_device_ip:5555>
  • Allow ADB connection on Android screen
  • copy s7d_s905x5m_xiaomi_3rd_gen.dtb to dtb.img on COREELEC partition

Then do (start here if CE boot media already does exist):

  • make a backup copy of recovery.img on COREELEC partition
  • copy and rename kernel.img to recovery.img
  • Boot Android with CE plugged in USB
  • adb reboot update

After first boot into CE the wizzard will come up.
Finish it and connect to network and enable SSH.
This wizzard is only temporary, so all settings are lost afterwards.

Connect by SSH to CE and run:

fw_setenv bootfromnand 0
fw_setenv upgrade_step 2
fw_setenv ce_on_emmc "no"
fw_setenv cfgload_env 'if fatload ${device} 0:1 ${loadaddr} cfgload_env; then env import -t ${loadaddr} ${filesize}; run ceboot; fi'
fw_setenv cfgloadsd 'if fatload mmc 0:1 ${loadaddr} cfgload; then setenv device mmc; setenv devnr 0; setenv partnr 1; source ${loadaddr}; autoscr ${loadaddr}; run cfgload_env; fi'
fw_setenv cfgloadusb 'if fatload usb 0:1 ${loadaddr} cfgload; then setenv device usb; setenv devnr 0; setenv partnr 1; source ${loadaddr}; autoscr ${loadaddr}; run cfgload_env; fi'
fw_setenv cfgloademmc 'for p in 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F; do if fatload mmc 1:${p} ${loadaddr} cfgload; then setenv device mmc; setenv devnr 1; setenv partnr ${p}; setenv ce_on_emmc "yes"; source ${loadaddr}; autoscr ${loadaddr}; fi; done;'
fw_setenv bootfromsd 'if mmcinfo; then run cfgloadsd; fi'
fw_setenv bootfromusb 'usb start; if usb storage; then run cfgloadusb; fi'
fw_setenv bootfromemmc 'run cfgloademmc'
fw_setenv bootcmd 'if test ${bootfromnand} = 1; then setenv bootfromnand 0; saveenv; else run bootfromsd; run bootfromusb; run bootfromemmc; fi; run storeboot'

Then reboot and CE should come up again and wizzard start again.
Finish the wizzard and use CE as usual.
Remove the copied recovery.img and restore the backup of the file.

My device is bricked now because of testing and will go back to Amazon :frowning: .

EDIT: maybe a modified kernel.img is need when it does not work with default one.

2 Likes

Did anyone tried to boot this device with 22.0-Piers_alpha3 build? Or only nightly build was tried?

i only tried nightlies and your images.

So maybe, the advice could be not to try what you have shared, when it is not clear what has caused the brick?

My Xiaomi Box S 3rd Gen has sat in a drawer since last November. So I dug it out updated Android to the latest version (UKG3.250826.001.V816.0.7.0.UZFAABX), updated CoreELEC NO to the latest nightly.

The box still boots fine. Playback still works fine. However wifi and bluetooth no longer work, they never worked reliably anyway so no loss there. It also still has the GUI tearing issue so back in the drawer it goes.

I’ve picked this up over the BH weekend. Thought I’d have a go. Three hours after starting the build it’s still running!!!

CoreElec needs some SERIOUS build space :smiley:

How to fix BT and WiFi

Send a PR

Or buy a supported box

welp, i tried this with the latest android update and it no longer works, as Portisch says.
but i wont paste random fw env in the terminal right now :smiley: i can wait
thank you devs for working on this

Unfortunately, despite all the methods you’ve suggested, the Mi Box won’t boot into CE. Good luck.

Well, with the latest Android firmware, the Kodi android version actually works pretty well from my perspective. With that said the Android Wifi is still a slow starter - it roughly takes another 4-5 minutes to get the connection running. But, when it starts the connection is steady and fast.

However, the worst part now is the sound not matching the video. There’s clearly a lipsync issue, and the offset is randomly between 400-1000 ms. Is this a Kodi thing, or is it a box thing, like drivers or…? I’m only experiencing this in Kodi. Every other app, like Youtube does not have the same lipsync issues.

I haven’t been able to play any movies in Coreelec on this box since an update between release 2 and 3. The videos - all of them - simply boots the TV box when they start to play. Nothing in the debug logs. Before the fatal CE update there was no lipsync issues. But a lot of wifi and crashing issues when playing media. CE was useless before and useless - obviously - after the update.
However I’m satisfied with any Kodi version/edition, as long as i plays my media steady, with the highest quality in both picture and sound.

Btw, I also have an XBMC Vero V box, which I’m using for reference… The media plays perfectly on this, but it’s lacks in Debian OS and Python being old, so many Kodi based add-ins dosen’t work anymore.

Do you have RAW selected (or tried), in stead of IEC? IEC is known to give audio sync issues with these kind of devices. RAW should give you sync but it mostly doesn’t like when one uses skipping during replay.

1 Like

Yeah, good suggestion - The RAW output works.
Other than the wifi connection issues on startup, the box actually works pretty well with Kodi on the stock Android version.
Thanks p750mmx

1 Like