-
Notifications
You must be signed in to change notification settings - Fork 324
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
Audio: Module adapter: Add a new simple copy function #7792
Audio: Module adapter: Add a new simple copy function #7792
Conversation
92020c5
to
6ab77b6
Compare
6ab77b6
to
571e207
Compare
da4ef1f
to
510d4a7
Compare
SOFCI TEST |
510d4a7
to
5193101
Compare
The saving with this rebased pipeline2.0 adapted patch is 3.4 MCPS from sum of 10s playback average numbers
|
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.
Rather minor - just propositions for new names, no pushing. Just please don't use sink/source :)
@@ -184,6 +184,8 @@ struct processing_module { | |||
struct output_stream_buffer *output_buffers; | |||
uint32_t num_input_buffers; /**< number of input buffers */ | |||
uint32_t num_output_buffers; /**< number of output buffers */ | |||
struct comp_buffer *source; /**< single source buffer for multi_source_or_sink = false */ |
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.
Please don't call it sink/source - may be confusions with struct sof_source / struct sof_sink interface
struct comp_buffer *source_comp_buffer;
or simiar
/* False for module with one sink and one source to reduce module processing | ||
* overhead. True if multiple source or sink buffers. | ||
*/ | ||
bool multi_source_or_sink; |
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.
bool simple_1_1_copy
?
to be consistent with module_adapter_audio_stream_copy_1to1
that is called when true
5193101
to
e5bf8ca
Compare
The PR is updated according to @marcinszkudlinski 's proposals. The boolean is inverted with new name |
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.
just a couple of very minor comments
} else { | ||
mod->source_comp_buffer = NULL; | ||
mod->sink_comp_buffer = NULL; | ||
mod->stream_copy_single_to_single = false; |
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.
.stream_copy_1to1
?
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.
I was thinking 1to1 looks too much like 1:1 that would give wrong impression about doing just memcpy() from buffer to buffer.
if (mod->input_buffers[0].consumed) | ||
audio_stream_consume(&source_c->stream, mod->input_buffers[0].consumed); | ||
|
||
/* produce data into all active output buffers */ |
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.
there's just one output buffer, right?
e5bf8ca
to
7b1ed0a
Compare
Previous CI round 43 successful and 2 failing checks, failed Internal Intel CI System/merge/build with West, failed |
2f88a2f
to
c23b13b
Compare
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.
seems Ranjani trying other method with your PR for #7850 #7858
This one should be fine for merge.
Just one concern, all our optimization is trying to figure out special case and use specific function to handle it, this have benefit for this special case, however, it does increase performance for worst case and code size, I am not clear why COE team must get those module performance low for this, if there is no low power(38.4mhz)mode, it is not must for handle module with multiple routines.
c23b13b
to
97ad7fd
Compare
The previous version did not not enable the optimization, now it's using fix by @ranj063 to get the bind/unbind code to work correctly. Yes, this is a best case optimization. But it's quite common that components have only one source and and one sink so I think this is worth it. It will be even better when pipeline 2.x let's components have linear shared buffers. Since this is small add there is not much code size overhead and it can be cleaned up when the shared buffers work is ready. |
97ad7fd
to
fd7c5ad
Compare
This patch adds a simplified version of audio stream copy for module adapter clients with one source and one sink. The overhead of discovering multiple source and sink buffers is avoided. The module_adapter_bind() and module_adapter_unbind() functions are changed to detect multiple sources or sinks condition to control the used simple copy function. The mod->source and mod->sink pointers to buffers are updated when there's only one source and sink. Signed-off-by: Ranjani Sridharan <[email protected]> Signed-off-by: Seppo Ingalsuo <[email protected]>
fd7c5ad
to
d9a6491
Compare
42 successful and 3 failing checks
|
SOFCI TEST |
Now 43 successful and 2 failing checks
|
SOFCI TEST |
2 similar comments
SOFCI TEST |
SOFCI TEST |
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 @singalsu , looks good now!
Marcin's comments have been addressed and he's not available for re-review this week
https://sof-ci.01.org/sofpr/PR7792/build10174/devicetest/index.html looks a bit worrisome. I went though all the failures (verify-kernel-bootlog, check-runtime-pm-status , multiple-pipeline-capture ) and all are failures of #7482 , IOW with MOD_SET_DX failing. I'm going to proceed and merge this, but we need to raise attention to #7482 . |
This patch adds a simplified version of simple copy for module adapter clients with one source and one sink. The overhead of discovering multiple source and sink buffers is avoided.
The module_adapter_bind() and module_adapter_unbind() functions are changed to detect multiple sources or sinks condition to control the used simple copy function.