Skip to content

Conversation

@singalsu
Copy link
Collaborator

@singalsu singalsu commented Nov 29, 2022

The main changes are commits 1 and 2 to SRC code. First prevents a pipeline freeze. The second fixes an overflow with 16 bit audio data.

The rest of changes are improvements to src_test.m script. E.g. call testbench with copy limit of 5 min to stop frozen SRC and minor issues fixes and speedup with reduce of printing and plot window opening.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve the C part.

@gongjun-song
Copy link
Contributor

This PR indeed fix hang issue, but I tested src_test.sh on the default SOF and it didn't pass all the test cases.

Number of passed tests = 864
Number of failed tests = 2
Number of non-applicable tests = 156
Number of skipped tests = 0

ERROR: TEST FAILED!!!
Error: SRC test with 16 bits data failed.
Test failed.

@singalsu
Copy link
Collaborator Author

singalsu commented Dec 1, 2022

This PR indeed fix hang issue, but I tested src_test.sh on the default SOF and it didn't pass all the test cases.

Thanks for report! I ran the 32 bit test. There is likely some pass criteria that the 16 bit version cannot pass, I'll try to address it. Please use meanwhile 24 or 32 bit tests.

This patch increases the buffer between stage 1 and stage 2 by
factor 1/8. It prevents a freeze that happens with conversion
from 11025 to 8000 Hz.

Also the SRC is let run if stage 1 can consume samples or stage 2
can produce samples. There is no need to prevent run if both can't
happen.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@gongjun-song
Copy link
Contributor

This PR indeed fix hang issue, but I tested src_test.sh on the default SOF and it didn't pass all the test cases.

Thanks for report! I ran the 32 bit test. There is likely some pass criteria that the 16 bit version cannot pass, I'll try to address it. Please use meanwhile 24 or 32 bit tests.

I disabled 16 bit and only test 24bit and 32bit, all passed.

Number of passed tests = 866
Number of failed tests = 0
Number of non-applicable tests = 156
Number of skipped tests = 0

Test passed.
Success: SRC test with 24 and 32 bits data passed.
Test passed.

This patch adds the missing saturation to rounding in function
src_polyphase_stage_cir_s16(). The error was caught with
"src_test(16, 16, [176400 192000], 8000)" where both conversions
made an overflow in chirp test.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This prevents testbench run freeze from src_test.m. Function
test_run_src() passes to testbench option -C that limits the number
iterations to 300k that corresponds to 5 min of audio.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
These prints are normally not useful and slow down test with a
lot of scrolled text output.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This speeds up src_test.m with no plot window opening for rate
that is not supported in the conversions matrix. No output file
returns failure -1.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Octave errors if plot handle is empty, Matlab doesn't. This can
happen if frequency response test data read fails. In that case
an empty plot window is stored as indication of error.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
If the rates are an empty vector [] the default rates are used. This
allows test command "src_test(32, 32, [], [], 0, 0);" to do a quick
test without plots with default 8 - 192 kHz in/out matrix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu singalsu force-pushed the src_copy_limits_fix branch from d31fdc8 to b73f584 Compare December 1, 2022 15:35
@singalsu
Copy link
Collaborator Author

singalsu commented Dec 1, 2022

@gongjun-song @lgirdwood The 16 bit issue was a real bug, good catch! I added as 2nd commit the bug fix to polyphase filter where the saturation was missing for 16 bit audio data round.

@gongjun-song
Copy link
Contributor

New commits have fixed 16-bit issue, all passed!

Number of passed tests = 866
Number of failed tests = 0
Number of non-applicable tests = 156
Number of skipped tests = 0

Test passed.
Success: SRC test with 16, 24 and 32 bits data passed.
Test passed.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gongjun-song thanks for the test results.

@lgirdwood lgirdwood merged commit f6b8b0e into thesofproject:main Dec 2, 2022
@singalsu singalsu deleted the src_copy_limits_fix branch February 2, 2023 15:26
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.

3 participants