For Sonic performance I would advice only running Stock OS, unless the developers figured out a way to use the Internal Audio HW in the phone, the only few phones that I know which were able to utilize were - SGS i9000 the first Samsung Galaxy S, I still have it, it has a Wolfson WM8994 DAC AMP and the Supercurio xda dev unlocked its potential with his Voodoo Sound Control (HW EQ, AMP control, Bypass all audio through DAC, Analog Volume control etc). It's a solid phone, mine uses an SD card of 200GB with ease, It's running a very old Custom ROM, I wanted it to flash to KitKat since it's faster, unfortunately I have some memories with the OS and Phone so I didn't fiddle.
Then there's SGS II with Yamaha "Yamahell" DAC which was garbage due to it's AMP vs Wolfson, still it got some dev help, Supercurio again. With SGSIII Gokanmoral implemented some Audio functionality into the Kernels like SGS and SGS II, it also has a Wolfson.
Rest is history, I didn't see any phone later on from Samsung using a solid DAC/AMP Hardware. SGS 5 had solid HW but it cannot touch these old ones, I forgot to mention Samsung Galaxy Nexus, it also has the Audio enhancement by Ezekeel developer with High Performance Audio (not superior to SGS) on the OMAP 4400 SoC processor. then we had LG, I had my only experience with LG with their V30, was even able to understand to fundamentals on how their Automatic DAC Headphone AMP works and has no audible advantage when people use those Adapters since it only increases the Headphone output voltage resulting in high distortion and may break the Transducers for those IEMs only IEM which can handle from my knowledge would be the Final Audio E5000. LG did an excellent job on the Auto Impedance detection in the phone itself. Simply superb solution, not breaking IEMs or blowing Ears with that fantastic distortion free superb ESS implementation not only on Audio Playback but even Recording in app and
Video recording too !!
And that phone with Custom ROM cannot use all the HW DAC features of the ESS 9218P chip. Like Impulse response filters, DSP like DTS X and EQ plus others. So avoid using Custom ROMs on the Audio dedicated phones, I don't think anyone can unlock ESS Software functionality exposed to end user on these phones.
TL;DR - Stock + UAPP is endgame.
That said, LG phone or whatever DAP type phone you have, use Android 9 as long as you can. Android 10 brings bs
Scoped Storage trash which ruins the whole
fundamental aspect of Android filesystem control by end users+devs and
performance regressions. I'm running stock Android 8 ROM but Bootloader Unlocked with TWRP on my V30S since Day 1 and was happy and still happy for 2.5years. If your G8X has a Bootloader unlock (I think it should have since It will be EU/Asia version LG screwed up the damn Bootloader unlocks when their mobile business CEOs changed) enjoy the Superuser access. It's going to die soon, Android 11 and 12 have even more bs problems with UX and they have horrible API regressions, I lost count at this point. Everything has to be downgraded and catered to the lowest possible denominator because money is the only damn thing that matters, Google is lost in their vision and execution all they care is now politics and controlling users, just like Apple. Sorry for the OT, I'm just disappointed by these stupid trends. I forgot to mention without any OS updates you won't lose any functionality since Android is designed to work with Backcompat and have solid API support Google is forced to do that, which is why most of the apps on PlayStore work with 4.4 too until recently it's 5.0 Lollipop. Fearmongering of the Security updates is a lost cause, look at latest Qcomm exploit, it will happen and can be hacked. But the key part is you must know what you are running, have been running Rooted/Custom kernel/ROMs since Android 2.2 Froyo.
I don't care about these trends now, moved onto a Desktop setup and use my iPod with Wolfson 87588G which is superior to many devices, only one which can beat that is my LG's ESS which has surprisingly excellent Sub Bass reproduction and crystal clear mind range performance from my experience. That Qcomm Aqstic on Note 8 SD835 which I heard was utter garbage. Hollow sounding generic waste, I doubt Qcomm has any focus on them, they are selling those AptX and AptXHD and their Qcomm TWS solutions on Wireless, so that generic one will stay even on SD888, that's my guess. A shame that Sony is now making all those damn videos on everything including Sound but couldn't put their own in house superior S-Master HX DAC AMP in the Xperia 1 Mark III, all that audio talk is waste, since it's using Aqstic and a bunch of software DSPs like 360Reality Audio DSEE upscaler and others which are absolutely nothing compared to even my 14year old iPod running Rockbox with Parametric EQ.