From 15548a84429e939adb330585365c6c164f1e91db Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Tue, 23 Apr 2019 21:24:06 +0300 Subject: [PATCH] topology: add demux topology for apl and cml This topology will add a capture branch back from playback pipeline's mux component. It can be used for example as a echo cancellation reference signal. Signed-off-by: Jaska Uimonen --- tools/topology/CMakeLists.txt | 2 + tools/topology/m4/demux_coef_default.m4 | 11 + tools/topology/m4/muxdemux.m4 | 49 +++++ tools/topology/sof-apl-demux-pcm512x.m4 | 149 ++++++++++++++ tools/topology/sof-cml-demux-rt5682.m4 | 191 ++++++++++++++++++ tools/topology/sof/pipe-demux-playback.m4 | 80 ++++++++ .../sof/pipe-passthrough-capture-sched.m4 | 50 +++++ .../topology/sof/pipe-volume-capture-sched.m4 | 74 +++++++ 8 files changed, 606 insertions(+) create mode 100644 tools/topology/m4/demux_coef_default.m4 create mode 100644 tools/topology/m4/muxdemux.m4 create mode 100644 tools/topology/sof-apl-demux-pcm512x.m4 create mode 100644 tools/topology/sof-cml-demux-rt5682.m4 create mode 100644 tools/topology/sof/pipe-demux-playback.m4 create mode 100644 tools/topology/sof/pipe-passthrough-capture-sched.m4 create mode 100644 tools/topology/sof/pipe-volume-capture-sched.m4 diff --git a/tools/topology/CMakeLists.txt b/tools/topology/CMakeLists.txt index a76657386472..51bbd38e011d 100644 --- a/tools/topology/CMakeLists.txt +++ b/tools/topology/CMakeLists.txt @@ -37,6 +37,7 @@ set(TPLGS "sof-apl-tdf8532\;sof-apl-tdf8532" "sof-apl-pcm512x\;sof-apl-pcm512x" "sof-apl-pcm512x-nohdmi\;sof-apl-pcm512x-nohdmi" + "sof-apl-demux-pcm512x\;sof-apl-demux-pcm512x" "sof-apl-rt298\;sof-apl-rt298" "sof-apl-wm8804\;sof-apl-wm8804" "sof-apl-da7219\;sof-apl-da7219" @@ -54,6 +55,7 @@ set(TPLGS "sof-cml-rt5682\;sof-whl-rt5682\;-DPLATFORM=whl" "sof-cml-rt5682\;sof-icl-rt5682\;-DPLATFORM=icl" "sof-cml-src-rt5682\;sof-cml-src-rt5682" + "sof-cml-demux-rt5682\;sof-cml-demux-rt5682" "sof-cnl-nocodec\;sof-cnl-nocodec" "sof-cml-rt5682-max98357a\;sof-cml-rt5682-max98357a\;-DPLATFORM=cml" ) diff --git a/tools/topology/m4/demux_coef_default.m4 b/tools/topology/m4/demux_coef_default.m4 new file mode 100644 index 000000000000..503da3039f1b --- /dev/null +++ b/tools/topology/m4/demux_coef_default.m4 @@ -0,0 +1,11 @@ +CONTROLBYTES_PRIV(DEMUX_priv, +` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,' +` 0x28,0x00,0x00,0x00,0x00,0x60,0x00,0x03,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,' +` 0x01,0x00,0x00,0x00,0x02,0x01,0x02,0x04,' +` 0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,' +` 0x05,0x00,0x00,0x00,0x02,0x01,0x02,0x04,' +` 0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00"' +) diff --git a/tools/topology/m4/muxdemux.m4 b/tools/topology/m4/muxdemux.m4 new file mode 100644 index 000000000000..b1f7a8bd9fb9 --- /dev/null +++ b/tools/topology/m4/muxdemux.m4 @@ -0,0 +1,49 @@ +divert(-1) + +dnl Define macro for demux widget + +dnl Mux name) +define(`N_MUXDEMUX', `MUXDEMUX'PIPELINE_ID`.'$1) + +dnl W_MUXDEMUX(name, mux/demux, format, periods_sink, periods_source, kcontrol_list) +define(`W_MUXDEMUX', +`SectionVendorTuples."'N_MUXDEMUX($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($4) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($5) +` }' +`}' +`SectionData."'N_MUXDEMUX($1)`_data_w" {' +` tuples "'N_MUXDEMUX($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_MUXDEMUX($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($3) +` }' +`}' +`SectionVendorTuples."'N_MUXDEMUX($1)`_mux_process_tuples_str" {' +` tokens "sof_process_tokens"' +` tuples."string" {' +`ifelse(`$2', `0', ` SOF_TKN_PROCESS_TYPE' "MUX", ` SOF_TKN_PROCESS_TYPE' "DEMUX")' +` }' +`}' +`SectionData."'N_MUXDEMUX($1)`_data_str" {' +` tuples "'N_MUXDEMUX($1)`_tuples_str"' +` tuples "'N_MUXDEMUX($1)`_mux_process_tuples_str"' +`}' +`SectionWidget."'N_MUXDEMUX($1)`" {' +` index "'PIPELINE_ID`"' +` type "effect"' +` no_pm "true"' +` data [' +` "'N_MUXDEMUX($1)`_data_w"' +` "'N_MUXDEMUX($1)`_data_str"' +` ]' +` bytes [' + $6 +` ]' +`}') + +divert(0)dnl diff --git a/tools/topology/sof-apl-demux-pcm512x.m4 b/tools/topology/sof-apl-demux-pcm512x.m4 new file mode 100644 index 000000000000..bcd92f722010 --- /dev/null +++ b/tools/topology/sof-apl-demux-pcm512x.m4 @@ -0,0 +1,149 @@ +# +# Demux topology for generic Apollolake UP^2 with pcm512x codec and HDMI. +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`ssp.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Apollolake DSP configuration +include(`platform/intel/bxt.m4') + +DEBUG_START + +# +# Define the pipelines +# +# PCM0 ----> demux -----> SSP5 (pcm512x) +# PCM1 ----> volume -----> iDisp1 +# PCM2 ----> volume -----> iDisp2 +# PCM3 ----> volume -----> iDisp3 +# PCM4 <---- demux +# + +dnl PIPELINE_PCM_ADD(pipeline, +dnl pipe id, pcm, max channels, format, +dnl frames, deadline, priority, core) +# Demux pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-demux-playback.m4, + 1, 0, 2, s32le, + 48, 1000, 0, 0) + +# Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 2, 1, 2, s32le, + 48, 1000, 0, 0) + +# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 3, 2, 2, s32le, + 48, 1000, 0, 0) + +# Low Latency playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 4, 3, 2, s32le, + 48, 1000, 0, 0) + +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl frames, deadline, priority, core) + +# playback DAI is SSP5 using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 1, SSP, 5, SSP5-Codec, + PIPELINE_SOURCE_1, 2, s24le, + 48, 1000, 0, 0) + +# currently this dai is here as "virtual" capture backend +W_DAI_IN(SSP, 5, SSP5-Codec, s24le, 2, 0, 0) + +# Capture pipeline 5 from demux on PCM 5 using max 2 channels of s32le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture-sched.m4, + 5, 4, 2, s32le, + 48, 1000, 0, 0, 0, PIPELINE_PLAYBACK_SCHED_COMP_1) + +# Connect demux to capture +SectionGraph."PIPE_CAP" { + index "0" + + lines [ + # mux to capture + dapm(PIPELINE_SINK_5, PIPELINE_DEMUX_1) + ] +} + +# Connect virtual capture to dai +SectionGraph."PIPE_CAP_VIRT" { + index "5" + + lines [ + # mux to capture + dapm(ECHO REF 5, SSP5.IN) + ] +} + +# playback DAI is iDisp1 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 2, HDA, 0, iDisp1, + PIPELINE_SOURCE_2, 2, s32le, + 48, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp2 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 3, HDA, 1, iDisp2, + PIPELINE_SOURCE_3, 2, s32le, + 48, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp3 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 4, HDA, 2, iDisp3, + PIPELINE_SOURCE_4, 2, s32le, + 48, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# PCM Low Latency, id 0 +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +PCM_PLAYBACK_ADD(Port5, 0, PIPELINE_PCM_1) +PCM_PLAYBACK_ADD(HDMI1, 1, PIPELINE_PCM_2) +PCM_PLAYBACK_ADD(HDMI2, 2, PIPELINE_PCM_3) +PCM_PLAYBACK_ADD(HDMI3, 3, PIPELINE_PCM_4) +PCM_CAPTURE_ADD(EchoRef, 4, PIPELINE_PCM_5) + +# +# BE configurations - overrides config in ACPI if present +# + +#SSP 5 (ID: 0) +DAI_CONFIG(SSP, 5, 0, SSP5-Codec, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 5, 24))) + +# 3 HDMI/DP outputs (ID: 1,2,3) +DAI_CONFIG(HDA, 0, 1, iDisp1) +DAI_CONFIG(HDA, 1, 2, iDisp2) +DAI_CONFIG(HDA, 2, 3, iDisp3) + +DEBUG_END diff --git a/tools/topology/sof-cml-demux-rt5682.m4 b/tools/topology/sof-cml-demux-rt5682.m4 new file mode 100644 index 000000000000..be5006fba9e3 --- /dev/null +++ b/tools/topology/sof-cml-demux-rt5682.m4 @@ -0,0 +1,191 @@ +# +# Topology for Cometlake with rt5682 codec. +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`ssp.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Cannonlake DSP configuration +include(`platform/intel/cnl.m4') +include(`platform/intel/dmic.m4') + +DEBUG_START + +undefine(`SSP_INDEX') +define(`SSP_INDEX', ifelse(PLATFORM, `whl', `1', + ifelse(PLATFORM, `cml', `0', `'))) +undefine(`SSP_NAME') +define(`SSP_NAME', ifelse(PLATFORM, `whl', `SSP1-Codec', + ifelse(PLATFORM, `cml', `SSP0-Codec', `'))) + +# +# Define the pipelines +# +# PCM0 ----> demux ----> SSP(SSP_INDEX) +# PCM0 <---- volume <----- SSP(SSP_INDEX) +# PCM1 ----> volume -----> DMIC01 (dmic0 capture) +# PCM2 ----> volume -----> iDisp1 +# PCM3 ----> volume -----> iDisp2 +# PCM4 ----> volume -----> iDisp3 +# PCM5 <---- demux +# + +dnl PIPELINE_PCM_ADD(pipeline, +dnl pipe id, pcm, max channels, format, +dnl frames, deadline, priority, core) + +# Demux pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-demux-playback.m4, + 1, 0, 2, s24le, + 48, 1000, 0, 0) + +# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, + 2, 0, 2, s24le, + 48, 1000, 0, 0) + +# Passthrough capture pipeline 3 on PCM 1 using max 4 channels. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 3, 1, 4, s32le, + 48, 1000, 0, 0) + +# Low Latency playback pipeline 4 on PCM 2 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 4, 2, 2, s32le, + 48, 1000, 0, 0) + +# Low Latency playback pipeline 5 on PCM 3 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 7, 3, 2, s32le, + 48, 1000, 0, 0) + +# Low Latency playback pipeline 6 on PCM 4 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 6, 4, 2, s32le, + 48, 1000, 0, 0) + +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl frames, deadline, priority, core) + +# playback DAI is SSP(SPP_INDEX) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 1, SSP, SSP_INDEX, SSP_NAME, + PIPELINE_SOURCE_1, 2, s24le, + 48, 1000, 0, 0) + +# capture DAI is SSP(SSP_INDEX) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP,SSP_INDEX, SSP_NAME, + PIPELINE_SINK_2, 2, s24le, + 48, 1000, 0, 0) + +# Capture pipeline 5 on PCM 5 using max 2 channels of s32le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture-sched.m4, + 5, 5, 2, s32le, + 48, 1000, 0, 0) + +# Connect demux to capture +SectionGraph."PIPE_CAP" { + index "0" + + lines [ + # demux to capture + dapm(PIPELINE_SINK_5, PIPELINE_DEMUX_1) + ] +} + +# Connect virtual capture to dai +SectionGraph."PIPE_CAP_VIRT" { + index "5" + + lines [ + # mux to capture + dapm(ECHO REF 5, `SSP'SSP_INDEX`.IN') + ] +} + +# capture DAI is DMIC01 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 7, DMIC, 0, dmic01, + PIPELINE_SINK_3, 2, s32le, + 48, 1000, 0, 0) + +# playback DAI is iDisp1 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 4, HDA, 0, iDisp1, + PIPELINE_SOURCE_4, 2, s32le, + 48, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp2 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 5, HDA, 1, iDisp2, + PIPELINE_SOURCE_7, 2, s32le, + 48, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp3 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 6, HDA, 2, iDisp3, + PIPELINE_SOURCE_6, 2, s32le, + 48, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# PCM Low Latency, id 0 +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +PCM_DUPLEX_ADD(Port1, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) +PCM_CAPTURE_ADD(DMIC01, 1, PIPELINE_PCM_3) +PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_4) +PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_7) +PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_6) +PCM_CAPTURE_ADD(EchoRef, 5, PIPELINE_PCM_5) + +# +# BE configurations - overrides config in ACPI if present +# + +#SSP SSP_INDEX (ID: 0) +DAI_CONFIG(SSP, SSP_INDEX, 0, SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), + SSP_CLOCK(bclk, 2400000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 25, 3, 3), + SSP_CONFIG_DATA(SSP, SSP_INDEX, 24))) + +# dmic01 (ID: 1) +DAI_CONFIG(DMIC, 0, 1, dmic01, + DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000, + DMIC_WORD_LENGTH(s32le), DMIC, 0, + PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) + +# 3 HDMI/DP outputs (ID: 2,3,4) +DAI_CONFIG(HDA, 0, 2, iDisp1) +DAI_CONFIG(HDA, 1, 3, iDisp2) +DAI_CONFIG(HDA, 2, 4, iDisp3) + + +DEBUG_END diff --git a/tools/topology/sof/pipe-demux-playback.m4 b/tools/topology/sof/pipe-demux-playback.m4 new file mode 100644 index 000000000000..ec2e10b7ea3f --- /dev/null +++ b/tools/topology/sof/pipe-demux-playback.m4 @@ -0,0 +1,80 @@ +# Demux Pipeline +# +# Low Latency Playback with demux. +# +# Pipeline Endpoints for connection are :- +# +# Playback Demux +# B1 (DAI buffer) +# +# +# host PCM_P -- B0 --> Demux(M) -- B1--> sink DAI0 +# | +# pipeline n+1 --> DAI +# + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`pga.m4') +include(`muxdemux.m4') +include(`mixercontrol.m4') +include(`bytecontrol.m4') + +# Use default parameters +include(`demux_coef_default.m4') + +# demux Bytes control with max value of 255 +C_CONTROLBYTES(DEMUX, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), + , , , + CONTROLBYTES_MAX(, 304), + , + DEMUX_priv) +# +# Components and Buffers +# + +# Host "Low latency Playback" PCM +# with 2 sink and 0 source periods +W_PCM_PLAYBACK(PCM_ID, Low Latency Playback, 2, 0) + +# Mux 0 has 2 sink and source periods. +W_MUXDEMUX(0, 1, PIPELINE_FORMAT, 2, 2, LIST(` ', "DEMUX")) + +# Low Latency Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), + PLATFORM_HOST_MEM_CAP) +W_BUFFER(1, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,SCHEDULE_FRAMES), + PLATFORM_COMP_MEM_CAP) + +# +# Pipeline Graph +# +# host PCM_P --B0--> volume(0P) --B1--> Mux(M) --B2--> volume(LL) ---B3--> sink DAI0 + +P_GRAPH(pipe-ll-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', + `dapm(N_MUXDEMUX(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_MUXDEMUX(0))')) + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1)) +indir(`define', concat(`PIPELINE_DEMUX_', PIPELINE_ID), N_MUXDEMUX(0)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Playback PCM_ID) + +# +# PCM Configuration +# + + +# PCM capabilities supported by FW +PCM_CAPABILITIES(Low Latency Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) + diff --git a/tools/topology/sof/pipe-passthrough-capture-sched.m4 b/tools/topology/sof/pipe-passthrough-capture-sched.m4 new file mode 100644 index 000000000000..fe65f59b7f7e --- /dev/null +++ b/tools/topology/sof/pipe-passthrough-capture-sched.m4 @@ -0,0 +1,50 @@ +# Capture Passthrough Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <-- sink DAI0 + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`dai.m4') +include(`pipeline.m4') + +# +# Components and Buffers +# + +# Host "Passthrough Capture" PCM +# with 0 sink and 2 source periods +W_PCM_CAPTURE(PCM_ID, Passthrough Capture, 0, 2) + +# Capture Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), + PLATFORM_PASS_MEM_CAP) + +# Virtual output widget +VIRTUAL_WIDGET(ECHO REF PIPELINE_ID, out_drv, PIPELINE_ID) + +# +# Pipeline Graph +# +# host PCM_C <-- B0 <-- sink DAI0 + +P_GRAPH(pipe-pass-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMC(PCM_ID), N_BUFFER(0))', + `dapm(N_BUFFER(0), ECHO REF PIPELINE_ID)')) +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(0)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID) + +W_PIPELINE(N_PCMC(PCM_ID), SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_ll_schedule_plat) +# +# PCM Configuration +# + +PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, PIPELINE_CHANNELS, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) diff --git a/tools/topology/sof/pipe-volume-capture-sched.m4 b/tools/topology/sof/pipe-volume-capture-sched.m4 new file mode 100644 index 000000000000..04ac8d169599 --- /dev/null +++ b/tools/topology/sof/pipe-volume-capture-sched.m4 @@ -0,0 +1,74 @@ +# Passthrough with volume Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <-- Volume 0 <-- B1 <-- source DAI0 + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`pga.m4') +include(`dai.m4') +include(`mixercontrol.m4') +include(`pipeline.m4') + +# +# Controls +# +# Volume Mixer control with max value of 32 +C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + CONTROLMIXER_MAX(, 80), + false, + CONTROLMIXER_TLV(TLV 80 steps from -50dB to +30dB for 1dB, vtlv_m50s1), + Channel register and shift for Front Left/Right, + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1))) + +# +# Components and Buffers +# + +# Host "Passthrough Capture" PCM +# with 0 sink and 2 source periods +W_PCM_CAPTURE(PCM_ID, Passthrough Capture, 0, 2) + +# "Volume" has 2 source and 2 sink periods +W_PGA(0, PIPELINE_FORMAT, 2, 2, LIST(` ', "PIPELINE_ID Master Capture Volume")) + +# Capture Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), + PLATFORM_HOST_MEM_CAP) +W_BUFFER(1, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), + PLATFORM_DAI_MEM_CAP) + +# Virtual output widget +VIRTUAL_WIDGET(ECHO REF PIPELINE_ID, out_drv, PIPELINE_ID) + +# +# Pipeline Graph +# +# host PCM_P <-- B0 <-- Volume 0 <-- B1 <-- sink DAI0 + +P_GRAPH(pipe-pass-vol-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMC(PCM_ID), N_BUFFER(0))', + `dapm(N_BUFFER(0), N_PGA(0))', + `dapm(N_PGA(0), N_BUFFER(1))', + `dapm(N_BUFFER(1), ECHO REF PIPELINE_ID)')) + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(1)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID) + +W_PIPELINE(SCHED_COMP, SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, SCHEDULE_TIME_DOMAIN, pipe_media_schedule_plat) +# +# PCM Configuration +# + +PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) +