Allow build with cmake 4.0.0
Now this patch is being intensively used by Python-SoXR and seems like working fine. I'm maintaing libsoxr in my personal repository. https://github.com/dofuuz/soxr/
Hi robs, i got problems compiling on cubox-i (https://wiki.gentoo.org/wiki/Cubox-i, https://archlinuxarm.org/platforms/armv7/freescale/cubox-i). Compiling on gentoo with emerge (test gets disabled...) succeeded, but i get "illegal instruction (core dumped)" when using the lib. Investigated with gdb: 0xb5a28ef0 in pffft_real_finalize $ layout asm 0xb5a28ef0 <pffft_real_finalize+360> vfnma.f32 s6, s15, s8 Compiling manually, the test fail (Tests: 1 - 4: Failed, 9-10: Exception: Illegal). I can fix...
Hi, I’m working on using soxr_output with float64S (separated channels, https://github.com/lrbalt/libsoxr-rs/issues/7). I’m getting a signal: 11, SIGSEGV: invalid memory reference. I supply a pointer to an array of pointers, like in 4-split-channels.c example. But if I look at the code here: https://github.com/chirlu/soxr/blob/master/src/soxr.c#L716 the pointer to out is changed as if out is a pointer to a buffer, not a pointer to an array of pointers to a buffer. If you look at the call to soxr_output_no_callback...
In system that 'unsigned long' is 32-bit(i.e. Windows, 32-bit Linux), dithering is not working as expected. In those systems, dithering has pattern of every 16 samples. Later 8 samples are always ±0. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 -1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1...
How many frames does soxr output if, given ilen input frames, olen = ilen*orate/irate is not an integer? I'm working on an application where I'm streaming data in and out on stdio (like examples 2 and 3), and need to output a WAV header before soxr's output -- which requires knowing the exact number of output frames in advance, since I can't seek on stdout to patch up the header later. (This is assuming constant-rate files, of course.)
How many frames does soxr output if, given ilen input frames, olen = ilen*orate/irate is not an integer? I'm working on an application where I'm streaming data in and out on stdio (like examples 2 and 3), and need to output a WAV header before soxr's output -- which requires knowing the exact number of output frames in advance, since I can't seek on stdout to patch up the header later.
Well for those that come after... I believe this occurs because the resampler sees the buffer edges as discontinuities in the audio data. E.g. the first sample in the buffer is seen as having an infinite rise time from the "previous" sample, which causes and overshoot and high frequency ringing in the upsampled audio. So, I fixed the problem by making the buffer 100 samples larger than needed, and filling the first 50 buffer locations with a copy of the first sample, and the last 50 locations with...
I'm getting a little "glitch" or "pop" at the start of each buffer when upsampling and streaming, using code similar to example 2. https://drive.google.com/file/d/1DhNIO6c50qhG-cEYvRGFjrpojy9iJsx3/view?usp=sharing https://drive.google.com/file/d/12GyS9hpyTjeTK5wmc9x7drNds4avFSTH/view?usp=sharing How can I avoid this? void sox_upsample(float * input_sample_buff, float * upsample_buff,sf_count_t insize) { size_t ilen = (size_t)(insize / 2); // insize is the interleaved stereo count of samples read...
Hi! Great library, awesome work! Wonder if I can get some feedback on whether I am license compliant? I am looking to include this excellent library in a Android Unity plugin which would be sold commercially (on the Unity asset store) and then used by other developers to create Android applications that may then be sold on the Google Play Store, etc. I am compiling the SoXR source unmodified to an SO shared library This is then used by another library, which also creates a shared SO library and java...
I just built and installed libsoxr form latest sources. Somehow libsoxr 0.1.3. gets installed as libsoxr.so.0.1.2 I was expecting libsoxr.so.0.1.3 My Arch Linux package actually does the same. I guess the revision info needs to be stepped up. Thx
How do I know that ARM Neon support gets enabled during build? There don't seem to be any OPTS that can turn NEON on or off like SIMD/SSE etc. There's no inidication that it gets enabled. Is there a difference between ARM NEON 32/64 ? E.g. SIMD does differentiate. THX
Ensure ARM code checks for __arm64__, not just __arm__
Enable NEON on aarch64
No idea what you mean.
While being at the pkg-config stuff, I noticed that building with "-DBUILD_EXAMPLES=1" results in a broken soxr.pc file. Is this intentional or can this be fixed as well?
This patch has been replaced by a better solution: https://git.buildroot.net/buildroot/tree/package/libsoxr/0001-Add-Libs.private-for-static-linking.patch. I'll update the merge request.
Fixup pkgconfig file for consistency
I think you're missing -l in the front?
Hello, but this is not the right list for your question. Please use https://sourceforge.net/projects/sox/lists/sox-users
Hello all, I am comparing the original(noisy) sound file with noise reduced file (noise profiling followed by reducing the noise) using the sox wrapper in python. However, I am unable to do so because the length of the noise reduced audio is lesser than the original (noisy) file. I am not sure why is the length of the file getting trimmed and I would like to know if there is any way I could stop this from happening.
Hello there, I'm not aware of such a wrapper, but I wonder if using python’s popen facility to pipe data through libsoxr’s example # 3 (a stand-alone process with most of libsoxr options available on the command line) might work here?
Or python wrapper of libsoxr ? Thanks in advance
Hi Robs - Thanks very much for taking the time to answer. I've tried these parameters but it's still a bit too much CPU when I want to resample from 96 to 44.1, so I'add a very basic fixed point interpolation and/or simple filter for higher rates when I cannot use soxr Thanks again
Hello Philippe, I suggest the following: 1. Disable all the WITH_xxx build options, except for WITH_CR32. 2. Use SOXR_NO_DITHER in soxr_io_spec. 3. Try using the MQ recipe for soxr_quality_spec (which can in fact be more efficient than LQ in some circumstances). 3. Try overriding passband_end to 0.8 and stopband_begin to 1.2 in soxr_quality_spec (or even .75, 1.25). That's as much as I can think of at the moment (though I did experiment with IIR filters at one time but it didn't yield any improvement)—hope...
Hi - First, thanks for soxr, I've used it in many projects. I'm now using it on the esp32 processor. It cross-compile and works fine, but the esp32 is not the most power system (although it has a 32 bits FPU) and it does a lot of other things in my application. I'm trying to find the lowest CPU footprint (not memory, but cycles) and I'm not sure I've got everything right. I'm using16 bits, LQ which I think means only float (not double are used) but when I'm changing rolloff and phase to minimum or...
Aliasing is selected by setting the stopband_begin parameter (see soxr.h) to a value >1. With the default passband_end setting of 0.913, setting stopband_begin 1.087 gives a half-band response i.e. aliasing above the passband. Whereas setting it to 1.05 should mimic the SoX "allow aliasing" setting (which allows aliasing only above the 3dB point).
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.
What parameters need to be set if I want to enable aliasing like in SoX ?
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.
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've attached a screenshot of running that script. As you can see, there is basically zero time in the frequency graph.
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? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20#!/bin/sh set -e sink_name=capture rate=96000 format=s24 pactl load-module module-null-sink...
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.
And in pulseaudio source to try and add the steep filter, src/pulsecore/resampler/soxr.c line 152 add: quality_recipe |= SOXR_STEEP_FILTER;
/etc/pulse/daemon.conf : default-sample-format = s24le resample-method = soxr-vhq default-sample-rate = 96000 alternate-sample-rate = 88200
Please can you provide details of your pulseaudio config files (and alsa if appropriate).
Hello again, I'll try to look into this sometime in the next week.
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?
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 (10x speed) when using sox-vhq. Is this a pulse issue?
Sorry to bring this up again, but I've tried modifying pulseaudio with sox-vhq to quality_recipe |= SOXR_STEEP_FILTER and I just get scrambled playback (10x speed). Is this a pulse issue?
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.
I don't understand the sox syntax enough to know, but I can't really see the steep command line there, but 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. Thanks for your time.
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. Thanks for your time.
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.
Not with sox directly; sox works fine, but with libsoxr only.
I don't think that resampling is what you need in this case. Try perhaps using the tempo effect from the sox library, or using the soundtouch library (which is similar).
I'm not seeing any problem with this here. For example, using one of the soxr examples, with and without steep filter: sox -r96k -n 0.f32 synth 8 sin 0:48k gain -1 ./3-options-input-fn 1 2 1 0 0 4 < 0.f32 >1.f32 ./3-options-input-fn 1 2 1 0 0 44 < 0.f32 >2.f32 sox -M -r192k -c1 "[12].f32" -n spectrogram -z 150 -hwk -o steep.png All looks fine in the resultant spectrogram.
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.
it was late yesterday. This is how I run soxr: https://github.com/christf/snapcastc/blob/firstdraft/src/alsaplayer.c#L34
Hello everyone, I am writing a piece of software that is playing audio synchronously over the network - similar to what snapcast is doing. To achieve synchronous output libsoxr is used to resample the data. So far I am using soxr_oneshot() and resampling is working, however there is a noticable change in pitch when it is applied. Small chunks of audio data are tagged with a time stamp at which they are to be played back and delivered from a server to all clients using UDP. On the client chunks can...
soxr.pc.in: add avutil libraries
Thank you.
Hello Tom, yes, this library can efficiently resample doubles at these rates. Please see the provided examples for the functions used. Note that if the signal is streamed in blocks, then there is a latency, i.e. a number of samples delay, between input and output.
Hi, Can this library resample a signal that is delivered as 16384 doubles at a sample rate of 250kHz to 192kHz? If so, which function would be used? Will the result be an array of size 16384? Currently, I have experince myself downsampling 1.92MHz to 192kHz by doing a lowpass filter followed by keepint on sample out of 10. This is then sent to an FFT for plotting and to a sound ouput module to output the sound at 192kHz. However this sample rate conversion requires upsampling by 96 and then downsampling...
Hi, Sorry for writing a bug report here, but you have disabled the SF ticketing system... There is a problem with the project() command used in the CMAKE files, especially when CMAKE > 3.0 is used project() CMP0048 policy The second usage of the project() command if the -DBUILD_EXAMPLES=ON is used, removes any previous variable settings, thus at the end of the compilation libsoxr remains without a version (actually with version string "..") on the pkg-config level. This way the configure scripts...
Home
fix non-portable use of preprocessor 'defined'
minor fixes
minor clean-ups
fix incorrect include-dir variable names
eliminate runtime casts (and associated warnings in debian) in soxr-lsr wrapper
update NEWS, versions
Thanks!
Hello again, The only effect of specifying a higher max. IO ratio than you actually end up using is that some memory allocated at soxr_create() time for processing the higher IO ratios will remain unused—but this shouldn't usually be much of a problem. HTH, Rob.
Hi Rob, Things are going very well with libsoxr and variable rate conversion! Hope you don't mind me asking another question. Are there any effects of choosing a specific max IO ratio (other than setting is too low)? Is there any relationship between speed and/or quality and the max IO ratio? For example: assume frequency ranges between (and including) 44.1 KHz & 192 KHz, would it be sufficient to set the max IO ratio using those max/min values (or a ratio of 1000 to 1), even if the actual ratio...
Glad to hear that you're making progress! 1st question: Yes, that's right. 2nd question: I don't think that ther has to be any particular relationship between these values (and there are no specific limits), but where the rate is changing continuously (such as in the supplied example # 5), it may be convenient to make them them the same.
Hi Rob, Thank you for your response! The thing you described about the maximum I/O ratio was indeed partly cause of the distortion (the other being an out of bound write of 1 byte in another part of my code). Am I correct that when using variable rate conversion the ratio values used in soxr_create have no relation to the actual sample rates other than defining the maximum I/O? (tests suggest this is indeed the case, but I want to make sure I'm correct) What are the limits of the skew value when...
Yes, it is possible to use the variable rate conversion when both input rate and output rates are the same. I've just run this simple test here, using one of the supplied examples, and all seems to work as expected: ./3-options-input-fn 48000 48000 2 0 0 4 20 < input.f32 > output.f32 Note that with variable-rate conversion, the sample-rates given in soxr_create determine the maximum I/O ratio that will be used. So if, for example, input_sample_rate & output_sample_rate are both given as 48kHz in...
Thank you for this wonderfull library! Is it possible to use the variable rate conversion when both input rate and output rates are the same? I intend to use libsoxr as drift compensation mechanism between 2 clock domains. When I convert from 96KHz to 48KHz it works well, but when I convert from 48KHz to 48KHz it produces audible clicks in the audio. I setup the resampler like this: soxr_in_spec = soxr_quality_spec(SOXR_HQ, SOXR_VR); soxr = soxr_create( input_sample_rate, // (48KHz or 96KHz) output_sample_rate,...
Thank you for this wonderfull library! Is it possible to use the variable rate conversion when both input rate and output rate are the same? I intend to use libsoxr as drift compensation mechanism between 2 clock domains. When I convert from 96KHz to 48KHz it works well, but when I convert from 48KHz to 48KHz it produces audible clicks in the audio. I setup the resampler like this: soxr_in_spec = soxr_quality_spec(SOXR_HQ, SOXR_VR); soxr = soxr_create( input_sample_rate, // (48KHz or 96KHz) output_sample_rate,...
Thank you for this wonderfull library! Is it possible to use the variable rate mechanism when both input rate and output rate are the same? I intend to use libsoxr as drift compensation mechanism between 2 clock domains. When I convert from 96KHz to 48KHz it works well, but when I convert from 48KHz to 48KHz it produces audible clicks in the audio. I setup the resampler like this: soxr_in_spec = soxr_quality_spec(SOXR_HQ, SOXR_VR); soxr = soxr_create( input_sample_rate, // (48KHz or 96KHz) output_sample_rate,...
Alright, that definitely clears things up. Thanks for the help! -Alex
Hello Alex, apologies for the confusion! PFFFT is the best library from a performance...
Hello robs, I'm a bit confused about how to choose between the various options dealing...
How can we measure the group delay for soxr? Are we using any techniques to reduce...
how can we measure group delay for soxr? Are we using any technique to nullify the...
using any one of the application in soxr will i be able to find the group delay of...
using one of the application in soxr will i be able to find the group delay of the...
using one of the application in soxr will i be able to find the group delay of the...
Hello Alexander, I don't think that there is a problem as you describe, since I would...
Maybe I found a bug in _soxr_deinterleave (or did something wrong): #define DEINTERLEAVE_FROM(T,flag)...
I'm afraid that I can't see why it works on 12 and not on 11. Perhaps you could try...
I have a repository with Qt5 for SLE 11 and 12. I have been added qmmp into that....
clean-up; set version as 0.1.3b1
clean-up
clean-up
fix prev.
reorg/SIMD
make explicit avcodec dependency on avutil; avf...
clean-up
fix incorrect interpretation of given o/i ratio...
improve clang support
doc update; make an lsr-test conditional as app...
portability/cross-compiling improvements/clean-...
tests: use dolph window if available, kaiser ot...
simplify by using #cmakedefine01; introduce HAV...
use latest pffft
fix warning