LibreELEC and Hi-Res audio files / digital optical passthrough

I have a question regarding LibreELEC, I have searched and read informations about this aspect but it's still unclear for me. I'm sorry if this subject was discussed in another topic, I didn't found it ...

If I buy an Android TV Box which supports LibreELEC installation, it is possible to passthrough high resolution audio files over digital audio (optical or coaxial) output? Can the device, with LibreELEC, output bit-perfect 16-bit/44.1KHz, 24-bit/88.2KHz, 24-bit/96KHz and 24-bit/192KHz audio files (FLAC and WAV), without resampling?

I have a pretty large hi-res audio library and it's very important for me to be sure this is possible as I have an external standalone DAC who handles the audio conversion.

Kodi supports rates up to 384KHz but that requires specialist DAC hardware and most devices will stick to the official S/PDIF specification limits that stop at 24/192Khz. It is hardware dependent, but I would be surprised if Android box hardware didn't support them. The alsa drivers in the Amlogic kernel could be an entirely different issue, but the hardware itself should be fine

In this topic someone was saying he managed to output (with LibreELEC) 44.1KHz up to 384KHz but using the USB output. I need to do this (up to 24-bit/192KHz) over digital optical output. And he doesn't mention anything about bit depth, so it's pretty unclear to me.

LibreELEC (Krypton) 8.2.0 changelog says "Fix Kodi to support 352KHz and 384KHz audio over S/PDIF" but I assume this is for USB output, as digital optical is limited to 192KHz. It's unclear for me what is the situation when using digital optical (or coaxial) output ...

I have read an user report saying even the most recent Kodi version is upsampling FLAC 16-bit/44.1KHz > 16-bit/48KHz and downsampling 24-bit/96KHz > 16-bit/96KHz and 24-bit/192KHz > 16-bit/192KHz.

I think that some or all of this statement is wrong.

Whenever I play content from 44.1kHz sampled sources it is played out a 44.1k. When I play from a 48k source it is played out at 48k. In my case I use the music player in Kodi to play DTS streams ripped from DTS CDs (44.1) and from DTS soundtracks ripped from DVDs (48k) and both are decoded by my AV receiver accurately. It can only play these if they are bit-perfect. They would not be if there was any sample-rate conversion taking place (you'd just get noise, the same as if you play them with Kodi's volume set to anything other than 100%)

Editing my post - For clarification, I am using PC hardware. I suppose some other devices might have restricted hardware and drivers that include sample rate conversion? I have no idea about that.

For clarification, I am using PC hardware. I suppose some other devices might have restricted hardware and drivers that include sample rate conversion? I have no idea about that.

That's why you don't have any issues. As I said in my opening post, I was talking about LibreELEC running on Android TV boxes. As far as I know, Android OS is resampling everything at 16-bit/48KHz but LibreELEC for Android TV boxes is running on a different Linux based OS, not Android.

The only problem is 24-bit/192KHz audio files aren't played, no sound at all over S/PDIF digital optical output. I don't know why, I don't know if it's hardware or software related. As far as I know TOSLINK is capable to output up to 24-bit/192KHz. I'm still looking to identify the problem ...

The only problem is 24-bit/192KHz audio files aren't played, no sound at all over S/PDIF digital optical output. I don't know why, I don't know if it's hardware or software related. As far as I know TOSLINK is capable to output up to 24-bit/192KHz. I'm still looking to identify the problem ...

Solved. Now I have audio streaming over optical digital out up to 24-bit/192KHz.

It seems that audio capabilities are software limited because of the presence of analog audio chip in Minix Neo U1 and the way of how kernel driver is implemented.

Running LibreELEC from microSD card, I replaced the U1 device tree (dtb.img) gxbb_p200_2G_minix_neo_u1.dtb with this generic version gxbb_p200_2G_1Gbit_OTG_Port.dtb which bypasses the analog audio chip and omits analog audio in output path.

As a result, I lost analog audio on Minix Neo U1 (mic input and headphones output are not working anymore) but I have full capabilities over optical digital (TOSlink) output.

And with the new device tree RTC (Real Time Clock) is not working also.

It's important to mention this workaround worked for my Minix Neo U1, I don't know for other boxes. And another thing is other boxes with the same Amlogic S905 don't have this problem:[8.0.2e] LibreELEC 8.0 for S905/S905X