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
302 changes: 302 additions & 0 deletions tools/topology/topology2/cavs-mixin-mixout-dax-ctc-ssp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
#
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge this into cavs-mixin-maxout-dax-ssp.conf, use USE_CTC_SPK to determine whether attaching CTC module or not

# Pipeline definitions
#
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> DAX ----> CTC ----> SSP0
# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> DAX ----> CTC ----> SSP1
#
# The gain before mixin is for the different routes(e.g., deepbuffer, headset).

Define {
DOLBY_DAX_CORE_ID 0
SSP_HEADSET_DAX "false"
}

<include/pipelines/cavs/mixout-gain-dax-ctc-dai-copier-playback.conf>

# Pipeline ID:1 PCM ID: 0
Object.Pipeline {
# playback pipelines
host-copier-gain-mixin-playback [
{
index $HEADSET_HOST_PIPELINE_ID

Object.Widget.host-copier.1 {
stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME'
pcm_id $HEADSET_PCM_ID
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Pre Mixer $HEADSET_PCM_NAME Playback Volume'
}
}
}
{
index $SPEAKER_HOST_PIPELINE_ID
core_id $SPEAKER_PCM_CORE_ID

Object.Widget.host-copier.1 {
stream_name '$SPEAKER_PLAYBACK_PCM_STREAM_NAME'
pcm_id $SPEAKER_PCM_ID
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Pre Mixer $SPEAKER_PCM_NAME Playback Volume'
}
}
Object.Widget.pipeline.1 {
core $SPEAKER_PCM_CORE_ID
}
}
]

IncludeByKey.SSP_HEADSET_DAX {
"true" {
mixout-gain-dax-dai-copier-playback [
{
index $HEADSET_DAI_PIPELINE_ID

Object.Widget.dai-copier.1 {
dai_index $HEADSET_SSP_DAI_INDEX
dai_type "SSP"
copier_type "SSP"
stream_name "$HEADSET_CODEC_NAME"
node_type $I2S_LINK_OUTPUT_CLASS
IncludeByKey.SSP_HS_FMT_24 {
"true" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 24
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
}
]
}
"false" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
}

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
}
}

Object.Widget.dolby-dax.1 {
core_id $DOLBY_DAX_CORE_ID
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 32
ibs "$[(256 * ($[($in_bit_depth / 8)])) * ($in_channels)]"
}
]
Object.Base.output_audio_format [
{
out_rate 48000
out_bit_depth 32
out_valid_bit_depth 32
obs "$[(256 * ($[($out_bit_depth / 8)])) * ($out_channels)]"
}
]
Object.Control {
mixer."1" {
name 'DAX Headphone Switch'
}
mixer."2" {
name 'DAX Headphone Switch CP'
}
mixer."3" {
name 'DAX Headphone Switch CTC'
}
mixer."4" {
name 'DAX Headphone Volume'
}
enum."1" {
name 'DAX Headphone Profile'
}
enum."2" {
name 'DAX Headphone Device'
}
bytes."1" {
name 'DAX Headphone Tuning'
max 8192
}
}
}
}
]
}
"false" {
mixout-gain-dai-copier-playback [
{
index $HEADSET_DAI_PIPELINE_ID

Object.Widget.dai-copier.1 {
dai_index $HEADSET_SSP_DAI_INDEX
dai_type "SSP"
copier_type "SSP"
stream_name "$HEADSET_CODEC_NAME"
node_type $I2S_LINK_OUTPUT_CLASS
IncludeByKey.SSP_HS_FMT_24 {
"true" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 24
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
}
]
}
"false" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
}

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
}
}
}
]
}
}

# For speaker, we want DAX -> CTC
mixout-gain-dax-ctc-dai-copier-playback [
{
index $SPEAKER_DAI_PIPELINE_ID
core_id $SPEAKER_PCM_CORE_ID

Object.Widget.dai-copier.1 {
dai_index $SPEAKER_SSP_DAI_INDEX
dai_type "SSP"
copier_type "SSP"
stream_name "$SPEAKER_CODEC_NAME"
node_type $I2S_LINK_OUTPUT_CLASS
IncludeByKey.SSP_SPK_FMT_24 {
"true" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 24
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
}
]
}
"false" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
}

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
}
}

Object.Widget.dolby-dax.1 {
core_id $DOLBY_DAX_CORE_ID
Object.Control {
mixer."1" {
name 'DAX Speaker Switch'
}
mixer."2" {
name 'DAX Speaker Switch CP'
}
mixer."3" {
name 'DAX Speaker Switch CTC'
}
mixer."4" {
name 'DAX Speaker Volume'
}
enum."1" {
name 'DAX Speaker Profile'
}
enum."2" {
name 'DAX Speaker Device'
}
bytes."1" {
name 'DAX Speaker Tuning'
max 8192
}
}
}

