Skip to content

Commit

Permalink
Tools: Tune: EQ: Cleanup produced blob files structure
Browse files Browse the repository at this point in the history
To remove clutter from upper level this patch changes
generated files naming from e.g. "ipc4/eq_fir_loudness.blob" to
"ipc4/eq_fir/loudness.blob". It helps to find the blob files
from directory that has same name as the target component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu authored and lgirdwood committed Apr 29, 2024
1 parent ec4e2a9 commit 70449a3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 45 deletions.
20 changes: 10 additions & 10 deletions tools/tune/eq/example_fir_eq.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function example_fir_eq()

%% Common definitions
fs = 48e3;
fn.cpath3 = '../../ctl/ipc3';
fn.cpath4 = '../../ctl/ipc4';
fn.cpath3 = '../../ctl/ipc3/eq_fir';
fn.cpath4 = '../../ctl/ipc4/eq_fir';
fn.tpath1 = '../../topology/topology1/m4';
fn.tpath2 = '../../topology/topology2/include/components/eqfir';
fn.priv = 'DEF_EQFIR_PRIV';
Expand All @@ -21,8 +21,8 @@ function example_fir_eq()
%% -------------------
%% Example 1: Loudness
%% -------------------
fn.bin = 'eq_fir_loudness.blob';
fn.txt = 'eq_fir_loudness.txt';
fn.bin = 'loudness.blob';
fn.txt = 'loudness.txt';
fn.tplg1 = 'eq_fir_coef_loudness.m4';
fn.tplg2 = 'loudness.conf';
comment = 'Loudness effect, created with example_fir_eq.m';
Expand Down Expand Up @@ -52,8 +52,8 @@ function example_fir_eq()
%% -------------------
%% Example 2: Mid boost
%% -------------------
fn.bin = 'eq_fir_mid.blob';
fn.txt = 'eq_fir_mid.txt';
fn.bin = 'mid.blob';
fn.txt = 'mid.txt';
fn.tplg1 = 'eq_fir_coef_mid.m4';
fn.tplg2 = 'midboost.conf';
comment = 'Mid boost, created with example_fir_eq.m';
Expand All @@ -79,8 +79,8 @@ function example_fir_eq()
%% -------------------
%% Example 3: Flat EQ
%% -------------------
fn.bin = 'eq_fir_flat.blob';
fn.txt = 'eq_fir_flat.txt';
fn.bin = 'flat.blob';
fn.txt = 'flat.txt';
fn.tplg1 = 'eq_fir_coef_flat.m4';
fn.tplg2 = 'flat.conf';
comment = 'Flat response, created with example_fir_eq.m';
Expand All @@ -106,8 +106,8 @@ function example_fir_eq()
%% --------------------------
%% Example 4: Pass-through EQ
%% --------------------------
fn.bin = 'eq_fir_pass.blob';
fn.txt = 'eq_fir_pass.txt';
fn.bin = 'pass.blob';
fn.txt = 'pass.txt';
fn.tplg1 = 'eq_fir_coef_pass.m4';
fn.tplg2 = 'passthrough.conf';
comment = 'Pass-through response, created with example_fir_eq.m';
Expand Down
7 changes: 3 additions & 4 deletions tools/tune/eq/example_iir_bandsplit.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ function example_iir_bandsplit()
%% Common definitions
fs = 48e3;
tpath = '../../topology/topology1/m4';
cpath = '../../ctl';
cpath = '../../ctl/ipc3/eq_iir';
priv = 'DEF_EQIIR_PRIV';

addpath ../common

%% --------------------------------------------------
%% Example: Band-split 2ch to 4ch low and high bands
%% --------------------------------------------------
blob_fn = fullfile(cpath, 'eq_iir_bandsplit.blob');
alsa_fn = fullfile(cpath, 'eq_iir_bandsplit.txt');
blob_fn = fullfile(cpath, 'bandsplit.blob');
alsa_fn = fullfile(cpath, 'bandsplit.txt');
tplg_fn = fullfile(tpath, 'eq_iir_bandsplit.m4');
comment = 'Bandsplit, created with example_iir_bandsplit.m';

Expand All @@ -44,7 +44,6 @@ function example_iir_bandsplit()
%% Pack and write file
eq_pack_export(bm, blob_fn, alsa_fn, tplg_fn, priv, comment)


%% ------------------------------------
%% Done.
%% ------------------------------------
Expand Down
33 changes: 16 additions & 17 deletions tools/tune/eq/example_iir_eq.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function example_iir_eq()

