I've tried to enable steep mode while upsampling (2x) with SOXR_STEEP_FILTER but the music subsequently plays back at many times its normal speed. A bit of fiddling shows that once the passband_end is >98% bandwidth it starts doing this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the example I gave, sox is being used only to generate, then analyze the audio. The resampling is being done by libsoxr, using one of the example programs provided with libsoxr.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, must be me misusing it then since I'm trying to use it with pulseaudio resampling by just adding the SOXR_STEEP_FILTER flag to soxr_quality_spec() and something goes wrong and playback is scrambled at 10x speed. I don't have an issue when using just sox by itself. Thanks for your time.
Last edit: Con Kolivas 2019-02-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry to bring this up again, but I've tried modifying pulseaudio with sox-vhq to quality_recipe |= SOXR_STEEP_FILTER without any other changes and I just get scrambled playback (100x speed) when using sox-vhq. Is this a pulse issue?
Last edit: Con Kolivas 2019-03-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tested on Ubuntu 18.10 with your daemon settings sbove and SOXR_STEEP_FILTER forced on in the soxr code and audio played normally.
I then used the following script to capture some resampled output; the resulting spectrogram shows that all is as expected: steep filter is being applied and no distortion occurring. Please can you try the same script and report the result?
I've attached a screenshot of running that script. As you can see, there is basically zero time in the frequency spectrum graph. The resultant file is only 80 bytes long compared to the original 3175280 bytes.
I did a little bit more poking around to see what the cut off was before this problem kicks in and the steepest I can set the filter is 1 - .02 / lsx_to_3dB(rej). As soon as I set it to 1 - .01 or steeper it starts having this problem. My guess is pulseaudio is trying to adapt to the predicted extra latency somehow and failing, but I'm no expert on pulse.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe. Though still not sure why it works for me and not for you. Perhaps due to different versions. I can try again with ubuntu 19.04 once it comes out in a couple of weeks time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried to enable steep mode while upsampling (2x) with SOXR_STEEP_FILTER but the music subsequently plays back at many times its normal speed. A bit of fiddling shows that once the passband_end is >98% bandwidth it starts doing this.
I'm not seeing any problem with this here.
For example, using one of the soxr examples, with and without steep filter:
All looks fine in the resultant spectrogram.
Not with sox directly; sox works fine, but with libsoxr only.
In the example I gave, sox is being used only to generate, then analyze the audio. The resampling is being done by libsoxr, using one of the example programs provided with libsoxr.
Okay, must be me misusing it then since I'm trying to use it with pulseaudio resampling by just adding the SOXR_STEEP_FILTER flag to soxr_quality_spec() and something goes wrong and playback is scrambled at 10x speed. I don't have an issue when using just sox by itself. Thanks for your time.
Last edit: Con Kolivas 2019-02-20
Sorry to bring this up again, but I've tried modifying pulseaudio with sox-vhq to quality_recipe |= SOXR_STEEP_FILTER without any other changes and I just get scrambled playback (100x speed) when using sox-vhq. Is this a pulse issue?
Last edit: Con Kolivas 2019-03-06
Hello again, I'll try to look into this sometime in the next week.
Please can you provide details of your pulseaudio config files (and alsa if appropriate).
/etc/pulse/daemon.conf :
default-sample-format = s24le
resample-method = soxr-vhq
default-sample-rate = 96000
alternate-sample-rate = 88200
And in pulseaudio source to try and add the steep filter,
src/pulsecore/resampler/soxr.c
line 152 add:
quality_recipe |= SOXR_STEEP_FILTER;
or of course you could just hard wire the SOXR_STEEP_FILTER on in soxr code.
Last edit: Con Kolivas 2019-03-11
I tested on Ubuntu 18.10 with your daemon settings sbove and SOXR_STEEP_FILTER forced on in the soxr code and audio played normally.
I then used the following script to capture some resampled output; the resulting spectrogram shows that all is as expected: steep filter is being applied and no distortion occurring. Please can you try the same script and report the result?
I've attached a screenshot of running that script. As you can see, there is basically zero time in the frequency spectrum graph. The resultant file is only 80 bytes long compared to the original 3175280 bytes.
Last edit: Con Kolivas 2019-03-19
I did a little bit more poking around to see what the cut off was before this problem kicks in and the steepest I can set the filter is 1 - .02 / lsx_to_3dB(rej). As soon as I set it to 1 - .01 or steeper it starts having this problem. My guess is pulseaudio is trying to adapt to the predicted extra latency somehow and failing, but I'm no expert on pulse.
Maybe. Though still not sure why it works for me and not for you. Perhaps due to different versions. I can try again with ubuntu 19.04 once it comes out in a couple of weeks time.