[Sound-open-firmware] [PATCH 1/6] topology: Add passthrough capture pipe
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/pipe-passthrough-capture.m4 | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 topology/sof/pipe-passthrough-capture.m4
diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 new file mode 100644 index 0000000..2c2a495 --- /dev/null +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -0,0 +1,70 @@ +# Capture Passthrough Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <-- sink DAI0 + +# Include topology builder +include(`local.m4') + + +# +# Components and Buffers +# + +# Host "Passthrough Capture" PCM uses pipeline DMAC and channel +# with 0 sink and 2 source periods +W_PCM_CAPTURE(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 2) + +# Capture Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) + +# +# DAI definitions +# +W_DAI_IN(DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, 2, 2, dai0c_plat_conf) + +# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Pipeline Graph +# +# host PCM_C <-- B0 <-- sink DAI0 + +SectionGraph."pipe-pass-capture-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(Passthrough Capture PCM_ID, N_PCMC) + dapm(N_PCMC, N_BUFFER(0)) + ] +} + +# +# 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) + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { + + formats "S32_LE,S24_LE,S16_LE" + rate_min "48000" + rate_max "48000" + channels_min "2" + channels_max "4" + periods_min "2" + periods_max "16" + period_size_min "192" + period_size_max "16384" + buffer_size_min "65536" + buffer_size_max "65536" +}
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/pipe-passthrough-playback.m4 | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index 2b34cef..1722256 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -41,10 +41,14 @@ SectionGraph."pipe-pass-playback-PIPELINE_ID" { lines [ dapm(N_PCMP, Passthrough Playback PCM_ID) dapm(N_BUFFER(0), N_PCMP) - dapm(N_DAI_OUT, N_BUFFER(0)) ] }
+# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(0)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID)
# # PCM Configuration @@ -64,21 +68,3 @@ SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { buffer_size_min "65536" buffer_size_max "65536" } - -# PCM Low Latency Passthrough Playback -SectionPCM.STR(PCM PCM_ID) { - - index STR(PIPELINE_ID) - - # used for binding to the PCM - id STR(PCM_ID) - - dai.STR(Passthrough Playback PCM_ID) { - id STR(PCM_ID) - } - - pcm."playback" { - - capabilities STR(Passthrough Playback PCM_ID) - } -}
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- .../test-passthrough-16bit-48k-ssp2-nocodec.m4 | 43 +++++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-)
diff --git a/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 b/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 index a1c0988..76bd75b 100644 --- a/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 +++ b/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 @@ -25,24 +25,57 @@ define(`TEST_DAI_LINK_NAME', `NoCodec') # # Define the pipeline # -# PCM0 ----> SSP2 +# PCM0 <---> SSP2 #
-# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 # Use DMAC 0 channel 1 for PCM audio playback data
-PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s16le, +PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, + 1, 0, 2, s16le, 48, 1000, 0, 0, 0, 1, SSP, 2, s16le, 2)
+ +# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-capture.m4, + 2, 0, 2, s16le, + 48, 1000, 0, 0, 0, 1, + SSP, 2, s16le, 2) + +# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 1, SSP, 2, + PIPELINE_SOURCE_1, 2, s16le, + 48, 1000, 0, 0) + +# capture DAI is SSP2 using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, 2, + PIPELINE_SINK_2, 2, s16le, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + # # BE configurations - overrides config in ACPI if present # # Clocks masters wrt codec # -# 24bit I2S using 25bit sample conatiner on SSP2 +# 16bit I2S using 20bit sample conatiner on SSP2 # DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 16, DAI_CLOCK(mclk, 19200000, slave),
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/pipe-passthrough-vol-capture.m4 | 109 +++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 topology/sof/pipe-passthrough-vol-capture.m4
diff --git a/topology/sof/pipe-passthrough-vol-capture.m4 b/topology/sof/pipe-passthrough-vol-capture.m4 new file mode 100644 index 0000000..258f8fa --- /dev/null +++ b/topology/sof/pipe-passthrough-vol-capture.m4 @@ -0,0 +1,109 @@ +# Passthrough with volume Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <-- Volume 0 <-- B1 <-- source DAI0 + +# Include topology builder +include(`local.m4') + +# +# Controls +# +SectionControlMixer.STR(Master Capture Volume) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "1" + shift "0" + } + channel."FR" { + reg "1" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 32 steps from -90dB to +6dB for 3dB + max "32" + invert "false" + tlv "vtlv_m90s3" +} + +# +# Components and Buffers +# + +# Host "Passthrough Capture" PCM uses pipeline DMAC and channel +# with 0 sink and 2 source periods +W_PCM_CAPTURE(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 2) + +# "Volume" has 2 source and 2 sink periods +W_PGA(0, Master Capture Volume, PIPELINE_FORMAT, 2, 2, 2) + +# Playback Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) +W_BUFFER(1, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) + +# +# DAI definitions +# +W_DAI_IN(DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, DAI_PERIODS, + DAI_PERIODS, dai0c_plat_conf) + +# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, + SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Pipeline Graph +# +# host PCM_P <-- B0 <-- Volume 0 <-- B1 <-- sink DAI0 + +SectionGraph."pipe-pass-vol-capture-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(Passthrough Capture PCM_ID, N_PCMC) + dapm(N_PCMC, N_BUFFER(0)) + dapm(N_BUFFER(0), N_PGA(0)) + dapm(N_PGA(0), N_BUFFER(1)) + ] +} + +# +# 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) + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { + + formats "S32_LE,S24_LE,S16_LE" + rate_min "48000" + rate_max "48000" + channels_min "2" + channels_max "4" + periods_min "2" + periods_max "16" + period_size_min "192" + period_size_max "16384" + buffer_size_min "65536" + buffer_size_max "65536" +}
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/pipe-passthrough-vol-playback.m4 | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/topology/sof/pipe-passthrough-vol-playback.m4 b/topology/sof/pipe-passthrough-vol-playback.m4 index 6e8aba4..b532161 100644 --- a/topology/sof/pipe-passthrough-vol-playback.m4 +++ b/topology/sof/pipe-passthrough-vol-playback.m4 @@ -80,10 +80,15 @@ SectionGraph."pipe-pass-vol-playback-PIPELINE_ID" { dapm(N_BUFFER(0), N_PCMP) dapm(N_PGA(0), N_BUFFER(0)) dapm(N_BUFFER(1), N_PGA(0)) - dapm(N_DAI_OUT, N_BUFFER(1)) ] }
+# +# 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 @@ -104,20 +109,3 @@ SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { buffer_size_max "65536" }
-# PCM Passthrough Playback -SectionPCM.STR(PCM PCM_ID) { - - index STR(PIPELINE_ID) - - # used for binding to the PCM - id STR(PCM_ID) - - dai.STR(Passthrough Playback PCM_ID) { - id STR(PCM_ID) - } - - pcm."playback" { - - capabilities STR(Passthrough Playback PCM_ID) - } -}
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/test-passthrough-24bit-48k-vol-ssp2.m4 | 34 ++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/topology/test-passthrough-24bit-48k-vol-ssp2.m4 b/topology/test-passthrough-24bit-48k-vol-ssp2.m4 index 7071782..89775a7 100644 --- a/topology/test-passthrough-24bit-48k-vol-ssp2.m4 +++ b/topology/test-passthrough-24bit-48k-vol-ssp2.m4 @@ -25,7 +25,7 @@ define(`TEST_DAI_LINK_NAME', `Baytrail Audio') # # Define the pipeline # -# PCM0 ---> volume ---> SSP2 +# PCM0 <---> volume <---> SSP2 #
# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. @@ -37,6 +37,38 @@ PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-vol-playback.m4, 48, 1000, 0, 0, 0, 1, SSP, 2, s24le, 2)
+# 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 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-vol-capture.m4, + 2, 0, 2, s24le, + 48, 1000, 0, 0, 0, 1, + SSP, 2, s24le, 2) + +# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 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, 2, + PIPELINE_SOURCE_1, 2, s24le, + 48, 1000, 0, 0) + +# capture DAI is SSP2 using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, 2, + PIPELINE_SINK_2, 2, s24le, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + # # BE configurations - overrides config in ACPI if present #
participants (1)
-
Liam Girdwood