[Xiaomi Mi 8 Questions & Answers] najabi:
I have been studying Android audio configuration files and experimenting with HD players for some time and I can say the Mi 8 sound incredibly well with good headphones using the USB-c adaptor included.

The problem with Android Audio is that, in general, Android Mixer will upsample everything to 48 KHz and apply Qualcomm, Android and Miui effects, such as companding, Dinamic Compresssion, and also echo cancellation to voice signal. This is not bad in general, since phone speakers are not of good quality and there is benefit to dynamics and also voice telephony is better with echo and gain which are automatic. But there are many other sound libraries such as dirac, virtualizers that are loaded automatically and used by apps.

The problem is that generic apps like Spotify, Chrome, our Youtube will upsample 44.1 Khz videos and music to 48KHz with fast resamplers, and it shows in both the speaker and headphones. Specific Hi-Res players like PowerAmp or Neutron take advantage of some profiles in android audio configuration files to present audio directly to the mixer without resampling and using high-bitrate. In reality, it is not a special codec or driver, they just use some profiles that are in most recent android phones. I discovered this a while ago and can attest that the Mi 8 sounds fantastic with both PowerAmp and Neutron, when configured correctly. I like Neutron best for better control and customization. It has a toggle for automatic samplerate adjustment and you can check that the output is as source, and use 64-bit codecs with up to 32-bit processing. For example, a same mp3 sounds much better in Neutron/PowerAmp than played in Whatsapp or a generic audio player. Neutron also has a manual hardware preamp gain apart from master volume that is really useful to contain clipping and use the hardware full amplification. Custom kernels have headphone preamps too to optimise power.

I recommend Ainur Narsil mod, it is a twrp/magisk module that tweaks some build.prop audio settings, and it modifies android audio configuration files such as audio_policy.conf and audio_effects.conf to remove these effects and add more samplerates to generic profiles on android. I have taken the time to study these files myself and have discovered that Miui default config does not take full advantage of our Mi 8 Qualcomm Snapdragon audio chipset. Out Mi 8 is capable of dual-sampling playback, that is, it is compatible with 44.1Khz and 48Khz (and multiples) playback so we don't need Android to upsample everything to 48Khz as a generic phone does. Of course, the mixer will upsample to 48 Khz when other sounds kick in (like notifications), but when you use PowerAmp/Neutron with HD output, you can get as close as bitperfect playback, since I think this profiles are direct-pcm and don't get generic effects here. (android audio configuration files such as devices and mixers are complex but a wonder to understand :)

I have tested Narsil, and while I don't think it improves when listening to Neutron/PowerAmp, it should help with the speaker and apps since it removes a bunch of android and miui effects. I have tweaked a bit further these audio configuration files after Narsil yesterday, and I am happy that it works the way I want. I have checked in terminal audio mixer info that it plays 44.1Khz without upsampling in a generic player. Narsil does just that also too.

Notice that is not convenient to upsample 44.1 Khz content to 192KHz, it is best to play at native bitrate. Bitsample you can set to 24 or 32-bit playback, if your hardware supports it. Mi 8 supports 32-bit. But it will sound as good in 16-bit if the source file is 16-bit, altough mp3s can benefit in 24-bit.