Skip to content

Commit d4cd615

Browse files
committed
audio: eq_iir: tune: add sof_ucm2_eq_generate
Add a tuning script that turns a measured endpoint frequency response into a pair of IIR + FIR blobs and a UCM2 include file laid out the way alsa-ucm-conf expects. The IIR is a four-biquad parametric (HP2 + low-Q mid PN2 + LS2 + one fine PN2 corrector) fit stage-by-stage with fminsearch, and the residual mid-band delta is picked up by a short minimum-phase FIR. The script takes the DMI sys_vendor and product_name from /sys/devices/virtual/dmi/id and an endpoint name, and produces: ucm2_blobs_sof/ipc4/eq_iir/<endpoint>_<vendor>_<product>_iir.{txt,bin} ucm2_blobs_sof/ipc4/eq_fir/<endpoint>_<vendor>_<product>_fir.{txt,bin} ucm2_blobs_sof/product_configs/<SYS_VENDOR>/<PRODUCT_NAME>.conf The blob file names are lowercased and non-alphanumeric runs are folded to underscores; the vendor and product directory names are kept verbatim to match the existing alsa-ucm-conf tree. The .conf file follows the alsa-ucm-conf sof/product_configs style with a biquad summary in comments and the two Define.PostMixer<Endpoint>Playback{Iir,Fir}Blob keys pointing at the installed /usr/share/alsa/ucm2/blobs/sof/... paths. Measurement input is a numeric grid with column 1 = frequency in Hz and one or more magnitude columns in dB that are averaged. Plain text and Excel/ODS workbooks are both accepted, dispatched by file extension. The sof_ucm2_eq_example.{txt,xlsx} files added in the previous commit let the script be run without external data: sof_ucm2_eq_generate('example', 'example', 'speaker', \ 'sof_ucm2_eq_example.txt'); sof_ucm2_eq_generate('example', 'example', 'speaker', \ 'sof_ucm2_eq_example.xlsx'); Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 9cb3d59 commit d4cd615

1 file changed

Lines changed: 476 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)