-
Notifications
You must be signed in to change notification settings - Fork 349
Convert the SRC component to use the module interface #6639
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
Conversation
9b31c58 to
946a058
Compare
|
The SRC module will have compatibility issues when implementing the module adapter on ipc3, so ipc3 retains the original implementation of comp_driver, and only implements the module adapter for ipc4. Reasons for compatibility: If ipc3 is changed to module adapter, the dai_params function will be executed first, and then the src_params function will be executed (src_params is actually in the src_prepare function. "ERROR gongjun: dai_verify_params()" is not a real error, just the log of the print position). Explain why there is no error in the above module adapter log: |
|
SRC's Ipc4 module adapter depends on the PR: thesofproject/rimage#116 |
946a058 to
9230ba6
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu pls review.
lyakh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it should be possible to reduce the size of this patch a lot, this would make reviewing it easier and reduce the probability of errors
Not just a review issue: https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes |
9230ba6 to
175cdd2
Compare
Thanks‘s for suggestion, I have changed code. |
|
The compilation failures in https://github.com/thesofproject/sof/actions/runs/3523675882/jobs/5908116892 seem relevant |
175cdd2 to
ad7c752
Compare
Thanks, have fixed. |
|
SRC is very tricky, how has this been tested? The IPC3 SRC has been tested in testbench with tools/test/audio/src_test.m. But there's no IPC4 support in testbench. |
4fe2c54 to
a1cf3b1
Compare
Due to commit 1dffde1, the testbench execution failed(program hangs), so I cannot use testbench to test the src of ipc3 (it seems like a bug, neither the version I wrote nor the default version of sof can work). But whether it is ipc3 or ipc4, I use different rates to play audio, the sound is played normally, and there is no noise. |
|
@ranj063 can you take a look too, thanks :) Want to get all modules done for v2.5 |
https://github.com/thesofproject/sof/actions/runs/3565026602/jobs/5989687227 is green. Should it be red? |
There is no problem with the test results of CI, I am not using the same script as the CI test. The script src_test.sh also test fails with default SOF on my machine, which is not caused by this PR. |
The subjective listening can easily miss a small issue like -60 dB THD+N vs. -90 dB THD+N. The src_test.m modification to operate on a real device with nocodec SSP loopback would be a reliable quality test. Use aplay and arecord instead of testbench launch in the script. Could such enhance be taken to plans? Also enhancing testbench for IPC4 would be essential since we are dropping IPC3 from future releases. |
|
@gongjun-song I think I can fix the topology that src_test.m uses, increasing source and sink buffer should help the freezing 11.025 kHz rates to work. I'll try it today. Also testbench needs some max copy() count check and error to prevent freezes. |
lyakh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for splitting your first version of this PR. Indeed, separating moving functions around to new locations into separate commits. I still think it could be done with less moving around. Your reason for moving functions is to keep only one major #if CONFIG_IPC_MAJOR_4 switch in the code, but you already have two of them. So, if you wanted to have one - yes, you have to move code around. But if you're fine with having multiple of them - you should be able to keep most of the current code in place. But that's less important, I guess. But buffer acquisition / releasing must be fixed
|
@gongjun-song My (draft) fix for SRC freeze is #6688 |
If there is a script already written and available that finds bugs in a reasonably short time then it must be run in CI for every PR and catch regressions. Whenever someone says "I'm testing something different from CI" then we have a serious test gap almost every time. It's a big red flag; absolutely not OK. Every product is only as good as the tests it's passing. @singalsu can you please add |
Yep, would adding it to scripts/host-testbench.sh be OK? It would add about 1-2 minute of testing time as quick test. |
It depends: is By the way I had a look at
This is a question only for the main developers = you: for how long are you ready to wait for test results? |
a1cf3b1 to
a7947aa
Compare
Thank you, based on the #6688, there is no problem running src_test.sh with SRC ipc3 of this PR, and all cases have passed. @singalsu, in addition to the above testbench issue, could you please review the code to see if there are any other issues? thanks! |
|
a7947aa to
4240e06
Compare
74b8bf1 to
44e18c5
Compare
lyakh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, just a couple of minor comments
No need to add if condition judgment and rfree(NULL) is allowed. Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Remove some unnecessary brackets in src_verify_params function. Signed-off-by: Gongjun Song <gongjun.song@intel.com>
The commit that caused this bug is 1ec9fc1. Added the sink_c parameter, but did not set sink_c in src.c. This commit will set sink_c to solve the issue of wrong sink rate. Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Due to add module adapter feature, some functions need to be moved to new locations to fit it. Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Due to add module adapter feature, some functions needs to be changed to fit it. Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Adopt module interface for src component. IPC3 has compatibility issues, it continues to use comp_driver. Convert to module adapter only for IPC4. Signed-off-by: Gongjun Song <gongjun.song@intel.com>
44e18c5 to
3ed352f
Compare
Adopt module interface for src component.
Signed-off-by: Gongjun Song gongjun.song@intel.com