[Sound-open-firmware] [PATCH 1/3] topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode
From: Pan Xiuli xiuli.pan@linux.intel.com
Add token SOF_TKN_DAI_SSP_LBM for SSP loopback mode.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77
--- topology/sof/tokens.m4 | 1 + 1 file changed, 1 insertion(+)
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index f0b3428..ad74893 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -19,6 +19,7 @@ SectionVendorTokens."sof_dai_tokens" { SOF_TKN_DAI_TYPE "154" SOF_TKN_DAI_INDEX "155" SOF_TKN_DAI_SAMPLE_BITS "156" + SOF_TKN_DAI_SSP_LBM "157" }
SectionVendorTokens."sof_sched_tokens" {
From: Pan Xiuli xiuli.pan@linux.intel.com
Add new macro for SSP loobback mode support
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77 --- topology/m4/dai.m4 | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index bd67413..2a202c0 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -7,6 +7,61 @@ define(`N_DAI', DAI_NAME) define(`N_DAI_OUT', DAI_NAME`.OUT') define(`N_DAI_IN', DAI_NAME`.IN')
+dnl W_DAI_OUT_SSP_LOOPBACK(type, index, dai_link, format, periods_sink, periods_source, preload) +define(`W_DAI_OUT_SSP_LOOPBACK', +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($5) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($6) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($7) +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_w_comp" {' +` tuples "'N_DAI_OUT($2)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_INDEX' $2 +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_w" {' +` tuples "'N_DAI_OUT($2)`_tuples_w"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_str" {' +` tokens "sof_dai_tokens"' +` tuples."string" {' +` SOF_TKN_DAI_TYPE' "SSP" +` SOF_TKN_DAI_SSP_LBM' "TRUE" +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_str" {' +` tuples "'N_DAI_OUT($2)`_tuples_str"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_comp_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($4) +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_comp_str" {' +` tuples "'N_DAI_OUT($2)`_tuples_comp_str"' +`}' +`SectionWidget."'N_DAI_OUT`" {' +` index "'PIPELINE_ID`"' +` type "dai_in"' +` stream_name' STR($3) +` no_pm "true"' +` data [' +` "'N_DAI_OUT($2)`_data_w"' +` "'N_DAI_OUT($2)`_data_w_comp"' +` "'N_DAI_OUT($2)`_data_str"' +` "'N_DAI_OUT($2)`_data_comp_str"' +` ]' +`}') + + dnl W_DAI_OUT(type, index, dai_link, format, periods_sink, periods_source, preload) define(`W_DAI_OUT', `SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {'
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add new macro for SSP loobback mode support
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77
topology/m4/dai.m4 | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index bd67413..2a202c0 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -7,6 +7,61 @@ define(`N_DAI', DAI_NAME) define(`N_DAI_OUT', DAI_NAME`.OUT') define(`N_DAI_IN', DAI_NAME`.IN')
+dnl W_DAI_OUT_SSP_LOOPBACK(type, index, dai_link, format, periods_sink, periods_source, preload)
Why do we need to create a new DAI here ? Can we not pass in a flag for LBM_KCTRL to the standard DAI macro ?
The standard DAI macros could then create a kcontrol if LBM flag was true.
Liam
+define(`W_DAI_OUT_SSP_LOOPBACK', +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($5) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($6) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($7) +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_w_comp" {' +` tuples "'N_DAI_OUT($2)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_INDEX' $2 +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_w" {' +` tuples "'N_DAI_OUT($2)`_tuples_w"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_str" {' +` tokens "sof_dai_tokens"' +` tuples."string" {' +` SOF_TKN_DAI_TYPE' "SSP" +` SOF_TKN_DAI_SSP_LBM' "TRUE" +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_str" {' +` tuples "'N_DAI_OUT($2)`_tuples_str"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_comp_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($4) +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_comp_str" {' +` tuples "'N_DAI_OUT($2)`_tuples_comp_str"' +`}' +`SectionWidget."'N_DAI_OUT`" {' +` index "'PIPELINE_ID`"' +` type "dai_in"' +` stream_name' STR($3) +` no_pm "true"' +` data [' +` "'N_DAI_OUT($2)`_data_w"' +` "'N_DAI_OUT($2)`_data_w_comp"' +` "'N_DAI_OUT($2)`_data_str"' +` "'N_DAI_OUT($2)`_data_comp_str"' +` ]' +`}')
dnl W_DAI_OUT(type, index, dai_link, format, periods_sink, periods_source, preload) define(`W_DAI_OUT', `SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {'
On 6/19/2018 18:55, Liam Girdwood wrote:
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Add new macro for SSP loobback mode support
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77
topology/m4/dai.m4 | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index bd67413..2a202c0 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -7,6 +7,61 @@ define(`N_DAI', DAI_NAME) define(`N_DAI_OUT', DAI_NAME`.OUT') define(`N_DAI_IN', DAI_NAME`.IN')
+dnl W_DAI_OUT_SSP_LOOPBACK(type, index, dai_link, format, periods_sink, periods_source, preload)
Why do we need to create a new DAI here ? Can we not pass in a flag for LBM_KCTRL to the standard DAI macro ?
Sure that could work. This is used for not let user misuse some of the macro with some error flag. But a flag is also a good idea.
Thanks Xiuli
The standard DAI macros could then create a kcontrol if LBM flag was true.
Liam
+define(`W_DAI_OUT_SSP_LOOPBACK', +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($5) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($6) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($7) +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_w_comp" {' +` tuples "'N_DAI_OUT($2)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_INDEX' $2 +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_w" {' +` tuples "'N_DAI_OUT($2)`_tuples_w"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_str" {' +` tokens "sof_dai_tokens"' +` tuples."string" {' +` SOF_TKN_DAI_TYPE' "SSP" +` SOF_TKN_DAI_SSP_LBM' "TRUE" +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_str" {' +` tuples "'N_DAI_OUT($2)`_tuples_str"' +`}' +`SectionVendorTuples."'N_DAI_OUT($2)`_tuples_comp_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($4) +` }' +`}' +`SectionData."'N_DAI_OUT($2)`_data_comp_str" {' +` tuples "'N_DAI_OUT($2)`_tuples_comp_str"' +`}' +`SectionWidget."'N_DAI_OUT`" {' +` index "'PIPELINE_ID`"' +` type "dai_in"' +` stream_name' STR($3) +` no_pm "true"' +` data [' +` "'N_DAI_OUT($2)`_data_w"' +` "'N_DAI_OUT($2)`_data_w_comp"' +` "'N_DAI_OUT($2)`_data_str"' +` "'N_DAI_OUT($2)`_data_comp_str"' +` ]' +`}')
- dnl W_DAI_OUT(type, index, dai_link, format, periods_sink, periods_source,
preload) define(`W_DAI_OUT', `SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {'
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Wed, 2018-06-20 at 13:46 +0800, Pan, Xiuli wrote:
Why do we need to create a new DAI here ? Can we not pass in a flag for LBM_KCTRL to the standard DAI macro ?
Sure that could work. This is used for not let user misuse some of the macro with some error flag. But a flag is also a good idea.
You could have the flags as a bitmask too so that the flag could be used for more that just lbm.
Liam
From: Pan Xiuli xiuli.pan@linux.intel.com
Loopback topology will enable SSP DAI loopback mode. This can loopback the SSP data.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77 --- topology/sof/pipe-dai-loopback.m4 | 22 +++++++++ topology/test/test-loopback.m4 | 96 +++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai-loopback.m4 new file mode 100644 index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4 @@ -0,0 +1,22 @@ +# DAI Playback connector + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') + +# +# DAI definitions +# +W_DAI_OUT_SSP_LOOPBACK(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2) + +# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Graph connections to pipelines + +P_GRAPH(DAI_NAME, PIPELINE_ID, + LIST(` ', `dapm(N_DAI_OUT, DAI_BUF)')) diff --git a/topology/test/test-loopback.m4 b/topology/test/test-loopback.m4 new file mode 100644 index 0000000..bc5e0ec --- /dev/null +++ b/topology/test/test-loopback.m4 @@ -0,0 +1,96 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +# + +# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_DAI_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, + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_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, + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2) + +# +# DAI configuration +# +# SSP port TEST_DAI_PORT is our only pipeline DAI +# + +# playback DAI is SSP TEST_DAI_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4, + 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT, + 48, 1000, 0, 0) + +# capture DAI is SSP TEST_DAI_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, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SINK_2, 2, TEST_DAI_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_DAI_PORT +# +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS))) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 6721768..facbe17 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-all test-capture test-playback) +SIMPLE_TESTS=(test-all test-capture test-playback test-loopback) TONE_TEST=test-tone-playback DMIC_TEST=test-capture TEST_STRINGS=""
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Loopback topology will enable SSP DAI loopback mode. This can loopback the SSP data.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77
topology/sof/pipe-dai-loopback.m4 | 22 +++++++++ topology/test/test-loopback.m4 | 96 +++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai- loopback.m4 new file mode 100644 index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4
This file is not needed if you reuse the standard DAI macros and add a new param to them.
Liam
@@ -0,0 +1,22 @@ +# DAI Playback connector
+# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4')
+# +# DAI definitions +# +W_DAI_OUT_SSP_LOOPBACK(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2)
+# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
+# +# Graph connections to pipelines
+P_GRAPH(DAI_NAME, PIPELINE_ID,
- LIST(` ', `dapm(N_DAI_OUT, DAI_BUF)'))
diff --git a/topology/test/test-loopback.m4 b/topology/test/test-loopback.m4 new file mode 100644 index 0000000..bc5e0ec --- /dev/null +++ b/topology/test/test-loopback.m4 @@ -0,0 +1,96 @@ +# +# Topology for pass through pipeline +#
+# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +#
+# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_DAI_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,
- TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_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,
- TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2)
+# +# DAI configuration +# +# SSP port TEST_DAI_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_DAI_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4,
- 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT,
- 48, 1000, 0, 0)
+# capture DAI is SSP TEST_DAI_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, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SINK_2, 2, TEST_DAI_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_DAI_PORT +# +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME,
SSP_CONFIG(TEST_SSP_MODE,
DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
DAI_CLOCK(fsync, 48000, codec_slave),
DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3),
SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT,
TEST_SSP_DATA_BITS)))
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 6721768..facbe17 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-all test-capture test-playback) +SIMPLE_TESTS=(test-all test-capture test-playback test-loopback) TONE_TEST=test-tone-playback DMIC_TEST=test-capture TEST_STRINGS=""
On 6/19/2018 18:57, Liam Girdwood wrote:
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Loopback topology will enable SSP DAI loopback mode. This can loopback the SSP data.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77
topology/sof/pipe-dai-loopback.m4 | 22 +++++++++ topology/test/test-loopback.m4 | 96 +++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai- loopback.m4 new file mode 100644 index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4
This file is not needed if you reuse the standard DAI macros and add a new param to them.
Will try to use a flag implement, maybe a new m4 file is not needed. We may need to add more args in the old m4 files.
Thanks Xiuli
Liam
@@ -0,0 +1,22 @@ +# DAI Playback connector
+# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4')
+# +# DAI definitions +# +W_DAI_OUT_SSP_LOOPBACK(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2)
+# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
+# +# Graph connections to pipelines
+P_GRAPH(DAI_NAME, PIPELINE_ID,
- LIST(` ', `dapm(N_DAI_OUT, DAI_BUF)'))
diff --git a/topology/test/test-loopback.m4 b/topology/test/test-loopback.m4 new file mode 100644 index 0000000..bc5e0ec --- /dev/null +++ b/topology/test/test-loopback.m4 @@ -0,0 +1,96 @@ +# +# Topology for pass through pipeline +#
+# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +#
+# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_DAI_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,
- TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_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,
- TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2)
+# +# DAI configuration +# +# SSP port TEST_DAI_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_DAI_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4,
- 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT,
- 48, 1000, 0, 0)
+# capture DAI is SSP TEST_DAI_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, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME,
- PIPELINE_SINK_2, 2, TEST_DAI_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_DAI_PORT +# +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME,
SSP_CONFIG(TEST_SSP_MODE,
DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
DAI_CLOCK(fsync, 48000, codec_slave),
DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3),
SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT,
TEST_SSP_DATA_BITS)))
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 6721768..facbe17 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common"
# Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-all test-capture test-playback) +SIMPLE_TESTS=(test-all test-capture test-playback test-loopback) TONE_TEST=test-tone-playback DMIC_TEST=test-capture TEST_STRINGS=""
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 6/20/2018 13:48, Pan, Xiuli wrote:
On 6/19/2018 18:57, Liam Girdwood wrote:
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Loopback topology will enable SSP DAI loopback mode. This can loopback the SSP data.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
Work with patch set: SOF-Kernel(6): ASoC: SOF: Add debug_mode flag in sof dev ASoC: SOF: debug: add debugmode debugfs for sof_dev debug_mode ASoC: SOF: uapi: topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode ASoC: SOF: add headers for lbm control callback functions ASoC: SOF: add lbm kcontrol callback functions ASoC: SOF: topology: Add topology handler for dai ssp loopback mode
SOF(5): dai: add lbm status for dai ssp dai: add get_loopback_mode function DMIC: add empty get_loopback_mode function SSP: support for get/set_loopback_mode functions dai: add dai_cmd support for loopback mode switch
SOF-Tools(3): topology: Add SOF_TKN_DAI_SSP_LBM for ssp loopback mode topology: m4: Add DAI_OUT_SSP_LOOPBACK marco for SSP LOOPBACK dai comp topology: test: Add loopback topology
test & santity test with: Mininow max rt5651 and UP2 Hifiberry PRO and CNL nocodec SOF master: 48d2a1c551d7b3c8f76d44f3c04dd59a37ff6a8f SOF-Tool master: bd7dc88231f31d385340310cef467f211a739eeb https://github.com/plbossart/sound/tree/topic/sof-v4.14: 0d51a5ed28c5e97f09b59c4cafaddfb9d3b24b77
topology/sof/pipe-dai-loopback.m4 | 22 +++++++++ topology/test/test-loopback.m4 | 96 +++++++++++++++++++++++++++++++++++++++ topology/test/tplg-build.sh | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 topology/sof/pipe-dai-loopback.m4 create mode 100644 topology/test/test-loopback.m4
diff --git a/topology/sof/pipe-dai-loopback.m4 b/topology/sof/pipe-dai- loopback.m4 new file mode 100644 index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4
This file is not needed if you reuse the standard DAI macros and add a new param to them.
Will try to use a flag implement, maybe a new m4 file is not needed. We may need to add more args in the old m4 files.
Adding a pram has no benefit then adding a new file. Since we already have to much prams in tplg-build.sh, adding one more parms means we need double all command for test case. But adding one more file can simplify all this work into the different file it will lower down the switch case. Or we may need a double size tplg-build.sh
Thanks Xiuli
Thanks Xiuli
Liam
@@ -0,0 +1,22 @@ +# DAI Playback connector
+# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4')
+# +# DAI definitions +# +W_DAI_OUT_SSP_LOOPBACK(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2)
+# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
+# +# Graph connections to pipelines
+P_GRAPH(DAI_NAME, PIPELINE_ID, + LIST(` ', `dapm(N_DAI_OUT, DAI_BUF)')) diff --git a/topology/test/test-loopback.m4 b/topology/test/test-loopback.m4 new file mode 100644 index 0000000..bc5e0ec --- /dev/null +++ b/topology/test/test-loopback.m4 @@ -0,0 +1,96 @@ +# +# Topology for pass through pipeline +#
+# Include topology builder +include(`dai.m4') +include(`utils.m4') +include(`pipeline.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_DAI_PORT - SSP port number e.g. 2 +# TEST_DAI_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# TEST_SSP_MODE - SSP mode e.g. I2S, LEFT_J, DSP_A and DSP_B +#
+# +# Define the pipeline +# +# PCM0 <-- TEST_PIPE_NAME pipe --> SSP TEST_DAI_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, + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_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, + TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_FORMAT, 2)
+# +# DAI configuration +# +# SSP port TEST_DAI_PORT is our only pipeline DAI +#
+# playback DAI is SSP TEST_DAI_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-loopback.m4, + 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT, + 48, 1000, 0, 0)
+# capture DAI is SSP TEST_DAI_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, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, + PIPELINE_SINK_2, 2, TEST_DAI_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_DAI_PORT +# +DAI_CONFIG(TEST_DAI_TYPE, TEST_DAI_PORT, 0, TEST_DAI_LINK_NAME, + SSP_CONFIG(TEST_SSP_MODE, + DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in), + DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave), + DAI_CLOCK(fsync, 48000, codec_slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3), + SSP_SAMPLE_BITS(TEST_DAI_TYPE, TEST_DAI_PORT, + TEST_SSP_DATA_BITS))) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 6721768..facbe17 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -12,7 +12,7 @@ export M4PATH="../:../m4:../common" # Simple component test cases # can be used on components with 1 sink and 1 source. -SIMPLE_TESTS=(test-all test-capture test-playback) +SIMPLE_TESTS=(test-all test-capture test-playback test-loopback) TONE_TEST=test-tone-playback DMIC_TEST=test-capture TEST_STRINGS=""
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Wed, 2018-06-20 at 15:42 +0800, Pan, Xiuli wrote:
index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4
This file is not needed if you reuse the standard DAI macros and add a new param to them.
Will try to use a flag implement, maybe a new m4 file is not needed. We may need to add more args in the old m4 files.
Adding a pram has no benefit then adding a new file. Since we already have to much prams in tplg-build.sh, adding one more parms means we need double all command for test case. But adding one more file can simplify all this work into the different file it will lower down the switch case. Or we may need a double size tplg-build.sh
This path leads to things like pipe-dai-loopback-tristate-option3-config4- blah5.m4 which becomes unmanageable.
Using the flag as a param means it will be 0 for most users except when we need a LBM kcontrol. This means that cnl.m4, apl.m4 etc can set this flag to enable LBM kcontrol automatically, other non Intel platform.m4 wont define it.
Even better is creating an ssp.m4 that defines all the flags for SSP and then is included by all the intel platforms like apl.m4. The SSP tristate kcontrol flag could go here too.
Liam
On Wed, 2018-06-20 at 11:53 +0100, Liam Girdwood wrote:
On Wed, 2018-06-20 at 15:42 +0800, Pan, Xiuli wrote:
index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4
This file is not needed if you reuse the standard DAI macros and add a new param to them.
Will try to use a flag implement, maybe a new m4 file is not needed. We may need to add more args in the old m4 files.
Adding a pram has no benefit then adding a new file. Since we already have to much prams in tplg-build.sh, adding one more parms means we need double all command for test case. But adding one more file can simplify all this work into the different file it will lower down the switch case. Or we may need a double size tplg-build.sh
This path leads to things like pipe-dai-loopback-tristate-option3- config4- blah5.m4 which becomes unmanageable.
Using the flag as a param means it will be 0 for most users except when we need a LBM kcontrol. This means that cnl.m4, apl.m4 etc can set this flag to enable LBM kcontrol automatically, other non Intel platform.m4 wont define it.
Even better is creating an ssp.m4 that defines all the flags for SSP and then is included by all the intel platforms like apl.m4. The SSP tristate kcontrol flag could go here too.
Not to mention the tplg-build.sh needs a bit of clean up too. Its on my radar once 1.2 is done.
Liam _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 6/21/2018 13:16, Ranjani Sridharan wrote:
On Wed, 2018-06-20 at 11:53 +0100, Liam Girdwood wrote:
On Wed, 2018-06-20 at 15:42 +0800, Pan, Xiuli wrote:
index 0000000..59d9af8 --- /dev/null +++ b/topology/sof/pipe-dai-loopback.m4
This file is not needed if you reuse the standard DAI macros and add a new param to them.
Will try to use a flag implement, maybe a new m4 file is not needed. We may need to add more args in the old m4 files.
Adding a pram has no benefit then adding a new file. Since we already have to much prams in tplg-build.sh, adding one more parms means we need double all command for test case. But adding one more file can simplify all this work into the different file it will lower down the switch case. Or we may need a double size tplg-build.sh
This path leads to things like pipe-dai-loopback-tristate-option3- config4- blah5.m4 which becomes unmanageable.
Using the flag as a param means it will be 0 for most users except when we need a LBM kcontrol. This means that cnl.m4, apl.m4 etc can set this flag to enable LBM kcontrol automatically, other non Intel platform.m4 wont define it.
Even better is creating an ssp.m4 that defines all the flags for SSP and then is included by all the intel platforms like apl.m4. The SSP tristate kcontrol flag could go here too.
This make sense to me. Passing a parameter directly from tplg-build.sh would make the scripts more complex. Using some pre-define config macro would be better.
Not to mention the tplg-build.sh needs a bit of clean up too. Its on my radar once 1.2 is done.
Agree, it is very complex now. It is not easy to use any more.
Thanks Xiuli
Liam _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index f0b3428..ad74893 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -19,6 +19,7 @@ SectionVendorTokens."sof_dai_tokens" { SOF_TKN_DAI_TYPE "154" SOF_TKN_DAI_INDEX "155" SOF_TKN_DAI_SAMPLE_BITS "156"
SOF_TKN_DAI_SSP_LBM "157"
What does this token mean ? Create Kcontrol for LBM or Enable SSP loopbak ?
SOF_TKN_DAI_LBM_KCONTROL is better name if its a flag to create a kcontrol for a DAI to enable/disable LBM at runtime.
Liam
}
On 6/19/2018 18:52, Liam Girdwood wrote:
On Tue, 2018-06-19 at 17:21 +0800, Xiuli Pan wrote:
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index f0b3428..ad74893 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -19,6 +19,7 @@ SectionVendorTokens."sof_dai_tokens" { SOF_TKN_DAI_TYPE "154" SOF_TKN_DAI_INDEX "155" SOF_TKN_DAI_SAMPLE_BITS "156"
SOF_TKN_DAI_SSP_LBM "157"
What does this token mean ? Create Kcontrol for LBM or Enable SSP loopbak ?
SOF_TKN_DAI_LBM_KCONTROL is better name if its a flag to create a kcontrol for a DAI to enable/disable LBM at runtime.
That is more readable, will send a new patch set.
Thanks Xiuli
Liam
}
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
-
Ranjani Sridharan
-
Xiuli Pan