Skip to content

Commit e6d3486

Browse files
committed
Audio: Selector: Add blob for stereo to double mono
This patch adds build of blob downmix_stereo_to_mono.conf. It is useful for processing mono input for MFCC. The sum of left and right multiplied by 0.5 is passed to both left and right sink channels. The comment in blobs export is also updated to current path of the script. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 4f2c965 commit e6d3486

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

src/audio/selector/tune/sof_selector_blobs.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function sof_selector_blobs()
2323
IPC4_CHANNEL_CONFIG_STEREO = 1;
2424
IPC4_CHANNEL_CONFIG_QUATRO = 5;
2525
IPC4_CHANNEL_CONFIG_5_POINT_1 = 8;
26+
IPC4_CHANNEL_CONFIG_DUAL_MONO = 9;
2627
IPC4_CHANNEL_CONFIG_7_POINT_1 = 12;
2728

2829
% Matrix for 1:1 pass-through
@@ -39,6 +40,16 @@ function sof_selector_blobs()
3940
sel.coeffs(1, 2) = 0.7071;
4041
stereo_to_mono_pack8 = write_blob(sel, "downmix_stereo_to_mono");
4142

43+
% Stereo to dual-mono downmix
44+
sel.ch_count = [2 2];
45+
sel.ch_config = [IPC4_CHANNEL_CONFIG_STEREO IPC4_CHANNEL_CONFIG_DUAL_MONO];
46+
sel.coeffs = zeros(8,8);
47+
sel.coeffs(1, 1) = 0.5;
48+
sel.coeffs(1, 2) = 0.5;
49+
sel.coeffs(2, 1) = 0.5;
50+
sel.coeffs(2, 2) = 0.5;
51+
stereo_to_doublemono_pack8 = write_blob(sel, "downmix_stereo_to_doublemono");
52+
4253
% 5.1 to stereo downmix
4354
sel.ch_count = [6 2];
4455
sel.ch_config = [IPC4_CHANNEL_CONFIG_5_POINT_1 IPC4_CHANNEL_CONFIG_STEREO];
@@ -189,7 +200,7 @@ function write_8bit_packed(pack8, blobname)
189200
blob8 = sof_selector_build_blob(pack8);
190201
str_config = "selector_config";
191202
str_exported = "Exported with script sof_selector_blobs.m";
192-
str_howto = "cd tools/tune/selector; octave sof_selector_blobs.m";
203+
str_howto = "cd src/audio/selector/tune; octave sof_selector_blobs.m";
193204
sof_tools = '../../../../tools';
194205
sof_tplg = fullfile(sof_tools, 'topology');
195206
sof_tplg_selector = fullfile(sof_tplg, 'topology2/include/components/micsel');
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Exported with script sof_selector_blobs.m 21-May-2026
2+
# cd src/audio/selector/tune; octave sof_selector_blobs.m
3+
Object.Base.data."selector_config" {
4+
bytes "
5+
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
6+
0x84,0x00,0x00,0x00,0x01,0xd0,0x01,0x03,
7+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
9+
0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,
10+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
11+
0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,
12+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
13+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
14+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
15+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
16+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
18+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
19+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
20+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
21+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
22+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
23+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
24+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
25+
0x00,0x00,0x00,0x00"
26+
}

0 commit comments

Comments
 (0)