-
Notifications
You must be signed in to change notification settings - Fork 349
src: audio: module_adapter: Do the params config right after init #10094
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,20 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, | |
|
|
||
| dev->state = COMP_STATE_READY; | ||
|
|
||
| #if CONFIG_IPC_MAJOR_4 | ||
| struct sof_ipc_stream_params params; | ||
|
|
||
| /* | ||
| * retrieve the stream params based on the module base cfg. There's no need to initialize | ||
| * params here because it will be filled in based on the module base_cfg. | ||
| */ | ||
| ret = module_adapter_params(dev, ¶ms); | ||
| if (ret) { | ||
| comp_err(dev, "module_adapter_new() %d: module params failed", ret); | ||
| goto err; | ||
| } | ||
| #endif | ||
|
|
||
| comp_dbg(dev, "module_adapter_new() done"); | ||
| return dev; | ||
| err: | ||
|
|
@@ -179,7 +193,28 @@ int module_adapter_prepare(struct comp_dev *dev) | |
| int i = 0; | ||
|
|
||
| comp_dbg(dev, "module_adapter_prepare() start"); | ||
| #if CONFIG_IPC_MAJOR_4 | ||
| /* | ||
| * if the stream_params are valid, just update the sink/source buffer params. If not, | ||
| * retrieve the params from the basecfg, allocate stream_params and then update the | ||
| * sink/source buffer params. | ||
| */ | ||
| if (!mod->stream_params) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this doesn't seem possible any more? It's now allocated in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No it is possible when you restart a stream after a pipeline reset without freeing it
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ranj063 interesting. Could you explain a bit more just for my understanding - "restart" a stream - you don't mean stop -> start, just a reset, right? But when do such "resets" happen apart from when stopping streams?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lyakh it never happens in our tests. But there's a QB test that does this sequence (it called randomDMAtest or something like that). I added this specifically to make that test pass: |
||
| struct sof_ipc_stream_params params; | ||
|
|
||
| ret = module_adapter_params(dev, ¶ms); | ||
| if (ret) { | ||
| comp_err(dev, "module_adapter_new() %d: module params failed", ret); | ||
| return ret; | ||
| } | ||
| } else { | ||
| ret = comp_verify_params(dev, mod->verify_params_flags, mod->stream_params); | ||
| if (ret < 0) { | ||
| comp_err(dev, "module_adapter_params(): comp_verify_params() failed."); | ||
| return ret; | ||
| } | ||
| } | ||
| #endif | ||
| /* Prepare module */ | ||
| if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) | ||
| ret = module_adapter_sink_src_prepare(dev); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.