upsampling 44.1kHz music to 48kHz

  • I had some time for playing around with my libreelec boxes this weekend and tested the Audio again. I'm running version 7.0.2.009 (my last test was with version 007). The problem is fixed!! Now my music is played perfectly with 44.1k over the SPDIF interface.

    Thanks again to kszaq for his work.

  • I agree. Version 9 was also good for me. Audio quality on S905 box was similar to S805 box. There was a little problem with random audio pops & clics, but the quality was great.
    But I think that with the new version 10, audio is getting worse. Pops & clics are gone, but the audio quality is worse. Not as worse as before version 9, but a little worse than version 9. I think kszaq has reverted some changes that were great for audio quality. Thanks anyway.


  • felixob Changes that improved audio had to be reverted because clicks and pops. I think Kwiboo is still working on improving audio for S905 devices: sound/soc/aml/m8: work-in-progress by Kwiboo · Pull Request #23 · LibreELEC/linux-amlogic · GitHub

    When the PR is considered final and I am able to confirm that there are no issues with clicks/pops etc., I will merge the changes back.

    I checked 8.0.1b.
    44.1 is converted to 48k and sound is worse then in 7.0.2.009 :(.

    Edited once, last by ippon (March 27, 2017 at 10:39 PM).

  • 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.


  • 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.