Commit 72a7b24
committed
audio: eq_iir: tune: add sof_mls_freq_resp_local.sh
Add a bash driver that turns the older manually-edited
mls_play_config.txt / mls_rec_config.txt workflow into a one-shot
"detect + configure + optionally measure" script for the local host.
All artifacts (configs, MLS reference, per-channel captures, CSV, PNG
plot) land under a per-run data subdirectory so the tune directory
does not fill up with per-machine files.
aplay -l and arecord -l are parsed to enumerate PCM devices. Speaker
preference is: descriptor named "Speaker" first (SOF SDW cards
advertise literal endpoint names), then SOF+Analog, then any Analog,
then the first non-HDMI/DP/Deepbuffer device. Mic preference is a
known calibrated measurement mic (UMM-6, UMIK, MiniDSP, EMM-6,
ECM8000) first, then any non-webcam USB card, then SOF DMIC, then
analog. --speaker / --mic override both. The auto id is
sanitize(DMI vendor + product) plus a mic tag, and gets a -2/-3/...
suffix when a prior run's outputs are already in the data dir so
re-measuring at a new mic position never clobbers old captures.
Capture format and channel count are probed with
arecord --dump-hw-params. S32_LE is preferred over S16_LE so the SOF
DMIC PCM (which only exposes S32_LE) works out of the box, and the
default channel count is the mic's advertised maximum. Optional
--cal PATH threads a two-column [freq_hz, mag_db] microphone
calibration file into rec.cal for sof_mls_freq_resp.m.
Opt-in --prep loads IPC4 pass-through blobs into the speaker card's
IIR/FIR bytes controls and turns DRC/MBDRC/TDFB switches off. Both
amixer and sof-ctl are invoked via the iface=MIXER,name='...' /
-c name='...' forms because numid-based access misreports max sizes
and trips a snd_ctl_elem_info() assertion on current alsa-utils.
Every external ioctl is wrapped in timeout(1), and each bytes
control's actual max size is probed before writing so 1-byte topology
stubs get skipped instead of crashing sof-ctl.
sof_mls_freq_resp.m gains three optional arguments (play_config_fn,
rec_config_fn, data_dir), a `pkg load signal;` up front so distros
where octave-signal is separate fail cleanly, and an mls-<id>.png
plot next to the CSV. Existing callers using the old positional
signature keep working via defaults.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>1 parent 844c208 commit 72a7b24
2 files changed
Lines changed: 972 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
| |||
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
48 | 71 | | |
49 | 72 | | |
50 | 73 | | |
| |||
58 | 81 | | |
59 | 82 | | |
60 | 83 | | |
61 | | - | |
62 | | - | |
| 84 | + | |
| 85 | + | |
63 | 86 | | |
64 | 87 | | |
65 | 88 | | |
| |||
74 | 97 | | |
75 | 98 | | |
76 | 99 | | |
77 | | - | |
| 100 | + | |
78 | 101 | | |
79 | 102 | | |
80 | 103 | | |
| |||
101 | 124 | | |
102 | 125 | | |
103 | 126 | | |
104 | | - | |
105 | | - | |
| 127 | + | |
| 128 | + | |
106 | 129 | | |
107 | 130 | | |
108 | 131 | | |
| |||
129 | 152 | | |
130 | 153 | | |
131 | 154 | | |
132 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
133 | 165 | | |
134 | 166 | | |
135 | 167 | | |
| |||
159 | 191 | | |
160 | 192 | | |
161 | 193 | | |
162 | | - | |
| 194 | + | |
163 | 195 | | |
164 | 196 | | |
165 | 197 | | |
| |||
198 | 230 | | |
199 | 231 | | |
200 | 232 | | |
201 | | - | |
| 233 | + | |
202 | 234 | | |
203 | 235 | | |
204 | 236 | | |
| |||
218 | 250 | | |
219 | 251 | | |
220 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
221 | 258 | | |
222 | 259 | | |
223 | 260 | | |
224 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
225 | 275 | | |
226 | 276 | | |
227 | 277 | | |
| |||
326 | 376 | | |
327 | 377 | | |
328 | 378 | | |
329 | | - | |
330 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
331 | 390 | | |
| 391 | + | |
332 | 392 | | |
333 | 393 | | |
334 | 394 | | |
335 | 395 | | |
336 | 396 | | |
337 | 397 | | |
338 | 398 | | |
339 | | - | |
340 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
341 | 409 | | |
342 | | - | |
| 410 | + | |
343 | 411 | | |
344 | 412 | | |
| 413 | + | |
345 | 414 | | |
346 | 415 | | |
347 | 416 | | |
| |||
0 commit comments