ippon - I answered your post in the main 509/509X thread. I'm not sure why you have the issue in Kodi 17 and not in Kodi 16. Either way, you are using the S/PDIF interface whereas I am using HDMI, so results will be somewhat different. S/PDIF carries only two channels so is limited to PCM stereo or compressed Dolby/DTS multichannel. That said, it should accept all bitrates up to 192kHz and there shouldn't be any re-sampling going on. You mentioned DLNA in your posts also. That could be confusing the issue also. Have you tried playing the files directly from the box (on a USB stick or SD card)? My situation is that I play FLAC compressed files from a network server over SMB or NFS. No DLNA used.
fat-tony - I try to answer your points:
- the upsampling happens in both versions (Kodi17 and Kodi16). It was fixed in one Libreelec version (009) and this was a Kodi16.
- Yes, in fact S/PDIF makes the different. I played a bit around with my boxes today and found that the upsampling happens only on S/PDIF. The output via HDMI has the correct bitrates. Also the dmesg output from Libreelec shows the correct sampling rates (in all Libreelec/Kodi versions). This means 44.1 stereo PCM is played correct via HDMI but it is upsampled to 48k via S/PDIF. I didn’t realize this before, because my Rotel reciever has no HDMI. I had to use a different receiver for testing.
- I need the S/PDIF only for PCM stereo and for 5.1 passthrough. So the limitation that S/PDIF can’t transport 5.1 PCM is not a problem for me.
- Yes DLNA is confusing, sorry. You can ignore this. The S/PDIF upsampling happens independent from the music source (I tried also USB stick, SMB, local file system). And it happens independent if the file format (I tried MP3, Flac, WAV).
As result of your feedback and of my testing today, I meanwhile think that this upsampling has nothing to do with Kodi version or with the librelec implementation (especially because the dmesg shows the correct values and because of the correct bitrates via HDMI). I think it has something to do with the S/PDIF part of the Amlogig audio driver. Also Kszaq wrote that this Amlogig driver if very messy, but that's Kwiboo is working on it. I hope that he can (re-)introduce a fix for this S/PDIF section.