From 2cad1764e4c6ef2ca3b498e67acb787d3170d886 Mon Sep 17 00:00:00 2001 From: "Joe.Cheng" Date: Wed, 11 May 2022 14:14:32 +0800 Subject: [PATCH] topology1:renoir:add DTS topology Add topology pipe-dts-codec-playback to support Renoir platform Signed-off-by: Joe.Cheng --- tools/topology/topology1/CMakeLists.txt | 1 + .../topology1/sof-rn-rt5682-rt1019.m4 | 3 +- .../topology1/sof/pipe-dts-codec-playback.m4 | 81 +++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 tools/topology/topology1/sof/pipe-dts-codec-playback.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index d708f8aa4..9b41be03a 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -241,6 +241,7 @@ set(TPLGS "sof-acp-renoir\;sof-acp" "sof-rn-rt5682-rt1019\;sof-rn-rt5682-rt1019" + "sof-rn-rt5682-rt1019\;sof-rn-rt5682-rt1019-dts\;-DDTS=`DTS'" "sof-rn-rt5682-max98360\;sof-rn-rt5682-max98360" "sof-acp-rmb\;sof-acp-rmb" "sof-acp-rmb\;sof-rmb-rt5682s-rt1019" diff --git a/tools/topology/topology1/sof-rn-rt5682-rt1019.m4 b/tools/topology/topology1/sof-rn-rt5682-rt1019.m4 index 4b379aaa5..039572c08 100644 --- a/tools/topology/topology1/sof-rn-rt5682-rt1019.m4 +++ b/tools/topology/topology1/sof-rn-rt5682-rt1019.m4 @@ -20,7 +20,8 @@ include(`platform/amd/acp.m4') # Playback pipeline 1 on PCM 0 using max 2 channels of s16le. # Schedule 96 frames per 2000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4, +PIPELINE_PCM_ADD( +ifdef(`DTS', sof/pipe-dts-codec-playback.m4, sof/pipe-passthrough-playback.m4), 1, 0, 2, s16le, 2000, 0, 0, 48000, 48000, 48000) diff --git a/tools/topology/topology1/sof/pipe-dts-codec-playback.m4 b/tools/topology/topology1/sof/pipe-dts-codec-playback.m4 new file mode 100644 index 000000000..a29d8bdd1 --- /dev/null +++ b/tools/topology/topology1/sof/pipe-dts-codec-playback.m4 @@ -0,0 +1,81 @@ +# Low Latency Passthrough with DTS codec Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_P --> B0 --> DTS codec --> B1 --> sink DAI0 + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`codec_adapter.m4') +include(`bytecontrol.m4') + +# +# Controls +# + +# +# DTS Codec +# + +include(`dts_codec_adapter.m4') + +# +# Components and Buffers +# + +ifdef(`CA_SCHEDULE_CORE',`', `define(`CA_SCHEDULE_CORE', `SCHEDULE_CORE')') + +# Host "Playback with codec adapter" PCM +# with DAI_PERIODS sink and 0 source periods +W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, DAI_PERIODS, 0, SCHEDULE_CORE) + +W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, CA_SCHEDULE_CORE, + LIST(` ', "CA_SETUP_CONTROLBYTES_NAME_PIPE", "CA_RUNTIME_CONTROLBYTES_NAME_PIPE")) + +# Playback Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_HOST_MEM_CAP) +W_BUFFER(1, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) + +# +# Pipeline Graph +# +# host PCM_P --> B0 --> CODEC_ADAPTER -> B1 --> sink DAI0 + +P_GRAPH(pipe-pass-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', + `dapm(N_CODEC_ADAPTER(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_CODEC_ADAPTER(0))')) + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID) + +# +# PCM Configuration +# + +PCM_CAPABILITIES(Passthrough Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) + +undefine(`CA_RUNTIME_CONTROLBYTES_NAME_PIPE') +undefine(`CA_RUNTIME_PARAMS') +undefine(`CA_SETUP_CONTROLBYTES_NAME_PIPE') +undefine(`CA_SETUP_PARAMS') + +undefine(`CA_SCHEDULE_CORE') +undefine(`CA_RUNTIME_CONTROLBYTES_NAME') +undefine(`CA_SETUP_CONTROLBYTES_NAME') +undefine(`CA_RUNTIME_CONTROLBYTES_MAX') +undefine(`CA_RUNTIME_CONTROLBYTES') +undefine(`CA_SETUP_CONTROLBYTES_MAX') +undefine(`CA_SETUP_CONTROLBYTES')