Skip to content
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

Support for volume controls in SOF plugin #9446

Merged
merged 7 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ static inline void ipc4_send_reply(struct ipc4_message_reply *reply)
{
struct ipc *ipc = ipc_get();

/* copy the extension from the message reply */
reply->extension.dat = msg_reply.extension;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change will affect the "normal" on-DSP use-case?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh This is under ifdef CONFIG_LIBRARY....

memcpy((char *)ipc->comp_data, reply, sizeof(*reply));
}

Expand Down Expand Up @@ -1088,6 +1090,9 @@ static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ip
data,
(const char *)MAILBOX_HOSTBOX_BASE);
} else {
#if CONFIG_LIBRARY
data += sizeof(reply);
#endif
ret = drv->ops.get_large_config(dev, config.extension.r.large_param_id,
config.extension.r.init_block,
config.extension.r.final_block,
Expand Down Expand Up @@ -1235,9 +1240,15 @@ static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ip
config.extension.r.data_off_size,
(const char *)MAILBOX_HOSTBOX_BASE);
} else {
#if CONFIG_LIBRARY
struct ipc *ipc = ipc_get();
const char *data = (const char *)ipc->comp_data + sizeof(config);
#else
const char *data = (const char *)MAILBOX_HOSTBOX_BASE;
#endif
ret = drv->ops.set_large_config(dev, config.extension.r.large_param_id,
config.extension.r.init_block, config.extension.r.final_block,
config.extension.r.data_off_size, (const char *)MAILBOX_HOSTBOX_BASE);
config.extension.r.data_off_size, data);
if (ret < 0) {
ipc_cmd_err(&ipc_tr, "failed to set large_config_module_instance %x : %x",
(uint32_t)config.primary.r.module_id,
Expand Down
9 changes: 7 additions & 2 deletions tools/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ arecord -Dsof:plugin:1:default:default:48k2c16b -f dat file.wav
```
Will record audio using the plugin topology and PCM ID 1.

Mixer settings can be adjusted for sof-plugin by (Not functional yet)
Mixer settings can be adjusted for sof-plugin by

```
alsamixer -Dsof:sof-plugin:1
alsamixer -Dsof:plugin
```
or
```
amixer -Dsof:plugin cset numid=1 20
```
Right now, only volume controls are supported. Support for bytes and enum controls is pending.

# Instructions for testing OpenVino noise suppression model with the SOF plugin:
1. Fetch the model from the Open Model zoo repository ex: noise-suppression-poconetlike-0001.xml
Expand Down
1 change: 1 addition & 0 deletions tools/plugin/alsaplug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ add_library(asound_module_pcm_sof MODULE
plugin.c
../common.c
tplg.c
tplg_ctl.c
)

sof_append_relative_path_definitions(asound_module_pcm_sof)
Expand Down
Loading
Loading