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
1 change: 1 addition & 0 deletions tools/topology/topology2/cavs-sdw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<gain-capture.conf>
<gain-copier-capture.conf>
<deepbuffer-playback.conf>
<deepbuffer-capture.conf>
<host-gateway-playback.conf>
<host-gateway-capture.conf>
<host-gateway-tdfb-drc-capture.conf>
Expand Down
18 changes: 18 additions & 0 deletions tools/topology/topology2/development/tplg-targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,22 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt721-4ch-allfmt.bin,DMIC0_ENHANCED_CAPTURE=true,\
EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,PCM_FORMAT_ALL=true"

# Deep buffer DMIC0
"sof-hda-generic\;sof-hda-generic-2ch-dmicdeepbuf\;HDA_CONFIG=mix,\
NUM_DMICS=2,DMIC0_DEEP_BUFFER=true,DEEPBUFFER_FW_DMA_MS=10,DMIC0_ENHANCED_CAPTURE=true,\
EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default"

"sof-hda-generic\;sof-hda-generic-4ch-dmicdeepbuf\;HDA_CONFIG=mix,\
NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_DEEP_BUFFER=true,DEEPBUFFER_FW_DMA_MS=10,\
DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default"

# Deep buffer DMIC0 with RT721 eval board with PCH-DMIC
"cavs-sdw\;sof-ptl-rt721-4ch-dmicdeepbuf\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,\
PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=5,DMIC1_ID=6,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt721-4ch-dmicdeepbuf.bin,\
DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,DMIC0_DEEP_BUFFER=true"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#
# FE capture pipeline: deepbuffer-capture
#
# All attributes defined herein are namespaced
# by alsatplg to "Object.Pipeline.deepbuffer-capture.N.attribute_name"
#
# Usage: deepbuffer-capture pipeline object can be instantiated as:
#
# Object.Pipeline.deepbuffer-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/host-copier.conf>
<include/components/pipeline.conf>

