-
Notifications
You must be signed in to change notification settings - Fork 321
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
Conversation
57cdc86
to
bbda6e8
Compare
Note: When a blob has the params.enable set, then the user space switch control as before controls the processing on/off while preserving the internal lookup delay so this change doesn't cause glitches when normally controlling processing. |
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.
Good MCPS savings @singalsu !
src/audio/drc/drc.c
Outdated
|
||
if (cd->drc_func == drc_default_pass && cd->config->params.enabled) | ||
cd->drc_func = drc_find_proc_func(cd->source_format); | ||
|
||
if (!cd->config->params.enabled) | ||
cd->drc_func = drc_default_pass; |
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.
Can we spell out the configuration flow and selection in an inline comment too.
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 useful to document.
The configuration blob is checked in drc_prepare(). If the blob does not have params.enable set, then it is safe to switch to a more efficient buffer copy function that bypasses the internal DRC lookup delay with channels de-interleave and interleave operations. The enable in the blob is a master switch for DRC. With such configuration in the blob the switch control from user space can't switch the processing on. Therefore it is safe to change the processing function. This change minimizes the MCPS overhead of unused DRC and reduces audio latency. If a new blob is received during streaming, the params.enable is checked again and the processing function is set again if the pass-through copy mode was in use. If the new blob has enable false, then the processing is changed to pass-through mode. The pass-through blob configuration is useful when the same pipeline is used for both headphone and speaker, where DRC is usually disabled for headphone mode. This change saves in hda-generic topologies with the default blob about 1.2 MCPS in TGL platform. Signed-off-by: Seppo Ingalsuo <[email protected]>
bbda6e8
to
c5ef0e3
Compare
The configuration blob is checked in drc_prepare(). If the blob does not have params.enable set, then it is safe to switch to a more efficient buffer copy function that bypasses the internal DRC lookup delay with channels de-interleave and interleave operations. The enable in the blob is a master switch for DRC. With such configuration in the blob the switch control from user space can't switch the processing on. Therefore it is safe to change the processing function. This change minimizes the MCPS overhead of unused DRC and reduces audio latency.
If a new blob is received during streaming, the params.enable is checked again and the processing function is set again if the pass-through copy mode was in use.
A pass-through blob can be applied e.g. when the same pipeline is used for both headphone and speaker, where DRC is usually disabled for headphone mode.
This change saves in hda-generic topologies with the default blob about 1.2 MCPS in TGL platform.