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

Audio: DRC: Use audio_stream_copy() with pass-through configuration #9626

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
21 changes: 21 additions & 0 deletions src/audio/drc/drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,18 @@ static int drc_process(struct processing_module *mod,
comp_err(dev, "drc_copy(), failed DRC setup");
return ret;
}

/* If new configuration blob is received in pass-through mode, and it
* has params.enabled true, then find the DRC processing function.
*/
if (cd->drc_func == drc_default_pass && cd->config->params.enabled)
cd->drc_func = drc_find_proc_func(cd->source_format);

/* If new configuration blob has params.enabled false, then it is safe
* to switch to pass-through mode.
*/
if (!cd->config->params.enabled)
cd->drc_func = drc_default_pass;
}

/* Control pass-though in processing function with switch control */
Expand Down Expand Up @@ -351,6 +363,15 @@ static int drc_prepare(struct processing_module *mod,
comp_err(dev, "drc_prepare(), No proc func");
return -EINVAL;
}

/* Params.enabled in the configuration blob is the master switch of DRC.
* The enable switch control does not have impact if this is not set to
* true. When false it is safe to use fast pass-through copy. A
* non-enabled blob can be used when same pipeline is used for both
* headphone and speaker where DRC should be off for headphone mode.
*/
if (!cd->config->params.enabled)
cd->drc_func = drc_default_pass;
} else {
/* Generic function for all formats */
cd->drc_func = drc_default_pass;
Expand Down
Loading