Class.Pipeline."deepbuffer-capture" {

<include/pipelines/pipeline-common.conf>

attributes {
!constructor [
"index"
]

!immutable [
"direction"
]

#
# deepbuffer-capture objects instantiated within the same alsaconf node must have
# unique pipeline_id attribute
#
unique "instance"
}

Object.Widget {
host-copier."1" {
type "aif_out"
node_type $HDA_HOST_INPUT_CLASS
deep_buffer_dma_ms $DEEPBUFFER_FW_DMA_MS
num_input_pins 1
num_input_audio_formats 2
num_output_audio_formats 6
# Input sample format is always 32-bit for capture
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_bit_depth 32
in_valid_bit_depth 32
in_channels 4
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
in_ch_map $CHANNEL_MAP_3_POINT_1
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_bit_depth 32
out_valid_bit_depth 32
}
{
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_bit_depth 32
out_valid_bit_depth 24
out_channels 4
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
{
out_bit_depth 32
out_valid_bit_depth 32
out_channels 4
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
{
out_bit_depth 16
out_valid_bit_depth 16
out_channels 4
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
]
}

pipeline."1" {
priority 0
# enable lp mode
lp_mode 1
}
}

direction "capture"
dynamic_pipeline 1
time_domain "timer"
}
117 changes: 117 additions & 0 deletions tools/topology/topology2/platform/intel/dmic-deep-buffer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
Object.Pipeline.deepbuffer-capture [
{
format $FORMAT
index $DMIC0_DEEP_BUFFER_PIPELINE_ID
Object.Widget.pipeline.1 {
stream_name "$DMIC0_DEEP_BUFFER_PCM_NAME"
}
Object.Widget.host-copier.1 {
stream_name $DMIC0_DEEP_BUFFER_PCM_NAME
pcm_id $DMIC0_DEEP_BUFFER_PCM_ID
num_input_audio_formats 2
Object.Base.input_audio_format [
{
in_rate $DMIC0_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate $DMIC0_RATE
in_channels 4
in_bit_depth 32
in_valid_bit_depth 32
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
in_ch_map $CHANNEL_MAP_3_POINT_1
}
]

num_output_audio_formats 6
Object.Base.output_audio_format [
{
out_rate $DMIC0_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_rate $DMIC0_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_rate $DMIC0_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
{
out_rate $DMIC0_RATE
out_channels 4
out_bit_depth 16
out_valid_bit_depth 16
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
{
out_rate $DMIC0_RATE
out_channels 4
out_bit_depth 32
out_valid_bit_depth 24
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
{
out_rate $DMIC0_RATE
out_channels 4
out_bit_depth 32
out_valid_bit_depth 32
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
]
}
}

]
Object.PCM.pcm [
{
name "$DMIC0_DEEP_BUFFER_PCM_NAME"
id $DMIC0_DEEP_BUFFER_PCM_ID
direction "capture"
capture_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE

Object.Base.fe_dai."$DMIC0_DEEP_BUFFER_PCM_NAME" {}

Object.PCM.pcm_caps."capture" {
name $DMIC0_DEEP_BUFFER_PCM_NAME
formats 'S16_LE,S24_LE,S32_LE'
channels_min $NUM_DMICS
channels_max $NUM_DMICS
# To avoid DMA spinning on a buffer we need bigger
# buffer than the host buffer size, let's say twice as
# big
# (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2
#
# Note: The lower limit for the buffer size is rate
# dependent
IncludeByKey.DMIC0_RATE {
"16000" {
buffer_size_min "$[(((2 * $NUM_DMICS) * 16) * $DEEPBUFFER_FW_DMA_MS) * 2]"
rates '16000'
}
"48000" {
buffer_size_min "$[(((2 * $NUM_DMICS) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]"
rates '48000'
}
"96000" {
buffer_size_min "$[(((2 * $NUM_DMICS) * 96) * $DEEPBUFFER_FW_DMA_MS) * 2]"
rates '96000'
}
}
}
}
]
Object.Base.route [
{
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The route configuration references 'module-copier.$DMIC0_DAI_PIPELINE_ID.2' but there is no comment explaining what the '.2' suffix represents or why this specific instance is used. Adding a brief comment would improve maintainability.

Suggested change
{
{
# The '.2' suffix refers to the second instance of the module-copier for this pipeline,
# which is used for deep buffer capture in the DMIC pipeline.

Copilot uses AI. Check for mistakes.
source "module-copier.$DMIC0_DAI_PIPELINE_ID.2"
sink "host-copier.$DMIC0_DEEP_BUFFER_PCM_ID.capture"
}
]
6 changes: 6 additions & 0 deletions tools/topology/topology2/platform/intel/dmic-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ Define {

# Note: This will be redefined in dmic-generic.conf if not set from cmake
DMIC0_PCM_CHANNELS 0

# Deep buffer capture
DMIC0_DEEP_BUFFER_PCM_NAME "DMIC Deep Buffer"
DMIC0_DEEP_BUFFER_PIPELINE_ID 18
DMIC0_DEEP_BUFFER_PCM_ID 46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Longterm, do we have a topology file that lists all PCM IDs ? Not a blocker now.

DMIC0_DEEP_BUFFER false
}
4 changes: 4 additions & 0 deletions tools/topology/topology2/platform/intel/dmic-generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,10 @@ Object.PCM.pcm [
}
]

IncludeByKey.DMIC0_DEEP_BUFFER {
"true" "platform/intel/dmic-deep-buffer.conf"
}

IncludeByKey.DMIC1_ENABLE {
"passthrough" "platform/intel/dmic1-passthrough.conf"
"mfcc" "platform/intel/dmic1-mfcc.conf"
Expand Down
1 change: 1 addition & 0 deletions tools/topology/topology2/sof-hda-generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<dai-copier-gain-eqiir-module-copier-capture.conf>
<gain-capture.conf>
<deepbuffer-playback.conf>
<deepbuffer-capture.conf>
<io-gateway.conf>
<io-gateway-capture.conf>
<highpass-capture-be.conf>
Expand Down
Loading