The last Oreo firmware, which still had the Sound -> Sound Output -> Always option to force AC3/DTS passthrough via SPDIF was 2175. Since then the options are PCM and Auto. When using Auto via SPDIF, DTS/AC3 is not properly passed through, so you hear no sound in Plex, Kodi, MrMC, etc. Apparently it works via HDMI and a newer receiver, which I have not tested and it is not my case.
Here is how I fixed the issue and the fix persists after restarting the Mi box. Afterwards, you should not change the Sound Output options in the Settings or reset to defaults as this will undo the fix. If you have done it, you have to repeat the steps.
First you need to connect a laptop to your Mi Box via USB cable and enable USB debug in Developers options. Install Xiaomi ADB USB drivers on the laptop first. Then in command prompt type:
adb devices
You should see your Mibox device listed here. To make future changes easier enable adb over wifi enter:
adb kill-server
adb tcpip 5555
Disconnect the USB cable and from a PC on the same network with the platform tools installed enter:
adb connect <Mi box IP>:5555
adb devices, now should show you the connected Mi box. Note, that you can run the commands below while using the USB cable connection as well. The WiFi ADB connection is just to make future changes easy. It took me an hour to find A to A USB cable at home :)
The fix is to change the settings in the global table to force passthrough over SPDIF.
adb shell settings put global digital_sound 1
adb shell settings put global encoded_surround_output 2
This should set the passthrough settings to Always. This will not work for DD+, but works for DTS/AC3. I have converted my DD+ files to AC3.
More technical details about the encoded_surround_output parameter:
encoded_surround_output=0 (AUTO)
* The surround sound formats AC3, DTS or IEC61937 are
* available for use if they are detected.
* This is the default mode.
* Note that AUTO is equivalent to ALWAYS for Android TVs and other
* devices that have an S/PDIF output. This is because S/PDIF
* is unidirectional and the TV cannot know if a decoder is
* connected. So it assumes they are always available.
encoded_surround_output=1 (PCM)
* AC3, DTS or IEC61937 are NEVER available, even if they
* are detected by the hardware. Those formats will not be
* reported.
* An example use case would be an AVR reports that it is capable of
* surround sound decoding but is broken. If NEVER is chosen
* then apps must use PCM output instead of encoded output.
encoded_surround_output=2 (ALWAYS)
* AC3, DTS or IEC61937 are ALWAYS available, even if they
* are not detected by the hardware. Those formats will be
* reported as part of the HDMI output capability. Applications
* are then free to use either PCM or encoded output.
* An example use case would be a when TV was connected over
* TOS-link to an AVR. But the TV could not see it because TOS-link
* is unidirectional.
Let's hope Xiaomi will add the option back, meanwhile this is a working workaround. Hopefully it was a helpful post.