Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/audio/selector/tune/sof_selector_blobs.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function sof_selector_blobs()
IPC4_CHANNEL_CONFIG_STEREO = 1;
IPC4_CHANNEL_CONFIG_QUATRO = 5;
IPC4_CHANNEL_CONFIG_5_POINT_1 = 8;
IPC4_CHANNEL_CONFIG_DUAL_MONO = 9;
IPC4_CHANNEL_CONFIG_7_POINT_1 = 12;

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

% Stereo to dual-mono downmix
sel.ch_count = [2 2];
sel.ch_config = [IPC4_CHANNEL_CONFIG_STEREO IPC4_CHANNEL_CONFIG_DUAL_MONO];
sel.coeffs = zeros(8,8);
sel.coeffs(1, 1) = 0.5;
sel.coeffs(1, 2) = 0.5;
sel.coeffs(2, 1) = 0.5;
sel.coeffs(2, 2) = 0.5;
stereo_to_doublemono_pack8 = write_blob(sel, "downmix_stereo_to_doublemono");

% 5.1 to stereo downmix
sel.ch_count = [6 2];
sel.ch_config = [IPC4_CHANNEL_CONFIG_5_POINT_1 IPC4_CHANNEL_CONFIG_STEREO];
Expand Down Expand Up @@ -189,7 +200,7 @@ function write_8bit_packed(pack8, blobname)
blob8 = sof_selector_build_blob(pack8);
str_config = "selector_config";
str_exported = "Exported with script sof_selector_blobs.m";
str_howto = "cd tools/tune/selector; octave sof_selector_blobs.m";
str_howto = "cd src/audio/selector/tune; octave sof_selector_blobs.m";
sof_tools = '../../../../tools';
sof_tplg = fullfile(sof_tools, 'topology');
sof_tplg_selector = fullfile(sof_tplg, 'topology2/include/components/micsel');
Expand Down
2 changes: 1 addition & 1 deletion tools/topology/topology2/cavs-sdw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<host-gateway-playback.conf>
<host-gateway-capture.conf>
<host-gateway-tdfb-drc-capture.conf>
<host-gateway-src-mfcc-capture.conf>
<host-gateway-src-micsel-mfcc-capture.conf>
<src.conf>
<io-gateway.conf>
<io-gateway-capture.conf>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Exported with script sof_selector_blobs.m 21-May-2026
# cd src/audio/selector/tune; octave sof_selector_blobs.m
Object.Base.data."selector_config" {
bytes "
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
0x84,0x00,0x00,0x00,0x01,0xd0,0x01,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#
# SRC-Micsel-MFCC capture pipeline
#
# This class provides host pipeline for capture with MFCC audio features input.
# All attributes defined herein are namespaced by alsatplg to
# "Object.Pipeline.host-gateway-src-micsel-mfcc-capture.N.attribute_name".
#
# Usage: host-gateway-src-micsel-mfcc-capture pipeline object can be instantiated as:
#
# Object.Pipeline.host-gateway-src-micsel-mfcc-capture."N" {
# period 1000
# time_domain "timer"
# }
#
# Where N is the unique pipeline ID within the same alsaconf node.
#

<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/components/pipeline.conf>
<include/components/host-copier.conf>
<include/components/src.conf>
Comment on lines +18 to +22
<include/components/micsel.conf>
<include/components/mfcc.conf>

Class.Pipeline."host-gateway-src-micsel-mfcc-capture" {

<include/pipelines/pipeline-common.conf>

attributes {
!constructor [
"index"
]

#
# host-gateway-src-micsel-mfcc-capture objects instantiated within the
# same alsaconf node must have unique pipeline_id attribute
#
unique "instance"
}

Object.Widget {
src."1" {
num_input_pins 1
num_output_pins 1
num_input_audio_formats 3
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
in_rate 48000
}
{
in_bit_depth 32
in_valid_bit_depth 32
in_rate 96000
}
{
in_bit_depth 32
in_valid_bit_depth 32
in_rate 192000
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
out_rate 16000
}
]
}

micsel."1" {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
in_rate 16000
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
out_rate 16000
Comment thread
singalsu marked this conversation as resolved.
out_channels 2
out_ch_cfg $CHANNEL_CONFIG_DUAL_MONO
}
]
}

mfcc."1" {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
in_rate 16000
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
out_rate 16000
}
]
}

host-copier."1" {
type "aif_out"
node_type $HDA_HOST_INPUT_CLASS
num_input_pins 1
num_output_pins 1
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
in_rate 16000
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
out_rate 16000
}
]
}

pipeline."1" {
priority 0
lp_mode 0
}
}


Object.Base {
!route [
{
source src.$index.1
sink micsel.$index.1
}
{
source micsel.$index.1
sink mfcc.$index.1
}
]
}

direction "capture"
dynamic_pipeline 1
time_domain "timer"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Define {
SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID 131
}

Object.Pipeline.host-gateway-src-mfcc-capture [
Object.Pipeline.host-gateway-src-micsel-mfcc-capture [
{
index $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PIPELINE_ID

Expand All @@ -15,6 +15,15 @@ Object.Pipeline.host-gateway-src-mfcc-capture [
pcm_id $SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_ID
}

Object.Widget.micsel.1 {
Object.Control {
bytes."1" {
name "$SDW_DMIC_AUDIO_FEATURE_CAPTURE_PCM_NAME Micsel bytes"
<include/components/micsel/downmix_stereo_to_doublemono.conf>
}
}
}

Object.Widget.mfcc.1 {
Object.Control {
bytes."1" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Define {
SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID 130
}

Object.Pipeline.host-gateway-src-mfcc-capture [
Object.Pipeline.host-gateway-src-micsel-mfcc-capture [
{
index $SDW_JACK_AUDIO_FEATURE_CAPTURE_PIPELINE_ID

Expand All @@ -15,6 +15,15 @@ Object.Pipeline.host-gateway-src-mfcc-capture [
pcm_id $SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_ID
}

Object.Widget.micsel.1 {
Object.Control {
bytes."1" {
name "$SDW_JACK_AUDIO_FEATURE_CAPTURE_PCM_NAME Micsel bytes"
<include/components/micsel/downmix_stereo_to_doublemono.conf>
}
}
}

Object.Widget.mfcc.1 {
Object.Control {
bytes."1" {
Expand Down
Loading