-
Notifications
You must be signed in to change notification settings - Fork 318
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: Add processing enable switch control #8474
Conversation
@johnylin76 @cujomalainey Does adding this control and the logic of letting the control to impact to look OK to you? The operation should be as before if topology is not defining a switch - the blob will determine enabled / disabled. When there is a switch control in topology, processing is enabled only if blob has enable set and user space is set to enabled. This is the behaviour what I'm not fully sure about. Other way would be to enable the processing with the blob definitions whenever user requests it even if blob has enable set to false. For lowest disabled MCPS I was testing also a version that uses bypass copy function (drc_default_pass) for disabled but there would be a click when enabled/disabled so I dropped for now the idea. Note that multiband-DRC is somewhat different in enable switch control handling. It's not changing enabled/disable during streaming. I'd like to update it to be similar as what is defined for DRC to they would be kind of plug-in replacements for each other. DRC would be the light alternative for multiband-DRC (that runs min. 2 band filterbank always). |
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.
It looks good to me only with one code suggestion. Thanks
src/audio/drc/drc.c
Outdated
@@ -235,6 +266,16 @@ static void drc_set_alignment(struct audio_stream *source, | |||
audio_stream_init_alignment_constants(1, 1, sink); | |||
} | |||
|
|||
static bool drc_has_config(struct drc_comp_data *cd) |
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.
"static inline"
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.
on ACE and cAVS the compiler is now allowed to inline automatically. If this is an issue on other platforms, I'd rather enable CONFIG_COMPILER_INLINE_FUNCTION_OPTION
on them too, than adding inline
to individual functions.
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.
Not sure what to do, maybe leaving like this since the inline happens. Checked it from zephyr.lst.
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.
LGTM when all current comments resolved.
205399b
to
b5749f6
Compare
src/audio/drc/drc.c
Outdated
|
||
switch (param_id) { | ||
case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: | ||
if (ctl->id == 0 && ctl->num_elems == 1) { |
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.
shouldn't control IDs be macros?
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.
Yep, it's a good idea
b5749f6
to
460cea3
Compare
@johnylin76 will adding additional controls like this to EQ/MDRC cause any overhead in your offload logic? |
src/audio/drc/drc.c
Outdated
@@ -261,6 +298,9 @@ static int drc_process(struct processing_module *mod, | |||
} | |||
} | |||
|
|||
/* Control pass-though in processing function with switch control */ | |||
cd->enabled = drc_get_config_enabled(cd) && cd->enable_switch; |
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.
better to directly as:
cd->enabled = cd->config && cd->config->params.enabled
&& cd->enable_switch;
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.
OK, will change. The function has no other usage.
@lgirdwood |
@singalsu one conflict. |
460cea3
to
bca3a4b
Compare
This patch adds to DRC component in IPC4 mode a control to switch processing on/off. The control is useful for DRC pipeline that is used for both headphone (unprocessed) and speaker (processed). It also allows the user to switch off DRC processing if desired. If a blob has enable set to false the processing cannot be enabled with the switch control. If the blob enables processing, the user space can control processing on or off. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The mixer control for switch is added to widget definition of drc.conf. In cavs-mixin-mixout-efx-hda.conf the existing control name is changed to have "bytes" similarly as multiband-drc has. The switch control is added for the widget to implement the switch. The controls definitions files in benchmark topologies are replaced to new format from current .conf generator script. The bytes control is same as before, and the mixer control for switch is added. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
bca3a4b
to
b79eb20
Compare
No description provided.