Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
Add support for byte controls in the SOF plugin#9484
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c0fb700
tools: ctl: Add ABI header for kcontrol read
ranj063 f0334b6
tools: plugin: tplg_ctl: Set control type
ranj063 1008ec0
tool: plugin: tplg: Parse kcontrols for process type widgets
ranj063 248c517
tools: plugin: Move plug_mq_cmd_tx_rx() definition to common code
ranj063 03715b2
tools: plugin: common: Move plug_ctl_ipc_message() definition to comm…
ranj063 d5ea317
tools: plugin: ctl: Add support for bytes control
ranj063 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,6 +23,7 @@ | ||
| #include <assert.h> | ||
| #include <errno.h> | ||
| #include <dlfcn.h> | ||
| #include <kernel/header.h> | ||
| #include <ipc4/error_status.h> | ||
| @@ -312,7 +313,22 @@ static int plug_new_process(snd_sof_plug_t *plug) | ||
| plug_setup_widget_ipc_msg(comp_info); | ||
| return 0; | ||
| tplg_ctl = calloc(ctx->hdr->payload_size, 1); | ||
| if (!tplg_ctl) { | ||
| free(comp_info->ipc_payload); | ||
| return -ENOMEM; | ||
| } | ||
| /* set up kcontrols */ | ||
| ret = tplg_create_controls(ctx, ctx->widget->num_kcontrols, | ||
| tplg_ctl, ctx->hdr->payload_size, comp_info); | ||
| if (ret < 0) { | ||
| SNDERR("failed to create controls for process comp\n"); | ||
| free(comp_info->ipc_payload); | ||
| } | ||
| free(tplg_ctl); | ||
ranj063 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return ret; | ||
| } | ||
| static int plug_new_pipeline(snd_sof_plug_t *plug) | ||
| @@ -1090,7 +1106,9 @@ static int plug_set_up_route(snd_sof_plug_t *plug, struct tplg_route_info *route | ||
| static int plug_set_up_widget(snd_sof_plug_t *plug, struct tplg_comp_info *comp_info) | ||
| { | ||
| struct tplg_pipeline_info *pipe_info = comp_info->pipe_info; | ||
| int ret; | ||
| struct plug_shm_glb_state *glb = plug->glb_ctx.addr; | ||
| struct plug_shm_ctl *ctl; | ||
| int ret, i; | ||
| pipe_info->usage_count++; | ||
| @@ -1108,6 +1126,33 @@ static int plug_set_up_widget(snd_sof_plug_t *plug, struct tplg_comp_info *comp_ | ||
| if (ret < 0) | ||
| return ret; | ||
| /* send kcontrol bytes data */ | ||
| for (i = 0; i < glb->num_ctls; i++) { | ||
| struct snd_soc_tplg_bytes_control *tplg_bytes; | ||
| struct sof_abi_hdr *abi; | ||
| int priv_size; | ||
| ctl = &glb->ctl[i]; | ||
| /* send the bytes data from kcontrols associated with current widget */ | ||
| if (ctl->module_id != comp_info->module_id || | ||
| ctl->instance_id != comp_info->instance_id || | ||
| ctl->type != SND_SOC_TPLG_TYPE_BYTES) | ||
| continue; | ||
| tplg_bytes = &ctl->bytes_ctl; | ||
| priv_size = tplg_bytes->priv.size; | ||
| abi = (struct sof_abi_hdr *)ctl->data; | ||
| /* send IPC with kcontrol data */ | ||
| ret = plug_send_bytes_data(&plug->ipc_tx, &plug->ipc_rx, | ||
| comp_info->module_id, comp_info->instance_id, abi); | ||
| if (ret < 0) { | ||
| SNDERR("failed to set bytes data for widget %s\n", comp_info->name); | ||
| return ret; | ||
| } | ||
| } | ||
| tplg_debug("widget %s set up\n", comp_info->name); | ||
| return 0; | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.