Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the interleaved resampler #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lu-zero
Copy link
Contributor

@lu-zero lu-zero commented May 5, 2022

It expose apparently a problem in the interleaved codepath, valgrind complains this way:

==22162== Invalid read of size 4
==22162==    at 0x10A000: speex_resampler_process_float (resample.c:947)
==22162==    by 0x10A53D: speex_resampler_process_interleaved_float (resample.c:1052)
==22162==    by 0x108B62: main (testresample2.c:72)
==22162==  Address 0x554dff0 is 0 bytes after a block of size 8,192 alloc'd
==22162==    at 0x4C38305: malloc (vg_replace_malloc.c:380)
==22162==    by 0x108A52: main (testresample2.c:56)
==22162==
==22162== Invalid read of size 4
==22162==    at 0x10A013: speex_resampler_process_float (resample.c:946)
==22162==    by 0x10A53D: speex_resampler_process_interleaved_float (resample.c:1052)
==22162==    by 0x108B62: main (testresample2.c:72)
==22162==  Address 0x554dff8 is 8 bytes after a block of size 8,192 alloc'd
==22162==    at 0x4C38305: malloc (vg_replace_malloc.c:380)
==22162==    by 0x108A52: main (testresample2.c:56)
==22162==

To reproduce:

./configure --enable-examples --enable-static --disable-shared
make clean && make -j 8
valgrind ./libspeexdsp/testresample2 > /tmp/out

@tmatth
Copy link
Member

tmatth commented May 5, 2022

@lu-zero thanks, could you make this a command-line argument (like a boolean for stereo or interleaved) as I know @wtay was using this for evaluating this resampler against others (presumably also in mono) and I don't want to break that use case.

@lu-zero
Copy link
Contributor Author

lu-zero commented May 5, 2022

Sure

@tmatth
Copy link
Member

tmatth commented May 10, 2022

@lu-zero can't reproduce here, seems to be valgrind clean.

@lu-zero
Copy link
Contributor Author

lu-zero commented May 11, 2022

I fixed its usage mistake, I have yet to make sure that resampling all the channels produces the same result per-channel, but maybe it is better to write it as a different test application.

The API uses per-channel dimensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants