[Sound-open-firmware] [PATCH 4/5] topology: pipeline: Update pipelines to use new tokens
Liam Girdwood
liam.r.girdwood at linux.intel.com
Wed Aug 9 16:02:16 CEST 2017
Update the pipelines to use the new buffer and scheduling tokens.
Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
topology/sof/pipe-dai-capture.m4 | 25 +++++++++
topology/sof/pipe-dai-playback.m4 | 25 +++++++++
topology/sof/pipe-dai.m4 | 24 ---------
topology/sof/pipe-low-latency-capture.m4 | 26 +++++++---
topology/sof/pipe-low-latency-playback.m4 | 39 ++++++++++----
topology/sof/pipe-passthrough-playback.m4 | 84 +++++++++++++++++++++++++++++++
topology/sof/pipe-pcm-media.m4 | 33 +++++++++---
topology/sof/pipe-tone.m4 | 22 ++++++--
8 files changed, 226 insertions(+), 52 deletions(-)
create mode 100644 topology/sof/pipe-dai-capture.m4
create mode 100644 topology/sof/pipe-dai-playback.m4
delete mode 100644 topology/sof/pipe-dai.m4
create mode 100644 topology/sof/pipe-passthrough-playback.m4
diff --git a/topology/sof/pipe-dai-capture.m4 b/topology/sof/pipe-dai-capture.m4
new file mode 100644
index 0000000..887cd0c
--- /dev/null
+++ b/topology/sof/pipe-dai-capture.m4
@@ -0,0 +1,25 @@
+# DAI Playback connector
+
+# Include topology builder
+include(`local.m4')
+
+#
+# DAI definitions
+#
+W_DAI_IN(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0c_plat_conf)
+
+#
+# DAI pipeline - always use 0 for DAIs
+#
+W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_dai_schedule_plat)
+
+#
+# Graph connections to pipelines
+
+SectionGraph.STR(DAI_NAME) {
+ index STR(PIPELINE_ID)
+
+ lines [
+ dapm(DAI_BUF, N_DAI_IN)
+ ]
+}
diff --git a/topology/sof/pipe-dai-playback.m4 b/topology/sof/pipe-dai-playback.m4
new file mode 100644
index 0000000..f3d08c0
--- /dev/null
+++ b/topology/sof/pipe-dai-playback.m4
@@ -0,0 +1,25 @@
+# DAI Playback connector
+
+# Include topology builder
+include(`local.m4')
+
+#
+# DAI definitions
+#
+W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0p_plat_conf)
+
+#
+# DAI pipeline - always use 0 for DAIs
+#
+W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_dai_schedule_plat)
+
+#
+# Graph connections to pipelines
+
+SectionGraph.STR(DAI_NAME) {
+ index STR(PIPELINE_ID)
+
+ lines [
+ dapm(N_DAI_OUT, DAI_BUF)
+ ]
+}
diff --git a/topology/sof/pipe-dai.m4 b/topology/sof/pipe-dai.m4
deleted file mode 100644
index 06ac453..0000000
--- a/topology/sof/pipe-dai.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-# DAI connector
-
-# Include topology builder
-include(`local.m4')
-
-#
-# DAI definitions
-#
-W_DAI_OUT(DAI_SNAME, dai0p_plat_conf)
-W_DAI_IN(DAI_SNAME, dai0c_plat_conf)
-
-#D_DAI(0, 1, 1)
-
-#
-# Graph connections to pipelines
-
-SectionGraph.STR(DAI_NAME) {
- index "0"
-
- lines [
- dapm(N_DAI_IN, OUT_BUF)
- dapm(IN_BUF, N_DAI_OUT)
- ]
-}
diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4
index ddb5d8e..ca9fe9c 100644
--- a/topology/sof/pipe-low-latency-capture.m4
+++ b/topology/sof/pipe-low-latency-capture.m4
@@ -43,20 +43,29 @@ SectionControlMixer.STR(PCM PCM_ID Capture Volume) {
# Components and Buffers
#
-W_PCM_CAPTURE(Low Latency Capture)
-W_PGA(Capture Volume)
-W_BUFFER(0, BUF_INT_SIZE)
-W_BUFFER(1, BUF_PCM_SIZE)
+# Host "Low Latency Capture" PCM uses pipeline DMAC and channel
+# with 0 sink and 2 source periods
+W_PCM_CAPTURE(Low Latency Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 0)
+
+# "Capture Volume" has 2 sink and source periods for host and DAI ping-pong
+W_PGA(Capture Volume, PIPELINE_FORMAT, 2, 2, 0)
+
+# Capture 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))
#
# Pipeline Graph
#
-# host PCM <--B1-- volume( <--B0-- source DAI0
+# host PCM <--B1-- volume <--B0-- source DAI0
SectionGraph."pipe-ll-capture-PIPELINE_ID" {
index STR(PIPELINE_ID)
lines [
+ dapm(Low Latency Capture PCM_ID, N_PCM)
dapm(N_PCM, N_BUFFER(1))
dapm(N_BUFFER(1), N_PGA(Capture Volume))
dapm(N_PGA(Capture Volume), N_BUFFER(0))
@@ -64,10 +73,15 @@ SectionGraph."pipe-ll-capture-PIPELINE_ID" {
}
#
+# Pipeline Source and Sinks
+#
+indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(0))
+
+#
# Pipeline Configuration.
#
-W_PIPELINE(N_PGA(Capture Volume), SCHEDULE_DEADLINE, pipe_ll_schedule_plat)
+W_PIPELINE(N_PGA(Capture Volume), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_ll_schedule_plat)
#
# PCM Configuration
diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4
index 6604ad1..a8e3fa5 100644
--- a/topology/sof/pipe-low-latency-playback.m4
+++ b/topology/sof/pipe-low-latency-playback.m4
@@ -86,14 +86,28 @@ SectionControlMixer.STR(Master Playback Volume) {
# Components and Buffers
#
-W_PCM_PLAYBACK(Low Latency Playback)
-W_PGA(Playback Volume)
-W_PGA(Mixer Volume)
-W_MIXER(0)
-W_BUFFER(0, BUF_PCM_SIZE)
-W_BUFFER(1, BUF_INT_SIZE)
-W_BUFFER(2, BUF_INT_SIZE)
-W_BUFFER(3, BUF_INT_SIZE)
+# Host "Low latency Playback" PCM uses pipeline DMAC and channel
+# with 2 sink and 0 source periods
+W_PCM_PLAYBACK(Low Latency Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
+
+# "Playback Volume" has 1 sink period and 2 source periods for host ping-pong
+W_PGA(Playback Volume, PIPELINE_FORMAT, 1, 2, 1)
+
+# "Mixer Volume" has 1 source and 2 sink periods for DAI ping-pong
+W_PGA(Mixer Volume, PIPELINE_FORMAT, 2, 1, 1)
+
+# Mixer 0 has 1 sink and source periods.
+W_MIXER(0, PIPELINE_FORMAT, 1, 1, 1)
+
+# Low Latency Buffers
+W_BUFFER(0, COMP_BUFFER_SIZE(2,
+ COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
+W_BUFFER(1, COMP_BUFFER_SIZE(1,
+ COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,SCHEDULE_FRAMES))
+W_BUFFER(2, COMP_BUFFER_SIZE(1,
+ COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
+W_BUFFER(3, COMP_BUFFER_SIZE(2,
+ COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
# Pipeline Graph
@@ -111,6 +125,7 @@ SectionGraph."pipe-ll-playback-PIPELINE_ID" {
index STR(PIPELINE_ID)
lines [
+ dapm(N_PCM, Low Latency Playback PCM_ID)
dapm(N_BUFFER(0), N_PCM)
dapm(N_PGA(Playback Volume), N_BUFFER(0))
dapm(N_BUFFER(1), N_PGA(Playback Volume))
@@ -122,10 +137,16 @@ SectionGraph."pipe-ll-playback-PIPELINE_ID" {
}
#
+# Pipeline Source and Sinks
+#
+indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(3))
+indir(`define', concat(`PIPELINE_MIXER_', PIPELINE_ID), N_MIXER(0))
+
+#
# Pipeline Configuration.
#
-W_PIPELINE(N_PGA(Mixer Volume), SCHEDULE_DEADLINE, pipe_ll_schedule_plat)
+W_PIPELINE(N_PGA(Mixer Volume), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_ll_schedule_plat)
#
# PCM Configuration
diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4
new file mode 100644
index 0000000..1fc76c7
--- /dev/null
+++ b/topology/sof/pipe-passthrough-playback.m4
@@ -0,0 +1,84 @@
+# Low Latency Passthrough Pipeline and PCM
+#
+# Pipeline Endpoints for connection are :-
+#
+# host PCM_P --> B0 --> sink DAI0
+
+# Include topology builder
+include(`local.m4')
+
+
+#
+# Components and Buffers
+#
+
+# Host "Passthrough Playback" PCM uses pipeline DMAC and channel
+# with 2 sink and 0 source periods
+W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
+
+# Capture Buffers
+W_BUFFER(0, COMP_BUFFER_SIZE(2,
+ COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
+
+#
+# DAI definitions
+#
+W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0p_plat_conf)
+
+#
+# DAI pipeline - always use 0 for DAIs
+#
+W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_dai_schedule_plat)
+
+#
+# Pipeline Graph
+#
+# host PCM <--B1-- volume <--B0-- source DAI0
+
+SectionGraph."pipe-pass-playback-PIPELINE_ID" {
+ index STR(PIPELINE_ID)
+
+ lines [
+ dapm(N_PCM, Passthrough Playback PCM_ID)
+ dapm(N_BUFFER(0), N_PCM)
+ dapm(N_DAI_OUT, N_BUFFER(0))
+ ]
+}
+
+
+#
+# PCM Configuration
+#
+
+SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) {
+
+ formats "S24_LE,S16_LE"
+ rate_min "48000"
+ rate_max "48000"
+ channels_min "2"
+ channels_max "4"
+ periods_min "2"
+ periods_max "4"
+ period_size_min "192"
+ period_size_max "16384"
+ buffer_size_min "384"
+ buffer_size_max "65536"
+}
+
+# PCM Low Latency Capture
+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)
+ }
+}
diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4
index 688c81f..ac2aaa7 100644
--- a/topology/sof/pipe-pcm-media.m4
+++ b/topology/sof/pipe-pcm-media.m4
@@ -65,12 +65,23 @@ SectionData."media_src_conf" {
# Components and Buffers
#
-W_PCM_PLAYBACK(Media Playback)
-W_PGA(Playback Volume)
-W_SRC(0, media_src_conf)
-W_BUFFER(0, BUF_PCM_SIZE)
-W_BUFFER(1, BUF_INT_SIZE)
-W_BUFFER(2, BUF_INT_SIZE)
+# Host "Low latency Playback" PCM uses pipeline DMAC and channel
+# with 2 sink and 0 source periods
+W_PCM_PLAYBACK(Media Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
+
+# "Playback Volume" has 2 sink period and 2 source periods for host ping-pong
+W_PGA(Playback Volume, PIPELINE_FORMAT, 2, 2, 2)
+
+# "SRC 0" has 2 sink and source periods.
+W_SRC(0, media_src_conf, PIPELINE_FORMAT, 2, 2, 2)
+
+# Media 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))
+W_BUFFER(2, COMP_BUFFER_SIZE(2,
+ COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
# Pipeline Graph
@@ -82,7 +93,8 @@ SectionGraph."pipe-media-PIPELINE_ID" {
index STR(PIPELINE_ID)
lines [
- dapm(N_BUFFER(0), Media Playback PCM_ID)
+ dapm(N_PCM, Media Playback PCM_ID)
+ dapm(N_BUFFER(0), N_PCM)
dapm(N_PGA(Playback Volume), N_BUFFER(0))
dapm(N_BUFFER(1), N_PGA(Playback Volume))
dapm(N_SRC(0), N_BUFFER(1))
@@ -91,10 +103,15 @@ SectionGraph."pipe-media-PIPELINE_ID" {
}
#
+# Pipeline Source and Sinks
+#
+indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2))
+
+#
# Pipeline Configuration.
#
-W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, pipe_media_schedule_plat)
+W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_media_schedule_plat)
#
# PCM Configuration
diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4
index 24fe10f..386ddd3 100644
--- a/topology/sof/pipe-tone.m4
+++ b/topology/sof/pipe-tone.m4
@@ -46,10 +46,17 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) {
# Components and Buffers
#
-W_TONE(0)
-W_PGA(Tone Volume)
-W_BUFFER(0, BUF_INT_SIZE)
-W_BUFFER(1, BUF_INT_SIZE)
+# "Tone 0" has 2 sink period and 0 source periods
+W_TONE(0, PIPELINE_FORMAT, 2, 0, 0)
+
+# "Tone Volume" has 2 sink period and 2 source periods
+W_PGA(Tone Volume, PIPELINE_FORMAT, 2, 2, 0)
+
+# Low Latency 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))
#
@@ -69,7 +76,12 @@ SectionGraph."pipe-tone-PIPELINE_ID" {
}
#
+# Pipeline Source and Sinks
+#
+indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1))
+
+#
# Pipeline Configuration.
#
-W_PIPELINE(N_TONE(0), SCHEDULE_DEADLINE, pipe_tone_schedule_plat)
+W_PIPELINE(N_TONE(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, pipe_tone_schedule_plat)
--
2.11.0
More information about the Sound-open-firmware
mailing list