Tools: Topology2: Swap gain and eqiir in DMIC capture #9700
+18
−19
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.
This patch swaps the order of IIR and gain components in capture pipeline. In IPC4 systems the gain component can only attenuate the signal, largest gain is 0 dB (pass-through). The IIR component can be set up to amplify the signal by e.g. +20 dB that is currently default in many topologies. The gain can possibly distort the signal in loud environment.
With current "dai-copier -> eqiir -> gain -> module-copier" topology the user configurable gain (ALSA mixer control) can't prevent clipping of audio signal in IIR. While with swapped order "dai-copier -> gain -> eqiir -> module-copier" using attenuation in gain component can be used to prevent audio signal clipping in IIR. It would be useful in capturing audio in a very loud environment.
Since the pipeline is 32-bits there is no practical loss of audio quality even if there would be first attenuation and then gain. Plus normally the gain control for Dmic0 is set to maximum.