Object.Widget.ctc.1 {
Object.Control {
mixer."1" {
name 'CTC Switch'
}
bytes."1" {
name 'CTC.0'
max 4160
}
}
}

Object.Widget.pipeline.1 {
core $SPEAKER_PCM_CORE_ID
}
}
]
}

IncludeByKey.SSP_HEADSET_DAX {
"true" {
Object.Base.route [
{
source "dolby-dax.$HEADSET_DAI_PIPELINE_ID.1"
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
}
]
}
"false" {
Object.Base.route [
{
source "gain.$HEADSET_DAI_PIPELINE_ID.1"
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
}
]
}
}

Object.Base.route [
{
source "mixin.$HEADSET_HOST_PIPELINE_ID.1"
sink "mixout.$HEADSET_DAI_PIPELINE_ID.1"
}
{
source "ctc.$SPEAKER_DAI_PIPELINE_ID.1"
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
}
{
source "mixin.$SPEAKER_HOST_PIPELINE_ID.1"
sink "mixout.$SPEAKER_DAI_PIPELINE_ID.1"
}
]
20 changes: 20 additions & 0 deletions tools/topology/topology2/cavs-rt5682-dax-ctc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<cavs-rt5682.conf>

Define {
PLAYBACK_PIPELINE_SRC "none"
}

<cavs-mixin-mixout-dax-ctc-ssp.conf>

Object.Base {
!route [
{
source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture"
sink "host-copier.$HEADSET_PCM_ID.capture"
}
{
source "host-copier.$HEADSET_PCM_ID.playback"
sink "gain.1.1"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# BE playback pipeline: mixout-gain-dax-ctc-dai-copier-playback.
# This pipeline is an extension of the mixout-gain-dax-dai-copier-playback pipeline class.
#

<include/components/ctc.conf>
<include/pipelines/cavs/mixout-gain-dax-dai-copier-playback.conf>

Class.Pipeline."mixout-gain-dax-ctc-dai-copier-playback" {
SubTreeCopy.baseclass {
# this class extends the mixout-gain-dax-dai-copier-playback class definition
source "Class.Pipeline.mixout-gain-dax-dai-copier-playback"

tree {
Object.Widget {
ctc."1" {
num_input_audio_formats 1
num_output_audio_formats 1

Object.Base.input_audio_format [
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 32
ibs "$[(256 * ($[($in_bit_depth / 8)])) * ($in_channels)]"
}
]
Object.Base.output_audio_format [
{
out_rate 48000
out_bit_depth 32
out_valid_bit_depth 32
obs "$[(256 * ($[($out_bit_depth / 8)])) * ($out_channels)]"
}
]
}
}

Object.Base {
! route [
{
source dolby-dax.$index.1
sink ctc.$index.1
}
]
}
}
}
}
8 changes: 8 additions & 0 deletions tools/topology/topology2/production/tplg-targets-ace3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,18 @@ HDMI_IN_1_ID=0,HDMI_IN_2_ID=1"
NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,INCLUDE_ECHO_REF=true,\
BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true"

"cavs-rt5682\;sof-ptl-tas2563-rt5682-ctc\;PLATFORM=ptl,NUM_DMICS=2,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\
NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682-ctc.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,INCLUDE_ECHO_REF=true,\
BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=ctc"

"cavs-rt5682\;sof-ptl-tas2563-rt5682-dax\;PLATFORM=ptl,NUM_DMICS=2,DMIC0_PCM_ID=99,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682-dax.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,\
INCLUDE_ECHO_REF=true,BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true,\
PLAYBACK_PIPELINE_SRC=dax,DOLBY_DAX_CORE_ID=0"
"cavs-rt5682-dax-ctc\;sof-ptl-tas2563-rt5682-dax-ctc\;PLATFORM=ptl,NUM_DMICS=2,DMIC0_PCM_ID=99,\
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you should keep using "cavs-rt5682.conf". The variation can be handled by argument e.g. USE_CTC_SPK=true

PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682-dax-ctc.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,\
INCLUDE_ECHO_REF=true,BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true,\
DOLBY_DAX_CORE_ID=0"

# Split topologies
"cavs-sdw\;sof-ptl-dmic-2ch-id2\;PLATFORM=ptl,SDW_JACK=false,NUM_HDMIS=0,NUM_DMICS=2,\
Expand Down
Loading