[Sound-open-firmware] [PATCH 1/3] topology: test: Refine name for test generator.
From: Pan Xiuli xiuli.pan@linux.intel.com
We have 5 critical arguments in the test generator but only used 3 for the naming, this will make some files be overwritten. Refine the name method to let these 5 arguments show in the tplg name. Also we decide the pipe type in one of the argument, test-ssp.m4 and test-src-ssp.m4 are almost the same, just remove one.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/test/test-src-ssp.m4 | 90 ------------------------------------------- topology/test/test-ssp.m4 | 2 +- topology/test/tplg-build.sh | 4 +- 3 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 topology/test/test-src-ssp.m4
diff --git a/topology/test/test-src-ssp.m4 b/topology/test/test-src-ssp.m4 deleted file mode 100644 index 4a0723e..0000000 --- a/topology/test/test-src-ssp.m4 +++ /dev/null @@ -1,90 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# -# TEST_PIPE_NAME - Pipe name -# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" -# TEST_SSP_PORT - SSP port number e.g. 2 -# TEST_SSP_FORMAT - SSP data format e.g s16le -# TEST_PIPE_FORMAT - Pipeline format e.g. s16le -# TEST_SSP_BCLK - SSP BCLK in Hz -# TEST_SSP_PHY_BITS - SSP physical slot size -# TEST_SSP_DATA_BITS - SSP data slot size -# - -# -# Define the pipeline -# -# PCM0 <--> SRC <--> SSP TEST_SSP_PORT -# - -# 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-TEST_PIPE_NAME-playback.m4, - 1, 0, 2, TEST_PIPE_FORMAT, - 48, 1000, 0, 0, 0, 1, - SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 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-TEST_PIPE_NAME-capture.m4, - 2, 0, 2, TEST_PIPE_FORMAT, - 48, 1000, 0, 0, 0, 1, - SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) - -# -# DAI configuration -# -# SSP port TEST_SSP_PORT is our only pipeline DAI -# - -# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT, - PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, - 48, 1000, 0, 0) - -# capture DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT, - PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, - 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 -# -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT -# -DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index ff2756e..92e91bf 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -31,7 +31,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <---> SSP TEST_SSP_PORT +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT #
# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 5c81638..a73335a 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ M4_FLAGS="-I ../ -I ../m4"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-src-ssp) +SIMPLE_TESTS=(test-ssp)
# process m4 simple tests - # simple_test(name, pipe_name, be_name, format, dai_id, dai_format, dai_phy_bits, dai_data_bits dai_bclk) @@ -29,7 +29,7 @@ SIMPLE_TESTS=(test-ssp test-src-ssp) function simple_test { for i in ${SIMPLE_TESTS[@]} do - TFILE="$i$5-$4-48k-$1" + TFILE="$i$5-$2-$4-$6-48k-$1" echo "M4 pre-processing test $i -> ${TFILE}" m4 ${M4_FLAGS} \ -DTEST_PIPE_NAME="$2" \
From: Pan Xiuli xiuli.pan@linux.intel.com
We may need to generate capture only or playback only PCMs. Add these macros to help generate them.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/m4/local.m4 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index c0ffef2..ad72a11 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -476,6 +476,44 @@ define(`COMP_SAMPLE_SIZE', dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')')
+dnl PCM_PLAYBACK_ADD(name, pipeline, pcm_id, dai_id, playback) +define(`PCM_PLAYBACK_ADD', +`SectionPCM.STR($1) {' +`' +` index STR($2)' +`' +` # used for binding to the PCM' +` id STR($3)' +`' +` dai.STR($1 $3) {' +` id STR($4)' +` }' +`' +` pcm."playback" {' +`' +` capabilities STR($5)' +` }' +`}') + +dnl PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture) +define(`PCM_CAPTURE_ADD', +`SectionPCM.STR($1) {' +`' +` index STR($2)' +`' +` # used for binding to the PCM' +` id STR($3)' +`' +` dai.STR($1 $3) {' +` id STR($4)' +` }' +`' +` pcm."capture" {' +`' +` capabilities STR($5)' +` }' +`}') + dnl PCM_DUPLEX_ADD(name, pipeline, pcm_id, dai_id, playback, capture) define(`PCM_DUPLEX_ADD', `SectionPCM.STR($1) {'
From: Pan Xiuli xiuli.pan@linux.intel.com
We may need these test for validation, add these tests.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- topology/test/test-capture-ssp.m4 | 72 ++++++++++++++++++++++++++++++++++++++ topology/test/test-playback-ssp.m4 | 72 ++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 topology/test/test-capture-ssp.m4 create mode 100644 topology/test/test-playback-ssp.m4
diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4 new file mode 100644 index 0000000..613e666 --- /dev/null +++ b/topology/test/test-capture-ssp.m4 @@ -0,0 +1,72 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# + +# +# Define the pipeline +# +# PCM0 <---> SSP TEST_SSP_PORT +# + +# 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-TEST_PIPE_NAME-capture.m4, + 2, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + +# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +# +# capture DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT, + PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4 new file mode 100644 index 0000000..351b8af --- /dev/null +++ b/topology/test/test-playback-ssp.m4 @@ -0,0 +1,72 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# + +# +# Define the pipeline +# +# PCM0 <---> SSP TEST_SSP_PORT +# + +# 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-TEST_PIPE_NAME-playback.m4, + 1, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) +# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +# + +# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT, + PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_PLAYBACK_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index a73335a..86bcfd7 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ M4_FLAGS="-I ../ -I ../m4"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp) +SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp)
# process m4 simple tests - # simple_test(name, pipe_name, be_name, format, dai_id, dai_format, dai_phy_bits, dai_data_bits dai_bclk)
On Mon, 2017-12-18 at 11:52 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
We have 5 critical arguments in the test generator but only used 3 for the naming, this will make some files be overwritten. Refine the name method to let these 5 arguments show in the tplg name. Also we decide the pipe type in one of the argument, test-ssp.m4 and test-src-ssp.m4 are almost the same, just remove one.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
All applied.
Liam
On 12/17/2017 09:52 PM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
We have 5 critical arguments in the test generator but only used 3 for the naming, this will make some files be overwritten. Refine the name method to let these 5 arguments show in the tplg name. Also we decide the pipe type in one of the argument, test-ssp.m4 and test-src-ssp.m4 are almost the same, just remove one.
I agree the script was broken but here you also removed the SRC tests, leaving only volume and passthrough pipelines.
See attached what I started (not tested successfully since there were other issues with the code).
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/test/test-src-ssp.m4 | 90 ------------------------------------------- topology/test/test-ssp.m4 | 2 +- topology/test/tplg-build.sh | 4 +- 3 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 topology/test/test-src-ssp.m4
diff --git a/topology/test/test-src-ssp.m4 b/topology/test/test-src-ssp.m4 deleted file mode 100644 index 4a0723e..0000000 --- a/topology/test/test-src-ssp.m4 +++ /dev/null @@ -1,90 +0,0 @@ -# -# Topology for pass through pipeline -#
-# Include topology builder -include(`local.m4') -include(`build.m4')
-# Include TLV library -include(`common/tlv.m4')
-# Include Token library -include(`sof/tokens.m4')
-# Include Baytrail DSP configuration -include(`dsps/byt.m4')
-# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# -# TEST_PIPE_NAME - Pipe name -# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" -# TEST_SSP_PORT - SSP port number e.g. 2 -# TEST_SSP_FORMAT - SSP data format e.g s16le -# TEST_PIPE_FORMAT - Pipeline format e.g. s16le -# TEST_SSP_BCLK - SSP BCLK in Hz -# TEST_SSP_PHY_BITS - SSP physical slot size -# TEST_SSP_DATA_BITS - SSP data slot size -#
-# -# Define the pipeline -# -# PCM0 <--> SRC <--> SSP TEST_SSP_PORT -#
-# 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-TEST_PIPE_NAME-playback.m4,
- 1, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 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-TEST_PIPE_NAME-capture.m4,
- 2, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
-# -# DAI configuration -# -# SSP port TEST_SSP_PORT is our only pipeline DAI -#
-# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT,
- PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
-# capture DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT,
- PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
- 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 -# -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT -# -DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS,
- DAI_CLOCK(mclk, 19200000, slave),
- DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
- DAI_CLOCK(fsync, 48000, slave),
- DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index ff2756e..92e91bf 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -31,7 +31,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <---> SSP TEST_SSP_PORT +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT #
# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 5c81638..a73335a 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ M4_FLAGS="-I ../ -I ../m4"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-src-ssp) +SIMPLE_TESTS=(test-ssp)
# process m4 simple tests - # simple_test(name, pipe_name, be_name, format, dai_id, dai_format, dai_phy_bits, dai_data_bits dai_bclk) @@ -29,7 +29,7 @@ SIMPLE_TESTS=(test-ssp test-src-ssp) function simple_test { for i in ${SIMPLE_TESTS[@]} do
TFILE="$i$5-$4-48k-$1"
echo "M4 pre-processing test $i -> ${TFILE}" m4 ${M4_FLAGS} \ -DTEST_PIPE_NAME="$2" \TFILE="$i$5-$2-$4-$6-48k-$1"
From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com] On 12/17/2017 09:52 PM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
We have 5 critical arguments in the test generator but only used 3 for the naming, this will make some files be overwritten. Refine the name method to let these 5 arguments show in the tplg name. Also we decide the pipe type in one of the argument, test-ssp.m4 and test-src-ssp.m4 are almost the same, just remove one.
I agree the script was broken but here you also removed the SRC tests, leaving only volume and passthrough pipelines.
Yes, I find the two files actually the same. We can pass src as pipeline name to the m4 file to get SRC tplgs. In fact using test-src-ssp.m4 will not get a SRC test now. We can add a src test in the tplg-build.sh.
See attached what I started (not tested successfully since there were other issues with the code)
Your patch can also solve the problem, but diff the test-ssp.m4 and test-src-ssp.m4 and they are almost the same and we only need to keep one.
Thanks Xiuli
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/test/test-src-ssp.m4 | 90 ------------------------------------------- topology/test/test-ssp.m4 | 2 +- topology/test/tplg-build.sh | 4 +- 3 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 topology/test/test-src-ssp.m4
diff --git a/topology/test/test-src-ssp.m4 b/topology/test/test-src-ssp.m4 deleted file mode 100644 index 4a0723e..0000000 --- a/topology/test/test-src-ssp.m4 +++ /dev/null @@ -1,90 +0,0 @@ -# -# Topology for pass through pipeline -#
-# Include topology builder -include(`local.m4') -include(`build.m4')
-# Include TLV library -include(`common/tlv.m4')
-# Include Token library -include(`sof/tokens.m4')
-# Include Baytrail DSP configuration -include(`dsps/byt.m4')
-# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE
DRIVER !!
-# -# TEST_PIPE_NAME - Pipe name -# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" -# TEST_SSP_PORT - SSP port number e.g. 2 -# TEST_SSP_FORMAT - SSP data format e.g s16le -# TEST_PIPE_FORMAT - Pipeline format e.g. s16le -# TEST_SSP_BCLK - SSP BCLK in Hz -# TEST_SSP_PHY_BITS - SSP physical slot size -# TEST_SSP_DATA_BITS - SSP data slot size -#
-# -# Define the pipeline -# -# PCM0 <--> SRC <--> SSP TEST_SSP_PORT -#
-# 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-TEST_PIPE_NAME-playback.m4,
- 1, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 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-TEST_PIPE_NAME-capture.m4,
- 2, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
-# -# DAI configuration -# -# SSP port TEST_SSP_PORT is our only pipeline DAI -#
-# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT,
- PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
-# capture DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT,
- PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
- 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 -# -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner
on SSP TEST_SSP_PORT
-# -DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S,
TEST_SSP_DATA_BITS,
- DAI_CLOCK(mclk, 19200000, slave),
- DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
- DAI_CLOCK(fsync, 48000, slave),
- DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index ff2756e..92e91bf 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -31,7 +31,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <---> SSP TEST_SSP_PORT +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT #
# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 5c81638..a73335a 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ M4_FLAGS="-I ../ -I ../m4"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-src-ssp) +SIMPLE_TESTS=(test-ssp)
# process m4 simple tests - # simple_test(name, pipe_name, be_name, format, dai_id, dai_format,
dai_phy_bits, dai_data_bits dai_bclk)
@@ -29,7 +29,7 @@ SIMPLE_TESTS=(test-ssp test-src-ssp) function simple_test { for i in ${SIMPLE_TESTS[@]} do
TFILE="$i$5-$4-48k-$1"
echo "M4 pre-processing test $i -> ${TFILE}" m4 ${M4_FLAGS} \ -DTEST_PIPE_NAME="$2" \TFILE="$i$5-$2-$4-$6-48k-$1"
On 12/19/17 9:50 AM, Pan, Xiuli wrote:
From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com] On 12/17/2017 09:52 PM, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
We have 5 critical arguments in the test generator but only used 3 for the naming, this will make some files be overwritten. Refine the name method to let these 5 arguments show in the tplg name. Also we decide the pipe type in one of the argument, test-ssp.m4 and test-src-ssp.m4 are almost the same, just remove one.
I agree the script was broken but here you also removed the SRC tests, leaving only volume and passthrough pipelines.
Yes, I find the two files actually the same. We can pass src as pipeline name to the m4 file to get SRC tplgs. In fact using test-src-ssp.m4 will not get a SRC test now. We can add a src test in the tplg-build.sh.
See attached what I started (not tested successfully since there were other issues with the code)
Your patch can also solve the problem, but diff the test-ssp.m4 and test-src-ssp.m4 and they are almost the same and we only need to keep one.
That's fine to have a single m4 file, but you need to add the src pipeline with the relevant conversions in the shell file. Also you need to add the 4 combinations of pipe/dai formats to test the volume completely.
Thanks Xiuli
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
topology/test/test-src-ssp.m4 | 90 ------------------------------------------- topology/test/test-ssp.m4 | 2 +- topology/test/tplg-build.sh | 4 +- 3 files changed, 3 insertions(+), 93 deletions(-) delete mode 100644 topology/test/test-src-ssp.m4
diff --git a/topology/test/test-src-ssp.m4 b/topology/test/test-src-ssp.m4 deleted file mode 100644 index 4a0723e..0000000 --- a/topology/test/test-src-ssp.m4 +++ /dev/null @@ -1,90 +0,0 @@ -# -# Topology for pass through pipeline -#
-# Include topology builder -include(`local.m4') -include(`build.m4')
-# Include TLV library -include(`common/tlv.m4')
-# Include Token library -include(`sof/tokens.m4')
-# Include Baytrail DSP configuration -include(`dsps/byt.m4')
-# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE
DRIVER !!
-# -# TEST_PIPE_NAME - Pipe name -# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" -# TEST_SSP_PORT - SSP port number e.g. 2 -# TEST_SSP_FORMAT - SSP data format e.g s16le -# TEST_PIPE_FORMAT - Pipeline format e.g. s16le -# TEST_SSP_BCLK - SSP BCLK in Hz -# TEST_SSP_PHY_BITS - SSP physical slot size -# TEST_SSP_DATA_BITS - SSP data slot size -#
-# -# Define the pipeline -# -# PCM0 <--> SRC <--> SSP TEST_SSP_PORT -#
-# 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-TEST_PIPE_NAME-playback.m4,
- 1, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 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-TEST_PIPE_NAME-capture.m4,
- 2, 0, 2, TEST_PIPE_FORMAT,
- 48, 1000, 0, 0, 0, 1,
- SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2)
-# -# DAI configuration -# -# SSP port TEST_SSP_PORT is our only pipeline DAI -#
-# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT,
- PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT,
- 48, 1000, 0, 0)
-# capture DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT,
- PIPELINE_SINK_2, 2, TEST_SSP_FORMAT,
- 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 -# -# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner
on SSP TEST_SSP_PORT
-# -DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S,
TEST_SSP_DATA_BITS,
- DAI_CLOCK(mclk, 19200000, slave),
- DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
- DAI_CLOCK(fsync, 48000, slave),
- DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index ff2756e..92e91bf 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -31,7 +31,7 @@ include(`dsps/byt.m4') # # Define the pipeline # -# PCM0 <---> SSP TEST_SSP_PORT +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_SSP_PORT #
# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 5c81638..a73335a 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ M4_FLAGS="-I ../ -I ../m4"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-ssp test-src-ssp) +SIMPLE_TESTS=(test-ssp)
# process m4 simple tests - # simple_test(name, pipe_name, be_name, format, dai_id, dai_format,
dai_phy_bits, dai_data_bits dai_bclk)
@@ -29,7 +29,7 @@ SIMPLE_TESTS=(test-ssp test-src-ssp) function simple_test { for i in ${SIMPLE_TESTS[@]} do
TFILE="$i$5-$4-48k-$1"
TFILE="$i$5-$2-$4-$6-48k-$1" echo "M4 pre-processing test $i -> ${TFILE}" m4 ${M4_FLAGS} \ -DTEST_PIPE_NAME="$2" \
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
participants (4)
-
Liam Girdwood
-
Pan, Xiuli
-
Pierre-Louis Bossart
-
Xiuli Pan