2017-07-23, 12:04
I am currently playing around with room correction via brutefir and FIR filters.
To reduce the delay I am resampling the output of kodi to 192khz.
I just found out that the quality of the resampling in kodi (even with resampling quality "high")
is not on the same level like on my music computer, where I am using JRiver, with sox as resampler.
As far as I know kodi is using ffmpeg for resampling. With ffmpeg you can also use sox as resampler
https://trac.ffmpeg.org/wiki/FFmpeg%20an...0Resampler
http://www.transcoding.dk/2011/11/16/car...ng-ffmpeg/
Is there a way to include sox-resampling via ffmpeg in kodi?
Maybe activate it over an advancedsettings entry. So at default swr from ffmpeg as resampler will still be used.
Audiophile ones can then maybe switch over advancedsettings to sox.
There is definitly a big improvement in sound quality by using sox instead of swr over ffmpeg.
On the following link a guy did some resampler comparing.
http://src.infinitewave.ca/
I didn´t get it working adding a picture here.
So just go to the mentioned url and select "ffmpeg 1.1.1 (soxr)" and "ffmpeg 1.1.1 (swr)" to compare. Then you should see sox is definitly the better resampler.
I also had a look at the kodi source code.
I already change some files for testing to activate soxr when "high" for quality of resampling is selected.
./xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp
and ./tools/depends/target/ffmpeg/autobuild.sh
and ./tools/depends/target/ffmpeg/CMakeLists.txt
then installed libsoxr-dev on my ubuntu system and compiled kodi again.
Build where succesfully but I will not get sound when resampling with quality=high is active in kodi.
I think there is something or bit more missing.
I think I dont have the coding skill to do this.
Maybe the kodi-team is interested in implementing this?
I would also help as far as I can with my limited skills or maybe just for testing.
To reduce the delay I am resampling the output of kodi to 192khz.
I just found out that the quality of the resampling in kodi (even with resampling quality "high")
is not on the same level like on my music computer, where I am using JRiver, with sox as resampler.
As far as I know kodi is using ffmpeg for resampling. With ffmpeg you can also use sox as resampler
https://trac.ffmpeg.org/wiki/FFmpeg%20an...0Resampler
http://www.transcoding.dk/2011/11/16/car...ng-ffmpeg/
Is there a way to include sox-resampling via ffmpeg in kodi?
Maybe activate it over an advancedsettings entry. So at default swr from ffmpeg as resampler will still be used.
Audiophile ones can then maybe switch over advancedsettings to sox.
There is definitly a big improvement in sound quality by using sox instead of swr over ffmpeg.
On the following link a guy did some resampler comparing.
http://src.infinitewave.ca/
I didn´t get it working adding a picture here.
So just go to the mentioned url and select "ffmpeg 1.1.1 (soxr)" and "ffmpeg 1.1.1 (swr)" to compare. Then you should see sox is definitly the better resampler.
I also had a look at the kodi source code.
I already change some files for testing to activate soxr when "high" for quality of resampling is selected.
./xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp
Code:
if(quality == AE_QUALITY_HIGH)
{
av_opt_set_double(m_pContext,"cutoff", 1.0, 0);
//av_opt_set_int(m_pContext,"filter_size", 256, 0);
av_opt_set(m_pContext,"resampler", "soxr", 0);
av_opt_set_int(m_pContext,"precision", 28, 0);
av_opt_set_int(m_pContext,"linear_interp", 1, 0);
}
...
if (m_dst_fmt == AV_SAMPLE_FMT_S32 || m_dst_fmt == AV_SAMPLE_FMT_S32P)
{
// av_opt_set_int(m_pContext, "output_sample_bits", m_dst_bits, 0);
}
and ./tools/depends/target/ffmpeg/autobuild.sh
Code:
--enable-libsoxr \
and ./tools/depends/target/ffmpeg/CMakeLists.txt
Code:
--enable-libsoxr
then installed libsoxr-dev on my ubuntu system and compiled kodi again.
Build where succesfully but I will not get sound when resampling with quality=high is active in kodi.
I think there is something or bit more missing.
I think I dont have the coding skill to do this.
Maybe the kodi-team is interested in implementing this?
I would also help as far as I can with my limited skills or maybe just for testing.