%% Common definitions
fs = 48e3;
fn.cpath3 = '../../ctl/ipc3';
fn.cpath4 = '../../ctl/ipc4';
fn.cpath3 = '../../ctl/ipc3/eq_iir';
fn.cpath4 = '../../ctl/ipc4/eq_iir';
fn.tpath1 = '../../topology/topology1/m4';
fn.tpath2 = '../../topology/topology2/include/components/eqiir';
fn.priv = 'DEF_EQIIR_PRIV';
Expand All @@ -21,8 +21,8 @@ function example_iir_eq()
%% -------------------
%% Example 1: Loudness
%% -------------------
fn.bin = 'eq_iir_loudness.blob';
fn.txt = 'eq_iir_loudness.txt';
fn.bin = 'loudness.blob';
fn.txt = 'loudness.txt';
fn.tplg1 = 'eq_iir_coef_loudness.m4';
fn.tplg2 = 'loudness.conf';
comment = 'Loudness effect, created with example_iir_eq.m';
Expand Down Expand Up @@ -52,8 +52,8 @@ function example_iir_eq()
%% ------------------------------------
%% Example 2: Bass boost
%% ------------------------------------
fn.bin = 'eq_iir_bassboost.blob';
fn.txt = 'eq_iir_bassboost.txt';
fn.bin = 'bassboost.blob';
fn.txt = 'bassboost.txt';
fn.tplg1 = 'eq_iir_coef_bassboost.m4';
fn.tplg2 = 'bassboost.conf';
comment = 'Bass boost, created with example_iir_eq.m';
Expand All @@ -79,8 +79,8 @@ function example_iir_eq()
%% ------------------------------------
%% Example 3: Band-pass
%% ------------------------------------
fn.bin = 'eq_iir_bandpass.blob';
fn.txt = 'eq_iir_bandpass.txt';
fn.bin = 'bandpass.blob';
fn.txt = 'bandpass.txt';
fn.tplg1 = 'eq_iir_coef_bandpass.m4';
fn.tplg2 = 'bandpass.conf';
comment = 'Band-pass, created with example_iir_eq.m';
Expand All @@ -106,8 +106,8 @@ function example_iir_eq()
%% -------------------
%% Example 4: Flat IIR
%% -------------------
fn.bin = 'eq_iir_flat.blob';
fn.txt = 'eq_iir_flat.txt';
fn.bin = 'flat.blob';
fn.txt = 'flat.txt';
fn.tplg1 = 'eq_iir_coef_flat.m4';
fn.tplg2 = 'flat.conf';
comment = 'Flat response, created with example_iir_eq.m';
Expand All @@ -133,8 +133,8 @@ function example_iir_eq()
%% ---------------------------
%% Example 5: Pass-through IIR
%% ---------------------------
fn.bin = 'eq_iir_pass.blob';
fn.txt = 'eq_iir_pass.txt';
fn.bin = 'pass.blob';
fn.txt = 'pass.txt';
fn.tplg1 = 'eq_iir_coef_pass.m4';
fn.tplg2 = 'passthrough.conf';
comment = 'Pass-through, created with example_iir_eq.m';
Expand Down Expand Up @@ -174,11 +174,10 @@ function example_iir_eq()
fn.tplg1 = sprintf('eq_iir_coef_highpass_%dhz_%ddb_%dkhz.m4', ...
fc, g, fsk);
fn.tplg2 = sprintf('highpass_%dhz_%ddb_%dkhz.conf', fc, g, fsk);
fn.txt = sprintf('eq_iir_highpass_%dhz_%ddb_%dkhz.txt', ...
fc, g, fsk);
fn.txt = sprintf('highpass_%dhz_%ddb_%dkhz.txt', fc, g, fsk);
comment = sprintf('%d Hz second order high-pass, gain %d dB, created with example_iir_eq.m', ...
fc, g);
fn.bin = sprintf('eq_iir_highpass_%dhz_%ddb_%dkhz.blob', fc, g, fsk);
fn.bin = sprintf('highpass_%dhz_%ddb_%dkhz.blob', fc, g, fsk);

%% Design IIR high-pass
eq_hp = hp_iir_eq(fs, fc, g);
Expand All @@ -205,8 +204,8 @@ function example_iir_eq()
%% Example 7: Merge previous desigs to single blob for use as presets
%% ------------------------------------------------------------------

