This directory contains the DRC component.
The Dynamic Range Compressor reduces the volume of loud sounds or amplifies quiet sounds by narrowing or "compressing" an audio signal's dynamic range.
graph TD
In[Audio Input] --> Det[Envelope Detector]
In --> Gain[Gain Element]
Det --> Calc[Gain Calculation]
Calc --> Gain
Gain --> Out[Audio Output]
- Kconfig: Enables the Dynamic Range Compressor component (
COMP_DRC). It relies on various math features likeCORDIC_FIXED,MATH_LUT_SINE_FIXED, andMATH_EXP. The maximum number of pre-delay frames is tunable viaDRC_MAX_PRE_DELAY_FRAMES(defaults to 512). - CMakeLists.txt: Manages local base sources and generic/HIFI specific files such as
drc_hifi4.canddrc_math_hifi3.c. Adds logging capabilities if compiled in (drc_log.c). - drc.toml: Topology parameters for the DRC module definition, exposing UUID and standard buffer sizes and processing capabilities.
- Topology (.conf):
tools/topology/topology2/include/components/drc.confconfigures thedrcwidget object, providing switch controls by binding a mixer control to switch get/put handlers (259). Defaults to typeeffectwith UUIDda:e4:6e:b3:6f:00:f9:47:a0:6d:fe:cb:e2:d8:b6:ce. - MATLAB Tuning (
tune/): Contains.mscripts (e.g.,sof_example_drc.m) capable of tuning compressor parameters (threshold, knee, ratio, attack, release) and visualizing their gain reaction curves. The outputs are exported as.confconfigurations, M4 macros, and ALSAalsactlpayload blobs for preset instantiation defaults (e.g., speaker or DMIC presets).