You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Include SRC tests to nocodec topology tests #1035
Is your feature request related to a problem? Please describe.
We don't have tests for SRC component. Without tests it breaks.
Describe the solution you'd like
Run twice with nocodec topologies in PR tests playback and capture to hw:0,2 with SSP2 loopback
48 kHz playback and 48 kHz capture to test current functionality
44.1 kHz playback and 96 kHz capture to test functionality with both playback and capture SRC active. In this case DAI operates with 48 kHz, playback SRC converts 44.1 to 48 and capture SRC converts 48 to 96.
Describe alternatives you've considered
N/A
Additional context
To get SRC to work currently need patches
The 997 Hz alsabat test will be fine. If SRC breaks the result is very corrupted sine wave or different playback or capture time vs. desired and alsabat will notice the frequency shift and fail it.
It seems alsabat takes similar -r argument as aplay and arecord, so adding other rate sine generation and sine wave analysis should be straightforward. Thanks Fred for volunteering!
I know alsabat support -r parameter for targer frequency, we are already using it.
One piece missing is that need to generate sine wave with 44.1Khz where as target frequency is 48Khz. Found sine wave function, but it is not configurable, it is set by target frequency. This may require alsabat in alsa-utils repo.
Let me take back, still need to generate sine wave with 48Khz.
Missing a piece is set SRC input sampling rate of 44.1Khz and output sampling rate of 48Khz.
I think easy work around, I generated 997Hz sine wave with 44.1Khz sampling rate and save to a file. I can play the file with alsabat with target frequency 48Khz. Let me try that.
playback at 96Khz and capture 44.1Khz works. (96Khz -> 48Khz, 48Khz ->44.1Khz)
One more problem/question is that S16_LE didn't work, only S32_LE works. Is this right?
Activity
singalsu commentedon May 9, 2023
The 997 Hz alsabat test will be fine. If SRC breaks the result is very corrupted sine wave or different playback or capture time vs. desired and alsabat will notice the frequency shift and fail it.
[-][FEATURE] Include SRC tests nocodec topology [/-][+][FEATURE] Include SRC tests to nocodec topology tests[/+]fredoh9 commentedon May 9, 2023
If no one volunteers, I will assign it to me later this week.
I need a way to set SRC parameters. Will check with @singalsu . Need to implement that SOF CI friendly
ranj063 commentedon May 9, 2023
@fredoh9 just to be clear we only want 3 frequencies 44.1, 48 and 96K nothing in between
singalsu commentedon May 10, 2023
It seems alsabat takes similar
-rargument as aplay and arecord, so adding other rate sine generation and sine wave analysis should be straightforward. Thanks Fred for volunteering!fredoh9 commentedon May 10, 2023
Looks not trivial to me. hehe.
I know alsabat support -r parameter for targer frequency, we are already using it.
One piece missing is that need to generate sine wave with 44.1Khz where as target frequency is 48Khz. Found sine wave function, but it is not configurable, it is set by target frequency. This may require alsabat in alsa-utils repo.
fredoh9 commentedon May 10, 2023
Let me take back, still need to generate sine wave with 48Khz.
Missing a piece is set SRC input sampling rate of 44.1Khz and output sampling rate of 48Khz.
I think easy work around, I generated 997Hz sine wave with 44.1Khz sampling rate and save to a file. I can play the file with alsabat with target frequency 48Khz. Let me try that.
plbossart commentedon May 11, 2023
why?
It's very useful to test 8/16 kHz as well. 192 as well.
I would suggest
8,16, 44.1, 96, 192 <-> 48kHz
ranj063 commentedon May 11, 2023
@plbossart this is for the PR device tests for sanity check. But for the daily test I agree we do want to add of those.
fredoh9 commentedon May 17, 2023
@singalsu
I have some errors on SSP2 capture for 8Khz, 96Khz. However 16Khz, 32Khz 44.1Khz,48Khz are working fine. 192Khz had same error with 96Khz.
$ arecord -Dhw:0,2 -c 2 -r 96000 -f S32_LE -vv /dev/null
...
arecord: pcm_read:2221: read error: Invalid argument
dmesg
mtrace
$ arecord -Dhw:0,2 -c 2 -r 8000 -f S32_LE -vv /dev/null
Recording WAVE '/dev/null' : Signed 32 bit Little Endian, Rate 8000 Hz, Stereo
arecord: set_params:1416: Unable to install hw params:
dmesg
fredoh9 commentedon May 17, 2023
playback at 96Khz and capture 44.1Khz works. (96Khz -> 48Khz, 48Khz ->44.1Khz)
One more problem/question is that S16_LE didn't work, only S32_LE works. Is this right?
singalsu commentedon May 25, 2023
Ranjani's kernel PR is now merged. Also I've updated the topology PR thesofproject/sof#7547 .
In my own tests playback 8 - 96 kHz and capture 8 - 48 kHz with all formats worked.
singalsu commentedon Jun 26, 2023
#7547 is blocked due to a CI system issue with non-48 kHz ALSA speaker test limitation.