fn.bin = 'eq_iir_bundle.blob';
fn.txt = 'eq_iir_bundle.txt';
fn.bin = 'bundle.blob';
fn.txt = 'bundle.txt';
fn.tplg1 = 'eq_iir_bundle.m4';
fn.tplg2 = 'bundle.conf';
comment = 'Bundle of responses flat/loud/bass/band/high, created with example_iir_eq.m';
Expand Down
30 changes: 16 additions & 14 deletions tools/tune/eq/example_spk_eq.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ function example_spk_eq()

%% Defaults
fs = 48e3;
fn.cpath3 = '../../ctl/ipc3';
fn.cpath4 = '../../ctl/ipc4';
iir.cpath3 = '../../ctl/ipc3/eq_iir';
iir.cpath4 = '../../ctl/ipc4/eq_iir';
fir.cpath3 = '../../ctl/ipc3/eq_fir';
fir.cpath4 = '../../ctl/ipc4/eq_fir';
fn.tpath1 = '../../topology/topology1/m4';
fir.tpath2 = '../../topology/topology2/include/components/eqfir';
iir.tpath2 = '../../topology/topology2/include/components/eqiir';
Expand All @@ -26,12 +28,12 @@ function example_spk_eq()
fir.comment = 'Speaker FIR+IIR EQ created with example_spk_eq.m';

%% File names
fir.txt = 'eq_fir_spk.txt';
fir.bin = 'eq_fir_spk.blob';
fir.txt = 'spk.txt';
fir.bin = 'spk.blob';
fir.tplg1 = 'eq_fir_coef_spk.m4';
fir.tplg2 = 'example_speaker.conf';
iir.txt = 'eq_iir_spk.txt';
iir.bin = 'eq_iir_spk.blob';
iir.txt = 'spk.txt';
iir.bin = 'spk.blob';
iir.tplg1 = 'eq_iir_coef_spk.m4';
iir.tplg2 = 'example_speaker.conf';

Expand Down Expand Up @@ -134,12 +136,12 @@ function example_spk_eq()
assign_response, ...
[ bq_fir ]);
bp_fir = eq_fir_blob_pack(bm_fir, 3); % IPC3
eq_alsactl_write(fullfile(fn.cpath3, fir.txt), bp_fir);
sof_ucm_blob_write(fullfile(fn.cpath3, fir.bin), bp_fir);
eq_alsactl_write(fullfile(fir.cpath3, fir.txt), bp_fir);
sof_ucm_blob_write(fullfile(fir.cpath3, fir.bin), bp_fir);
eq_tplg_write(fullfile(fn.tpath1, fir.tplg1), bp_fir, fir.priv, fir.comment);
bp_fir = eq_fir_blob_pack(bm_fir, 4); % IPC4
eq_alsactl_write(fullfile(fn.cpath4, fir.txt), bp_fir);
sof_ucm_blob_write(fullfile(fn.cpath4, fir.bin), bp_fir);
eq_alsactl_write(fullfile(fir.cpath4, fir.txt), bp_fir);
sof_ucm_blob_write(fullfile(fir.cpath4, fir.bin), bp_fir);
eq_tplg2_write(fullfile(fir.tpath2, fir.tplg2), bp_fir, 'eq_fir', fir.comment);
end

Expand All @@ -151,12 +153,12 @@ function example_spk_eq()
assign_response, ...
[ bq_iir ]);
bp_iir = eq_iir_blob_pack(bm_iir, 3); % IPC3
eq_alsactl_write(fullfile(fn.cpath3, iir.txt), bp_iir);
sof_ucm_blob_write(fullfile(fn.cpath3, iir.bin), bp_iir);
eq_alsactl_write(fullfile(iir.cpath3, iir.txt), bp_iir);
sof_ucm_blob_write(fullfile(iir.cpath3, iir.bin), bp_iir);
eq_tplg_write(fullfile(fn.tpath1, iir.tplg1), bp_iir, iir.priv, iir.comment);
bp_iir = eq_iir_blob_pack(bm_iir, 4); % IPC4
eq_alsactl_write(fullfile(fn.cpath4, iir.txt), bp_iir);
sof_ucm_blob_write(fullfile(fn.cpath4, iir.bin), bp_iir);
eq_alsactl_write(fullfile(iir.cpath4, iir.txt), bp_iir);
sof_ucm_blob_write(fullfile(iir.cpath4, iir.bin), bp_iir);
eq_tplg2_write(fullfile(iir.tpath2, iir.tplg2), bp_iir, 'eq_iir', iir.comment);
end

Expand Down

0 comments on commit 70449a3

Please sign in to comment.