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
1 change: 1 addition & 0 deletions tools/topology/topology2/cavs-sdw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<ssp.conf>
<bt-default.conf>
<deep-buffer-default.conf>
<siggen-host-copier-capture.conf>

Define {
PLATFORM "none"
Expand Down
10 changes: 10 additions & 0 deletions tools/topology/topology2/development/tplg-targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,14 @@ 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"

# RT721 eval board with PCH-DMIC, sof_sdw_quirk_table with SOC_SDW_PCH_DMIC
# Enable echo reference capture from jack and speaker output
"cavs-sdw\;sof-ptl-rt721-4ch-echoref\;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-echoref.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,SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true"
)
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ Define {
SSP_BLOB_VERSION_3_0 0x300

PCM_FORMAT_ALL false # Basic s16/s24/s32, no float, 8-bit etc.
SDW_JACK_ECHO_REF false # No echo reference for 3.5mm jack
SDW_SPK_ECHO_REF false # No echo reference for speaker
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#
# Siggen capture pipeline
#
# This class provides host pipeline for capture with siggen input. All
# attributes defined herein are namespaced by alsatplg to
# "Object.Pipeline.siggen-host-copier-capture.N.attribute_name".
#
# Usage: siggen-host-copier-capture pipeline object can be instantiated as:
#
# Object.Pipeline.siggen-host-copier-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/siggen.conf>

Class.Pipeline."siggen-host-copier-capture" {

<include/pipelines/pipeline-common.conf>

attributes {
!constructor [
"index"
]

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

Object.Widget {
siggen."1" {
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
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}

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 3
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}

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

direction "capture"
dynamic_pipeline 1
time_domain "timer"
}
202 changes: 165 additions & 37 deletions tools/topology/topology2/platform/intel/sdw-amp-generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Define {
AMP_FEEDBACK_CH_PER_LINK 2
SDW_AMP_FEEDBACK true
AMP_PLAYBACK_NAME 'Speaker Playback'
SDW_SPK_ECHO_REF_PCM_ID 12
}

Object.Dai.ALH [
Expand Down Expand Up @@ -636,44 +637,76 @@ Object.PCM.pcm [
]

IncludeByKey.PASSTHROUGH {
"false" {
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
"true" {
Object.Base.route [
{
source "drc.21.1"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
"false" {
Object.Base.route [
{
source "gain.21.1"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
}
Object.Base.route [
{
source 'mixin.20.1'
sink 'mixout.21.1'
}
{
source 'host-copier.2.playback'
sink 'gain.20.1'
}
]
}
"true" {
Object.Base.route [
{
source "host-copier.2.playback"
sink "alh-copier.$SDW_SPK_STREAM.0"
"false" {
IncludeByKey.SDW_SPK_ECHO_REF {
"true" {
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
"true" {
Object.Base.route [
{
source "drc.21.1"
sink "module-copier.21.22"
}
{
source "module-copier.21.22"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
"false" {
Object.Base.route [
{
source "gain.21.1"
sink "module-copier.21.22"
}
{
source "module-copier.21.22"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
}
}
"false" {
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
"true" {
Object.Base.route [
{
source "drc.21.1"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
"false" {
Object.Base.route [
{
source "gain.21.1"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
}
}
}
]
}
Object.Base.route [
{
source 'mixin.20.1'
sink 'mixout.21.1'
}
{
source 'host-copier.2.playback'
sink 'gain.20.1'
}
]
}
"true" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@singalsu no need to change this PR, but @ranj063 @jsarha I was wondering if we started adding inline comments to there branches line the C conventions for ifdefs, would that make the nested conditional segments a bit more easy to follow. E.g. here on L702 "# PASSTHROUGH==true " and then the definition. What do you think?

Copy link
Collaborator Author

@singalsu singalsu Dec 18, 2025

Choose a reason for hiding this comment

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

I think it would be good. I'm quite confused with long chunks of stuff. And our indents also are not always right.

Object.Base.route [
{
source "host-copier.2.playback"
sink "alh-copier.$SDW_SPK_STREAM.0"
}
]
}
}

IncludeByKey.SDW_AMP_FEEDBACK {
Expand Down Expand Up @@ -885,3 +918,98 @@ IncludeByKey.SDW_AMP_FEEDBACK {
]
}
}

IncludeByKey.SDW_SPK_ECHO_REF {
"true" {
Object.Widget.alh-copier [
{
stream_name "Loopback_Virtual"
direction "capture"
type "dai_out"
index 22
dai_index 25
node_type $ALH_LINK_INPUT_CLASS
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth $SDW_LINK_VALID_BITS
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The alh-copier input_audio_format block (lines 936-939) is missing the in_rate field, while the output_audio_format block at line 944 includes out_bit_depth and out_valid_bit_depth. For consistency with the jack configuration and to ensure complete audio format specification, consider adding the in_rate field.

Suggested change
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
in_rate 48000

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We operate the speaker pipelines with the default rate (48 kHz) from classes. It should be added everywhere in the large topology fragment, so not doing it unless we add other rates options for speaker.

}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The output_audio_format block (lines 944-945) is missing the out_rate field. For consistency with the jack configuration (line 634) and completeness of the audio format specification, consider adding the out_rate field.

Suggested change
out_bit_depth 32
out_bit_depth 32
out_rate 48000

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same, not adding rates to speaker.

out_valid_bit_depth 32
}
]
}
]

Object.Widget.module-copier."22" {
index 21
num_input_pins 1
num_output_pins 2
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}

Object.Pipeline {
siggen-host-copier-capture [
{
direction "capture"
index 22
Object.Widget.host-copier."1" {
stream_name "Speaker Echo Reference"
pcm_id $SDW_SPK_ECHO_REF_PCM_ID
}
Object.Widget.siggen."1" {}
}
]
}

Object.PCM.pcm [
{
name "Speaker Echo Reference"
id $SDW_SPK_ECHO_REF_PCM_ID
direction "capture"
Object.Base.fe_dai.1 {
name "Speaker Echo Reference"
}
Object.PCM.pcm_caps.1 {
name "Speaker Echo Reference"
formats 'S16_LE,S24_LE,S32_LE'
}
}
]

Object.Base.route [
{
source "alh-copier.Loopback_Virtual.25"
sink "siggen.22.1"
}
{
source "module-copier.21.22"
sink "siggen.22.1"
}
{
source "siggen.22.1"
sink "host-copier.$SDW_SPK_ECHO_REF_PCM_ID.capture"
}
]
} # SDW_SPK_ECHO_REF true
}
Loading