Posts: 3,925
Joined: Sep 2013
Reputation:
365
Yeah, originally the code would get the No. of channels and then ask FFmpeg for a layout corresponding to that number. So if you had FL, FC, FR it would ask for a 3 channel layout and FFmpeg would give it FL, FR, LFE because that's the first 3 channel layout in its list. Obviously, that was wrong!
So now, it checks that the layout obtained includes at least the same channels as in the file. That's before any platform dependant stuff. So the code would refuse the FL, FR, LFE layout as there is no centre channel and get the next 3 channel layout, which is FL, FC, FR - correct!
Once we get to the platform dependant stuff, Kodi asks the audio driver for a matching layout. If we get one, great. If not, it asks for a layout that includes at least the channels we want. This can mean that if we want FL, FC, FR but the audio driver doesn't support that, we could end up with a full 5.1 layout but Kodi will output silence on the extra channels. The upshot of all this is that what you hear should always come out of the correct channels, but your AVR may well show a different channel layout to what you were expecting to see. This is 100% down to the audio driver that is installed, and so will vary between platforms (and most likely motherboards too).
Learning Linux the hard way !!
Posts: 123
Joined: Oct 2011
Reputation:
0
Bit of an old thread, but still.
I would like to know what Kodi does with simple stereo (like from a ripped cd). That's not HD audio, of course. Hence, can it still be parsed as simply passthrough, thru HDMI?
Posts: 287
Joined: Dec 2012
Reputation:
8
Krobar
Senior Member
Posts: 287
Yes, it just passes a CD in its original 16/44 PCM format over HDMI (This format is pretty much universally supported by HDMI). You can fix the sampling rate to something higher using the audio settings but it does not really change the quality.
Posts: 10,679
Joined: Oct 2011
Reputation:
657
jjd-uk
Team-Kodi Member
Posts: 10,679
2022-05-23, 10:50
(This post was last modified: 2022-05-23, 10:51 by jjd-uk.)
The first thing to understand is that digital audio in it's rawest form is always PCM.
You then have 2 types of containers for storing the PCM data.
Simply compression formats such as mp3, flac, ape, aac etc. These formats are storage formats and when played back the PCM data is unpacked and sent by Kodi as PCM.
Encoded formats that re-encode the PCM audio for greater compression, it is these are generally meant when passthrough is talked about, as this include the variuos form of Dolby & DTS formats. With these Kodi can do the decoding and send as PCM, or passthrough for decoding from DD/DTS to PCM on the soundbar/AVR.
So when it comes to CD rips, it all depends what format you rip to, but generally this will one of the simple storage formats which produces PCM when played by Kodi, so passthrough does not applied. The properties of the PCM audio sent by Kodi, in terms of things like sample rate, will depend on the audio capabilities of the device you are running Kodi on.
Posts: 287
Joined: Dec 2012
Reputation:
8
Krobar
Senior Member
Posts: 287
At least for Windows if you are using WASAPI and have the volume at 100 then it does do bit perfect PCM output (Both DTS CD and Auro Native work with it). Nvidia Shield and some other Android devices do not deliver bit perfect PCM.
Posts: 2
Joined: Nov 2022
Reputation:
0
Saludos y gracias. Uso xiaomi mi box s, con kodi y un equipo de audio Harman kardon. Reproduzco pelicula en Vlc y la pantalla del equipo de audio me indica, dolby digital, la reproduzco con kodi y no me dice lo mismo, con vlc tambien me indica Dts, dependiendo de la pelicula. Activado el traspaso en kodi,no sé si hay alguna otra configuración. Usaba Kodi Leia y no tenia ese problema, pero hace poco de actualizo a Matrix y ahí empezó el calvario.