Skip to content
Merged
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
22 changes: 21 additions & 1 deletion tools/topology/topology2/cavs-rt5682.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<host-copier-gain-mixin-playback.conf>
<mixout-gain-dai-copier-playback.conf>
<deepbuffer-playback.conf>
<dai-copier-be.conf>
<data.conf>
<pcm.conf>
<pcm_caps.conf>
Expand Down Expand Up @@ -70,6 +71,12 @@ Define {
SPEAKER_PLAYBACK_PCM_STREAM_NAME 'Speaker Playback'
SPEAKER_SSP_DAI_INDEX 1
SPEAKER_HW_CONFIG_NAME 'SPEAKER HWCFG'
INCLUDE_ECHO_REF false
ECHO_REF_HOST_PIPELINE_ID 7
ECHO_REF_DAI_PIPELINE_ID 8
ECHO_REF_HOST_PIPELINE_SINK 'copier.host.7.1'
ECHO_REF_DAI_PIPELINE_SRC 'copier.SSP.8.1'
ECHO_REF_COPIER_MODULE 'copier.module.8.2'
}

# override defaults with platform-specific config
Expand All @@ -91,6 +98,11 @@ IncludeByKey.NUM_HDMIS {
IncludeByKey.DEEPBUFFER_FW_DMA_MS{
"[1-1000]" "platform/intel/deep-buffer.conf"
}

IncludeByKey.INCLUDE_ECHO_REF {
"true" "platform/intel/speaker-echo-ref.conf"
}

#
# List of all DAIs
#
Expand All @@ -116,7 +128,15 @@ Object.Dai {
SSP."1" {
id $SPK_ID
dai_index $SPEAKER_SSP_DAI_INDEX
direction "playback"
IncludeByKey.INCLUDE_ECHO_REF {
"false" {
direction "playback"
}
"true" {
direction "duplex"
quirks "lbm_mode"
}
}
name $SPEAKER_CODEC_NAME
default_hw_conf_id 0
sample_bits 32
Expand Down
102 changes: 102 additions & 0 deletions tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#
# BE DAI copier pipeline
#
# All attributes defined herein are namespaced by alsatplg to
# "Object.Pipeline.dai-copier-be.N.attribute_name"
#
# Usage: dai-copier-be pipeline object can be instantiated as:
#
# Object.Pipeline.dai-copier-be."N" {
# period 1000
# time_domain "timer"
# channels 2
# rate 48000
# }
#
# Where N is the unique pipeline ID within the same alsaconf node.
#

<include/common/audio_format.conf>
<include/components/copier.conf>
<include/components/pipeline.conf>

Class.Pipeline."dai-copier-be" {

DefineAttribute."index" {}

<include/pipelines/pipeline-common.conf>

attributes {
!constructor [
"index"
]

unique "instance"
}

Object.Widget {
copier."1" {
type dai_in
node_type $HDA_LINK_OUTPUT_CLASS
num_audio_formats 3
# 32-bit 48KHz 2ch
Object.Base.audio_format.1 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
dma_buffer_size "$[$obs * 2]"
}
# 32-bit 48KHz 4ch
Object.Base.audio_format.2 {
in_channels 4
in_bit_depth 32
in_valid_bit_depth 32
out_channels 4
out_bit_depth 32
out_valid_bit_depth 32
dma_buffer_size "$[$obs * 2]"
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
in_ch_map $CHANNEL_MAP_3_POINT_1
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
}
# 24-bit 48KHz 2ch
Object.Base.audio_format.3 {
in_bit_depth 32
in_valid_bit_depth 24
out_bit_depth 32
out_valid_bit_depth 24
dma_buffer_size "$[$obs * 2]"
}
}

copier."2" {
type buffer
copier_type "module"
num_audio_formats 1

Object.Base.audio_format.1 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
dma_buffer_size "$[$ibs * 2]"
}
}

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

time_domain "timer"
dynamic_pipeline 1
channels 2
channels_min 2
channels_max 2
rate 48000
rate_min 48000
rate_max 48000
}
58 changes: 58 additions & 0 deletions tools/topology/topology2/platform/intel/speaker-echo-ref.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Define {
ECHO_REF_STREAM_NAME "Echo reference"
}

Object.Pipeline {
passthrough-capture.2 {
index $ECHO_REF_HOST_PIPELINE_ID

Object.Widget.copier.1 {
stream_name $ECHO_REF_STREAM_NAME
}
}

dai-copier-be.2 {
index $ECHO_REF_DAI_PIPELINE_ID

Object.Widget.copier."1" {
dai_index 1
dai_type "SSP"
type dai_out
copier_type "SSP"
stream_name $SPEAKER_CODEC_NAME
node_type $I2S_LINK_INPUT_CLASS
Object.Base.audio_format.1 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
dma_buffer_size "$[$ibs * 2]"
}
}
}
}

Object.PCM {
pcm."2" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

BTW @yongzhi1 if you want to give it a try. you can start your object instances from 1 for the pcm and routes in this conf file with this PR alsa-project/alsa-utils#188. The compiler will take care of avoiding clashes with the top-level file objects

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lets do this as part of the topology2 feature cleanup. @jsarha fyi.

name "EchoRef"
id 27
direction "capture"
Object.Base.fe_dai.1 {}

Object.PCM.pcm_caps.1 {
name $ECHO_REF_STREAM_NAME
formats 'S16_LE,S24_LE,S32_LE'
}
}
}

Object.Base {
route."7" {
source $ECHO_REF_DAI_PIPELINE_SRC
sink $ECHO_REF_COPIER_MODULE
}
route."8" {
source $ECHO_REF_COPIER_MODULE
sink $ECHO_REF_HOST_PIPELINE_SINK
}
}
2 changes: 1 addition & 1 deletion tools/topology/topology2/sof-ace-tplg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DEEPBUFFER_FW_DMA_MS=100"
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-rt711-4ch.bin,DEEPBUFFER_FW_DMA_MS=100"

"cavs-rt5682\;sof-mtl-max98357a-rt5682\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10"
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,INCLUDE_ECHO_REF=true"

"cavs-rt5682\;sof-mtl-max98357a-rt5682-ssp2-ssp0\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
PDM1_MIC_B_ENABLE=1,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,\
Expand Down