[Sound-open-firmware] [PATCH 1/5] topology: Add token support for PCMs and components buffers.
Add topology tokens for PCM and buffer configuration.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/tokens.m4 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index 1ec48df..3902c36 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -11,13 +11,14 @@
SectionVendorTokens."sof_buffer_tokens" { SOF_TKN_BUF_SIZE "100" - SOF_TKN_BUF_PRELOAD "101" }
SectionVendorTokens."sof_dai_tokens" { SOF_TKN_DAI_DMAC "151" SOF_TKN_DAI_DMAC_CHAN "152" SOF_TKN_DAI_DMAC_CONFIG "153" + SOF_TKN_DAI_TYPE "154" + SOF_TKN_DAI_INDEX "155" }
SectionVendorTokens."sof_sched_tokens" { @@ -25,6 +26,7 @@ SectionVendorTokens."sof_sched_tokens" { SOF_TKN_SCHED_PRIORITY "201" SOF_TKN_SCHED_MIPS "202" SOF_TKN_SCHED_CORE "203" + SOF_TKN_SCHED_FRAMES "204" }
SectionVendorTokens."sof_volume_tokens" { @@ -36,3 +38,16 @@ SectionVendorTokens."sof_src_tokens" { SOF_TKN_SRC_RATE_IN "300" SOF_TKN_SRC_RATE_OUT "301" } + +SectionVendorTokens."sof_pcm_tokens" { + SOF_TKN_PCM_DMAC "351" + SOF_TKN_PCM_DMAC_CHAN "352" + SOF_TKN_PCM_DMAC_CONFIG "353" +} + +SectionVendorTokens."sof_comp_tokens" { + SOF_TKN_COMP_PERIOD_SINK_COUNT "400" + SOF_TKN_COMP_PERIOD_SOURCE_COUNT "401" + SOF_TKN_COMP_FORMAT "402" + SOF_TKN_COMP_PRELOAD_COUNT "403" +}
Allow topology pipelines to define their scheduling.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/m4/build.m4 | 96 +++++++++++--- topology/m4/local.m4 | 359 +++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 392 insertions(+), 63 deletions(-)
diff --git a/topology/m4/build.m4 b/topology/m4/build.m4 index 0c40e4e..66f6562 100644 --- a/topology/m4/build.m4 +++ b/topology/m4/build.m4 @@ -1,44 +1,100 @@ -#"PIPELINE_PCM_ADD(pipeline, id, pcm, pcm_buf, int_buf, frames, deadline) +divert(-1) + +dnl PIPELINE_PCM_ADD(pipeline, id, pcm, max channels, format, frames, deadline, priority, core) define(`PIPELINE_PCM_ADD', `undefine(`PCM_ID')' `undefine(`PIPELINE_ID')' -`undefine(`BUF_PCM_SIZE')' -`undefine(`BUF_INT_SIZE')' +`undefine(`PIPELINE_CHANNELS')' +`undefine(`PIPELINE_FORMAT')' `undefine(`SCHEDULE_FRAMES')' `undefine(`SCHEDULE_DEADLINE')' +`undefine(`SCHEDULE_PRIORITY')' +`undefine(`SCHEDULE_CORE')' +`undefine(`PIPELINE_DMAC')' +`undefine(`PIPELINE_DMAC_CHAN')' +`define(`PIPELINE_ID', $2)' `define(`PCM_ID', $3)' +`define(`PIPELINE_CHANNELS', $4)' +`define(`PIPELINE_FORMAT', $5)' +`define(`SCHEDULE_FRAMES', $6)' +`define(`SCHEDULE_DEADLINE', $7)' +`define(`SCHEDULE_PRIORITY', $8)' +`define(`SCHEDULE_CORE', $9)' +`define(`PIPELINE_DMAC', $10)' +`define(`PIPELINE_DMAC_CHAN', $11)' +`include($1)' +) + +dnl PIPELINE_PCM_DAI_ADD(pipeline, id, pcm, max channels, format, frames, +dnl deadline, priority, core, dai type, dai_index, stream_name, periods) +define(`PIPELINE_PCM_DAI_ADD', +`undefine(`PCM_ID')' +`undefine(`PIPELINE_ID')' +`undefine(`PIPELINE_CHANNELS')' +`undefine(`PIPELINE_FORMAT')' +`undefine(`SCHEDULE_FRAMES')' +`undefine(`SCHEDULE_DEADLINE')' +`undefine(`SCHEDULE_PRIORITY')' +`undefine(`SCHEDULE_CORE')' +`undefine(`PIPELINE_DMAC')' +`undefine(`PIPELINE_DMAC_CHAN')' +`undefine(`DAI_TYPE')' +`undefine(`DAI_INDEX')' +`undefine(`DAI_SNAME')' +`undefine(`DAI_PERIODS')' `define(`PIPELINE_ID', $2)' -`define(`BUF_PCM_SIZE', STR($4))' -`define(`BUF_INT_SIZE', STR($5))' -`define(`SCHEDULE_FRAMES', STR($6))' -`define(`SCHEDULE_DEADLINE', STR($7))' +`define(`PCM_ID', $3)' +`define(`PIPELINE_CHANNELS', $4)' +`define(`PIPELINE_FORMAT', $5)' +`define(`SCHEDULE_FRAMES', $6)' +`define(`SCHEDULE_DEADLINE', $7)' +`define(`SCHEDULE_PRIORITY', $8)' +`define(`SCHEDULE_CORE', $9)' +`define(`PIPELINE_DMAC', $10)' +`define(`PIPELINE_DMAC_CHAN', $11)' +`define(`DAI_TYPE', STR($12))' +`define(`DAI_INDEX', STR($13))' +`define(`DAI_SNAME', $14)' +`define(`DAI_PERIODS', $15)' +`define(`DAI_NAME', $12$13)' `include($1)' )
-#PIPELINE_ADD(pipeline, id), int_buf, frames, deadline) +dnl PIPELINE_ADD(pipeline, id, max channels, format, frames, deadline, priority, core) define(`PIPELINE_ADD', `undefine(`PIPELINE_ID')' -`undefine(`BUF_INT_SIZE')' +`undefine(`PIPELINE_CHANNELS')' +`undefine(`PIPELINE_FORMAT')' `undefine(`SCHEDULE_FRAMES')' `undefine(`SCHEDULE_DEADLINE')' +`undefine(`SCHEDULE_PRIORITY')' +`undefine(`SCHEDULE_CORE')' `define(`PIPELINE_ID', $2)' -`define(`BUF_INT_SIZE', STR($3))' -`define(`SCHEDULE_FRAMES', STR($4))' -`define(`SCHEDULE_DEADLINE', STR($5))' +`define(`PIPELINE_CHANNELS', $3)' +`define(`PIPELINE_FORMAT', $4)' +`define(`SCHEDULE_FRAMES', $5)' +`define(`SCHEDULE_DEADLINE', $6)' +`define(`SCHEDULE_PRIORITY', $7)' +`define(`SCHEDULE_CORE', $8)' `include($1)' )
-#DAI_ADD(pipeline, dai_name, stream_name, win, wout)) +dnl DAI_ADD(pipeline, dai type, dai_index, stream_name, buffer, periods) define(`DAI_ADD', `undefine(`PIPELINE_ID')' -`undefine(`DAI_NAME')' +`undefine(`DAI_TYPE')' +`undefine(`DAI_INDEX')' `undefine(`DAI_SNAME')' -`undefine(`IN_BUF')' -`undefine(`OUT_BUF')' +`undefine(`DAI_BUF')' +`undefine(`DAI_PERIODS')' `define(`PIPELINE_ID', 0)' -`define(`DAI_NAME', $2)' -`define(`DAI_SNAME', $3)' -`define(`IN_BUF', $4)' -`define(`OUT_BUF', $5)' +`define(`DAI_TYPE', STR($2))' +`define(`DAI_INDEX', STR($3))' +`define(`DAI_SNAME', $4)' +`define(`DAI_BUF', $5)' +`define(`DAI_NAME', $2$3)' +`define(`DAI_PERIODS', $6)' `include($1)' ) + +divert(0)dnl diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 2408830..a888438 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -1,32 +1,57 @@ +divert(-1) + define(`concat',`$1$2')
define(`STR', `"'$1`"')
-#create direct DAPM/pipeline link between 2 widgets) +dnl create direct DAPM/pipeline link between 2 widgets) define(`dapm', `"$1, , $2"')
-#SRC name) +dnl SRC name) define(`N_SRC', `SRC'PIPELINE_ID`.'$1)
-#W_SRC(name, data)) -define(`W_SRC', `SectionWidget."'N_SRC($1)`" {' +dnl W_SRC(name, format, periods_sink, periods_source, data, preload) +define(`W_SRC', +`SectionVendorTuples."'N_SRC($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_SRC($1)`_data_w" {' +` tuples "'N_SRC($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_SRC($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_SRC($1)`_data_str" {' +` tuples "'N_SRC($1)`_tuples_str"' +`}' +`SectionWidget."'N_SRC($1)`" {' ` index "'PIPELINE_ID`"' ` type "src"' ` no_pm "true"' ` data [' +` "'N_SRC($1)`_data_w"' +` "'N_SRC($1)`_data_str"' ` "'$2`"' ` ]' `}')
-#Buffer name) +dnl Buffer name) define(`N_BUFFER', `BUF'PIPELINE_ID`.'$1)
-#W_BUFFER(name, size)) +dnl W_BUFFER(name, size) define(`W_BUFFER', `SectionVendorTuples."'N_BUFFER($1)`_tuples" {' ` tokens "sof_buffer_tokens"' ` tuples."word" {' -` SOF_TKN_BUF_SIZE' $2 +` SOF_TKN_BUF_SIZE' STR($2) ` }' `}' `SectionData."'N_BUFFER($1)`_data" {' @@ -41,119 +66,367 @@ define(`W_BUFFER', ` ]' `}')
-#PCM name) +dnl PCM name) define(`N_PCM', `PCM'PCM_ID)
-#W_PCM_PLAYBACK(stream)) -define(`W_PCM_PLAYBACK', `SectionWidget."'N_PCM`" {' +dnl W_PCM_PLAYBACK(stream, dmac, dmac_chan, periods_sink, periods_source, preload) +dnl PCM platform configuration +define(`W_PCM_PLAYBACK', +`SectionVendorTuples."'N_PCM($1)`_tuples_w_comp" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($4) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($5) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($6) +` }' +`}' +`SectionData."'N_PCM($1)`_data_w_comp" {' +` tuples "'N_PCM($1)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_PCM($1)`_tuples" {' +` tokens "sof_pcm_tokens"' +` tuples."word" {' +` SOF_TKN_PCM_DMAC' STR($2) +` SOF_TKN_PCM_DMAC_CHAN' STR($3) +` }' +`}' +`SectionData."'N_PCM($1)`_data" {' +` tuples "'N_PCM($1)`_tuples"' +`}' +`SectionWidget."'N_PCM`" {' ` index "'PIPELINE_ID`"' ` type "aif_out"' ` no_pm "true"' ` stream_name "'$1`"' +` data [' +` "'N_PCM($1)`_data"' +` "'N_PCM($1)`_data_w_comp"' +` ]' `}')
-#W_PCM_CAPTURE(stream)) -define(`W_PCM_CAPTURE', `SectionWidget."'N_PCM`" {' +dnl W_PCM_PLAYBACK(stream, dmac, dmac_chan, periods_sink, periods_source, preload) +define(`W_PCM_CAPTURE', +`SectionVendorTuples."'N_PCM($1)`_tuples_w_comp" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($4) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($5) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($6) +` }' +`}' +`SectionData."'N_PCM($1)`_data_w_comp" {' +` tuples "'N_PCM($1)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_PCM($1)`_tuples" {' +` tokens "sof_pcm_tokens"' +` tuples."word" {' +` SOF_TKN_PCM_DMAC' STR($2) +` SOF_TKN_PCM_DMAC_CHAN' STR($3) +` }' +`}' +`SectionData."'N_PCM($1)`_data" {' +` tuples "'N_PCM($1)`_tuples"' +`}' +`SectionWidget."'N_PCM`" {' ` index "'PIPELINE_ID`"' ` type "aif_out"' ` no_pm "true"' ` stream_name "'$1`"' +` data [' +` "'N_PCM($1)`_data"' +` "'N_PCM($1)`_data_w_comp"' +` ]' `}')
-#PGA name) +dnl PGA name) define(`N_PGA', `PGA'PIPELINE_ID`.'$1)
-#W_PGA(name)) -define(`W_PGA', `SectionWidget."'N_PGA($1)`" {' +dnl W_PGA(name, format, periods_sink, periods_source, preload) +define(`W_PGA', +`SectionVendorTuples."'N_PGA($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_PGA($1)`_data_w" {' +` tuples "'N_PGA($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_PGA($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_PGA($1)`_data_str" {' +` tuples "'N_PGA($1)`_tuples_str"' +`}' +`SectionWidget."'N_PGA($1)`" {' ` index "'PIPELINE_ID`"' ` type "pga"' ` no_pm "true"' +` data [' +` "'N_PGA($1)`_data_w"' +` "'N_PGA($1)`_data_str"' +` ]' `}')
-#Mixer Name) +dnl Mixer Name) define(`N_MIXER', `MIXER'PIPELINE_ID`.'$1)
-#Pipe Buffer name in pipeline (pipeline, buffer) +dnl Pipe Buffer name in pipeline (pipeline, buffer) define(`NPIPELINE_MIXER', `MIXER'$1`.'$2)
-#W_MIXER(name)) -define(`W_MIXER', `SectionWidget."'N_MIXER($1)`" {' +dnl W_MIXER(name, format, periods_sink, periods_source, preload) +define(`W_MIXER', +`SectionVendorTuples."'N_MIXER($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_MIXER($1)`_data_w" {' +` tuples "'N_MIXER($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_MIXER($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_MIXER($1)`_data_str" {' +` tuples "'N_MIXER($1)`_tuples_str"' +`}' +`SectionWidget."'N_MIXER($1)`" {' ` index "'PIPELINE_ID`"' ` type "mixer"' ` no_pm "true"' +` data [' +` "'N_MIXER($1)`_data_w"' +` "'N_MIXER($1)`_data_str"' +` ]' `}')
-#Tone name) +dnl Tone name) define(`N_TONE', `TONE'PIPELINE_ID`.'$1)
-#W_TONE(name)) -define(`W_TONE', `SectionWidget."'N_TONE($1)`" {' +dnl W_TONE(name, format, periods_sink, periods_source, preload) +define(`W_TONE', +`SectionVendorTuples."'N_TONE($1)`_tuples_w" {' +` tokens "sof_comp_tokens"' +` tuples."word" {' +` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3) +` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4) +` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) +` }' +`}' +`SectionData."'N_TONE($1)`_data_w" {' +` tuples "'N_TONE($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_TONE($1)`_tuples_str" {' +` tokens "sof_comp_tokens"' +` tuples."string" {' +` SOF_TKN_COMP_FORMAT' STR($2) +` }' +`}' +`SectionData."'N_TONE($1)`_data_str" {' +` tuples "'N_TONE($1)`_tuples_str"' +`}' +`SectionWidget."'N_TONE($1)`" {' ` index "'PIPELINE_ID`"' ` type "siggen"' ` no_pm "true"' +` data [' +` "'N_TONE($1)`_data_w"' +` "'N_TONE($1)`_data_str"' +` ]' `}')
-#DAI name) +dnl DAI name) define(`N_DAI', DAI_NAME) define(`N_DAI_OUT', DAI_NAME`.OUT') define(`N_DAI_IN', DAI_NAME`.IN')
-#W_DAI_OUT(stream, data)) -define(`W_DAI_OUT', `SectionWidget."'N_DAI_OUT`" {' +dnl W_DAI_OUT(stream, type, index, data, periods_sink, periods_source, preload) +define(`W_DAI_OUT', +`SectionVendorTuples."'N_DAI_IN($1)`_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_IN($1)`_data_w_comp" {' +` tuples "'N_DAI_IN($1)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_DAI_OUT($1)`_tuples_w" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_INDEX' $3 +` }' +`}' +`SectionData."'N_DAI_OUT($1)`_data_w" {' +` tuples "'N_DAI_OUT($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_DAI_OUT($1)`_tuples_str" {' +` tokens "sof_dai_tokens"' +` tuples."string" {' +` SOF_TKN_DAI_TYPE' $2 +` }' +`}' +`SectionData."'N_DAI_OUT($1)`_data_str" {' +` tuples "'N_DAI_OUT($1)`_tuples_str"' +`}' +`SectionWidget."'N_DAI_OUT`" {' ` index "'PIPELINE_ID`"' -` type "dai_out"' +` type "dai_in"' ` no_pm "true"' ` stream_name "'$1`"' ` data [' -` "'$2`"' +` "'N_DAI_OUT($1)`_data_w"' +` "'N_DAI_IN($1)`_data_w_comp"' +` "'N_DAI_OUT($1)`_data_str"' +` "'$4`"' ` ]' `}')
-#W_DAI_IN(stream, data)) -define(`W_DAI_IN', `SectionWidget."'N_DAI_IN`" {' +dnl W_DAI_IN(stream, type, index, data, periods_sink, periods_source, preload) +define(`W_DAI_IN', +`SectionVendorTuples."'N_DAI_IN($1)`_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_IN($1)`_data_w_comp" {' +` tuples "'N_DAI_IN($1)`_tuples_w_comp"' +`}' +`SectionVendorTuples."'N_DAI_IN($1)`_tuples_w" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_INDEX' $3 +` }' +`}' +`SectionData."'N_DAI_IN($1)`_data_w" {' +` tuples "'N_DAI_IN($1)`_tuples_w"' +`}' +`SectionVendorTuples."'N_DAI_IN($1)`_tuples_str" {' +` tokens "sof_dai_tokens"' +` tuples."string" {' +` SOF_TKN_DAI_TYPE' $2 +` }' +`}' +`SectionData."'N_DAI_IN($1)`_data_str" {' +` tuples "'N_DAI_IN($1)`_tuples_str"' +`}' +`SectionWidget."'N_DAI_IN`" {' ` index "'PIPELINE_ID`"' -` type "dai_in"' +` type "dai_out"' ` no_pm "true"' ` stream_name "'$1`"' ` data [' -` "'$2`"' +` "'N_DAI_IN($1)`_data_w"' +` "'N_DAI_IN($1)`_data_w_comp"' +` "'N_DAI_IN($1)`_data_str"' +` "'$4`"' ` ]' `}')
-#Pipe Buffer name in pipeline (pipeline, buffer) +dnl Pipe Buffer name in pipeline (pipeline, buffer) define(`NPIPELINE_BUFFER', `BUF'$1`.'$2)
-#Pipeline name) -define(`N_PIPELINE', `PIPELINE.'PIPELINE_ID) +dnl Pipeline name) +define(`N_PIPELINE', `PIPELINE.'PIPELINE_ID`.'$1)
-#W_PIPELINE(stream, deadline, platform)) +dnl W_PIPELINE(stream, deadline, priority, frames, core, platform) define(`W_PIPELINE', -`SectionVendorTuples."'N_PIPELINE`_tuples" {' +`SectionVendorTuples."'N_PIPELINE($1)`_tuples" {' ` tokens "sof_sched_tokens"' ` tuples."word" {' -` SOF_TKN_SCHED_DEADLINE' $2 +` SOF_TKN_SCHED_DEADLINE' STR($2) +` SOF_TKN_SCHED_PRIORITY' STR($3) +` SOF_TKN_SCHED_CORE' STR($5) +` SOF_TKN_SCHED_FRAMES' STR($4) ` }' `}' -`SectionData."'N_PIPELINE`_data" {' -` tuples "'N_PIPELINE`_tuples"' +`SectionData."'N_PIPELINE($1)`_data" {' +` tuples "'N_PIPELINE($1)`_tuples"' `}' -`SectionWidget."'N_PIPELINE`" {' +`SectionWidget."'N_PIPELINE($1)`" {' ` index "'PIPELINE_ID`"' ` type "scheduler"' ` no_pm "true"' ` stream_name "'$1`"' ` data [' -` "'N_PIPELINE`_data"' -` "'$3`"' +` "'N_PIPELINE($1)`_data"' +` "'$6`"' ` ]' `}')
-#D_DAI(id, playback, capture, data)) +dnl D_DAI(id, playback, capture, data)) define(`D_DAI', `SectionDAI."'N_DAI`" {' ` index "'PIPELINE_ID`"' ` id "'$1`"' ` playback "'$2`"' ` capture "'$3`"' `}') + +dnl DAI_CLOCK(clock, freq, codec_master) +define(`DAI_CLOCK', + $1 STR($3) + $1_freq STR($2)) + + +dnl DAI_TDM(slots, width, tx_mask, rx_mask) +define(`DAI_TDM', +` tdm_slots 'STR($1) +` tdm_slot_width 'STR($2) +` tx_slots 'STR($3) +` rx_slots 'STR($4) +) + +dnl DAI_CONFIG(type, idx, name, sname, format, mclk, bclk, fsync, tdm) +define(`DAI_CONFIG', +`SectionHWConfig."'$1$2`" {' +`' +` id "'$2`"' +` format "'$5`"' +`' +` '$6 +` '$7 +` '$8 +` '$9 +`}' +`' +`SectionBE."'$3`" {' +` index "0"' +`' +` stream_name "'$4`"' +` hw_configs [' +` "'$1$2`"' +` ]' +`}') + +dnl COMP_SAMPLE_SIZE(FMT) +define(`COMP_SAMPLE_SIZE', +`ifelse( + $1, `s16le', `2', + $1, `s24_4le', `4', + $1, `s32le', `4', + `4')') + + +dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) +define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')') + + +divert(0) dnl
Add initial scheduling platform scheduling. TODO: fine tune the MIPS
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/dsps/bdw.m4 | 44 ++++++++++++++++++++++++++++++++++---------- topology/dsps/bxt.m4 | 44 ++++++++++++++++++++++++++++++++++---------- topology/dsps/byt.m4 | 44 ++++++++++++++++++++++++++++++++++---------- topology/dsps/cht.m4 | 30 ++++++++++++++++++++---------- topology/dsps/hsw.m4 | 44 ++++++++++++++++++++++++++++++++++---------- 5 files changed, 156 insertions(+), 50 deletions(-)
diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4 index 24e0156..428e8bb 100644 --- a/topology/dsps/bdw.m4 +++ b/topology/dsps/bdw.m4 @@ -7,8 +7,7 @@ SectionVendorTuples."pipe_ll_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "0" - SOF_TKN_SCHED_MIPS "50000" + SOF_TKN_SCHED_MIPS "50000" } }
@@ -21,8 +20,7 @@ SectionVendorTuples."pipe_media_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "1" - SOF_TKN_SCHED_MIPS "100000" + SOF_TKN_SCHED_MIPS "100000" } }
@@ -35,8 +33,7 @@ SectionVendorTuples."pipe_tone_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "2" - SOF_TKN_SCHED_MIPS "200000" + SOF_TKN_SCHED_MIPS "200000" } }
@@ -49,8 +46,8 @@ SectionVendorTuples."dai0p_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "0" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" } }
@@ -63,11 +60,38 @@ SectionVendorTuples."dai0c_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "1" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" } }
SectionData."dai0c_plat_conf" { tuples "dai0c_plat_tokens" } + +# PCM platform configuration +SectionVendorTuples."pcm_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC PIPELINE_DMAC + SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN + } +} + +SectionData."pcm_plat_conf" { + tuples "pcm_plat_tokens" +} + +# DAI schedule Configuration - scheduled by IRQ +SectionVendorTuples."pipe_dai_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_MIPS "5000" + } +} + +SectionData."pipe_dai_schedule_plat" { + tuples "pipe_dai_schedule_plat_tokens" +} diff --git a/topology/dsps/bxt.m4 b/topology/dsps/bxt.m4 index fe21ae8..688e9fa 100644 --- a/topology/dsps/bxt.m4 +++ b/topology/dsps/bxt.m4 @@ -7,8 +7,7 @@ SectionVendorTuples."pipe_ll_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "0" - SOF_TKN_SCHED_MIPS "50000" + SOF_TKN_SCHED_MIPS "50000" } }
@@ -21,8 +20,7 @@ SectionVendorTuples."pipe_media_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "1" - SOF_TKN_SCHED_MIPS "100000" + SOF_TKN_SCHED_MIPS "100000" } }
@@ -35,8 +33,7 @@ SectionVendorTuples."pipe_tone_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "2" - SOF_TKN_SCHED_MIPS "200000" + SOF_TKN_SCHED_MIPS "200000" } }
@@ -49,8 +46,8 @@ SectionVendorTuples."dai0p_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "0" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" } }
@@ -63,11 +60,38 @@ SectionVendorTuples."dai0c_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "1" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" } }
SectionData."dai0c_plat_conf" { tuples "dai0c_plat_tokens" } + +# PCM platform configuration +SectionVendorTuples."pcm_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC PIPELINE_DMAC + SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN + } +} + +SectionData."pcm_plat_conf" { + tuples "pcm_plat_tokens" +} + +# DAI schedule Configuration - scheduled by IRQ +SectionVendorTuples."pipe_dai_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_MIPS "5000" + } +} + +SectionData."pipe_dai_schedule_plat" { + tuples "pipe_dai_schedule_plat_tokens" +} diff --git a/topology/dsps/byt.m4 b/topology/dsps/byt.m4 index 8aa3930..b4defaa 100644 --- a/topology/dsps/byt.m4 +++ b/topology/dsps/byt.m4 @@ -7,8 +7,7 @@ SectionVendorTuples."pipe_ll_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "0" - SOF_TKN_SCHED_MIPS "50000" + SOF_TKN_SCHED_MIPS "50000" } }
@@ -21,8 +20,7 @@ SectionVendorTuples."pipe_media_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "1" - SOF_TKN_SCHED_MIPS "100000" + SOF_TKN_SCHED_MIPS "100000" } }
@@ -35,8 +33,7 @@ SectionVendorTuples."pipe_tone_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "2" - SOF_TKN_SCHED_MIPS "200000" + SOF_TKN_SCHED_MIPS "200000" } }
@@ -49,8 +46,8 @@ SectionVendorTuples."dai0p_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "0" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" } }
@@ -63,11 +60,38 @@ SectionVendorTuples."dai0c_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "1" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" } }
SectionData."dai0c_plat_conf" { tuples "dai0c_plat_tokens" } + +# PCM platform configuration +SectionVendorTuples."pcm_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC PIPELINE_DMAC + SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN + } +} + +SectionData."pcm_plat_conf" { + tuples "pcm_plat_tokens" +} + +# DAI schedule Configuration - scheduled by IRQ +SectionVendorTuples."pipe_dai_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_MIPS "5000" + } +} + +SectionData."pipe_dai_schedule_plat" { + tuples "pipe_dai_schedule_plat_tokens" +} diff --git a/topology/dsps/cht.m4 b/topology/dsps/cht.m4 index f6976aa..d315b0c 100644 --- a/topology/dsps/cht.m4 +++ b/topology/dsps/cht.m4 @@ -7,8 +7,7 @@ SectionVendorTuples."pipe_ll_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "0" - SOF_TKN_SCHED_MIPS "50000" + SOF_TKN_SCHED_MIPS "50000" } }
@@ -21,8 +20,7 @@ SectionVendorTuples."pipe_media_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "1" - SOF_TKN_SCHED_MIPS "100000" + SOF_TKN_SCHED_MIPS "100000" } }
@@ -35,8 +33,7 @@ SectionVendorTuples."pipe_tone_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "2" - SOF_TKN_SCHED_MIPS "200000" + SOF_TKN_SCHED_MIPS "200000" } }
@@ -49,8 +46,8 @@ SectionVendorTuples."dai0p_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "0" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" } }
@@ -63,11 +60,24 @@ SectionVendorTuples."dai0c_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "1" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" } }
SectionData."dai0c_plat_conf" { tuples "dai0c_plat_tokens" } + +# DAI schedule Configuration - scheduled by IRQ +SectionVendorTuples."pipe_dai_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_MIPS "5000" + } +} + +SectionData."pipe_dai_schedule_plat" { + tuples "pipe_dai_schedule_plat_tokens" +} diff --git a/topology/dsps/hsw.m4 b/topology/dsps/hsw.m4 index 1c155a9..edb417f 100644 --- a/topology/dsps/hsw.m4 +++ b/topology/dsps/hsw.m4 @@ -7,8 +7,7 @@ SectionVendorTuples."pipe_ll_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "0" - SOF_TKN_SCHED_MIPS "50000" + SOF_TKN_SCHED_MIPS "50000" } }
@@ -21,8 +20,7 @@ SectionVendorTuples."pipe_media_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "1" - SOF_TKN_SCHED_MIPS "100000" + SOF_TKN_SCHED_MIPS "100000" } }
@@ -35,8 +33,7 @@ SectionVendorTuples."pipe_tone_schedule_plat_tokens" { tokens "sof_sched_tokens"
tuples."word" { - SOF_TKN_SCHED_PRIORITY "2" - SOF_TKN_SCHED_MIPS "200000" + SOF_TKN_SCHED_MIPS "200000" } }
@@ -49,8 +46,8 @@ SectionVendorTuples."dai0p_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "0" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" } }
@@ -63,11 +60,38 @@ SectionVendorTuples."dai0c_plat_tokens" { tokens "sof_dai_tokens"
tuples."word" { - SOF_TKN_DAI_DMAC "1" - SOF_TKN_DAI_DMAC_CHAN "1" + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" } }
SectionData."dai0c_plat_conf" { tuples "dai0c_plat_tokens" } + +# PCM platform configuration +SectionVendorTuples."pcm_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC PIPELINE_DMAC + SOF_TKN_DAI_DMAC_CHAN PIPELINE_DMAC_CHAN + } +} + +SectionData."pcm_plat_conf" { + tuples "pcm_plat_tokens" +} + +# DAI schedule Configuration - scheduled by IRQ +SectionVendorTuples."pipe_dai_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_MIPS "5000" + } +} + +SectionData."pipe_dai_schedule_plat" { + tuples "pipe_dai_schedule_plat_tokens" +}
Update the pipelines to use the new buffer and scheduling tokens.
Signed-off-by: Liam Girdwood liam.r.girdwood@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)
Allow machines to specify scheduling config in pipeline topologies.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/reef-apl-nocodec.m4 | 86 ++++++++++++++++++++++++-------------------- topology/reef-bdw-rt286.m4 | 83 ++++++++++++++++++++++++------------------ topology/reef-bdw-rt5640.m4 | 83 ++++++++++++++++++++++++------------------ topology/reef-bxt-nocodec.m4 | 84 ++++++++++++++++++++++++------------------- topology/reef-byt-nocodec.m4 | 84 ++++++++++++++++++++++++------------------- topology/reef-byt-rt5640.m4 | 84 ++++++++++++++++++++++++------------------- topology/reef-byt-rt5651.m4 | 85 ++++++++++++++++++++++++------------------- topology/reef-cht-nocodec.m4 | 86 +++++++++++++++++++++++++------------------- topology/reef-hsw-rt5640.m4 | 83 ++++++++++++++++++++++++------------------ 9 files changed, 434 insertions(+), 324 deletions(-)
diff --git a/topology/reef-apl-nocodec.m4 b/topology/reef-apl-nocodec.m4 index f1c1819..93febe0 100644 --- a/topology/reef-apl-nocodec.m4 +++ b/topology/reef-apl-nocodec.m4 @@ -18,29 +18,40 @@ include(`dsps/bxt.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP2 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
-# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
- -# -# DAI configuration -# - -# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-apl-nocodec" { @@ -48,32 +59,31 @@ SectionGraph."pipe-apl-nocodec" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
- # -# BE configurations - overrides config in ACPI if present +# DAI configuration +# +# SSP port 2 is our only pipeline DAI #
-# BE configurations - overrides config in ACPI if present -SectionHWConfig."SSP2" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "19200000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} +# playback DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2)
+# capture DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) + +# +# BE configurations - overrides config in ACPI if present +# +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-bdw-rt286.m4 b/topology/reef-bdw-rt286.m4 index 38d1c6a..4135353 100644 --- a/topology/reef-bdw-rt286.m4 +++ b/topology/reef-bdw-rt286.m4 @@ -18,29 +18,40 @@ include(`dsps/bdw.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP0 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-bdw-rt286" { @@ -48,29 +59,31 @@ SectionGraph."pipe-bdw-rt286" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 0 is our only pipeline DAI +# + +# playback DAI is SSP0 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 0, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP0 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP0" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "24000000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} +DAI_CONFIG(SSP, 0, Codec, I2S, I2S, + DAI_CLOCK(mclk, 24000000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-bdw-rt5640.m4 b/topology/reef-bdw-rt5640.m4 index 4bdfdb4..540ac4c 100644 --- a/topology/reef-bdw-rt5640.m4 +++ b/topology/reef-bdw-rt5640.m4 @@ -18,29 +18,40 @@ include(`dsps/bdw.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP0 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-bdw-rt5640" { @@ -48,29 +59,31 @@ SectionGraph."pipe-bdw-rt5640" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 0 is our only pipeline DAI +# + +# playback DAI is SSP0 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 0, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP0 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP0" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "24000000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} +DAI_CONFIG(SSP, 0, Codec, I2S, I2S, + DAI_CLOCK(mclk, 24000000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 8634d3a..564e78c 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -18,29 +18,40 @@ include(`dsps/bxt.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP2 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-bxt-nocodec" { @@ -48,30 +59,31 @@ SectionGraph."pipe-bxt-nocodec" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP2" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "19200000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} - +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index 14660fa..ab0cd8e 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -18,29 +18,40 @@ include(`dsps/byt.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP2 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-byt-nocodec" { @@ -48,30 +59,31 @@ SectionGraph."pipe-byt-nocodec" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP2" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "19200000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} - +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 90acec9..2cee093 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -18,29 +18,40 @@ include(`dsps/byt.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP2 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-byt-rt5640" { @@ -48,30 +59,31 @@ SectionGraph."pipe-byt-rt5640" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP2" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "19200000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} - +DAI_CONFIG(SSP, 2, Baytrail Audio, Audio, I2S, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index e031807..4679343 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -1,5 +1,5 @@ # -# Topology for generic Baytrail board with no codec. +# Topology for generic Baytrail board with no RT5651. #
# Include topology builder @@ -18,29 +18,40 @@ include(`dsps/byt.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP2 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-byt-rt5651" { @@ -48,29 +59,31 @@ SectionGraph."pipe-byt-rt5651" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP2" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "19200000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} +DAI_CONFIG(SSP, 2, Baytrail Audio, Audio, I2S, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index 6ceed8e..f754551 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -18,29 +18,40 @@ include(`dsps/cht.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP2 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# PCM Media Playback pipeline 3 on PCM 2 -#PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
-# PCM Media Playback pipeline 4 on PCM 3 -#PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# Tone Playback pipeline 5 -#PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
- -# -# DAI configuration -# - -# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-cht-nocodec" { @@ -48,30 +59,31 @@ SectionGraph."pipe-cht-nocodec" {
lines [ # media 0 -# dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 -# dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone -# dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
# -# BE configurations - overrides config in ACPI if present +# DAI configuration # -SectionHWConfig."SSP2" { - - id "2" - format "I2S" - bclk "master" - bclk_freq "2400000" - mclk "master" - mclk_freq "19200000" - fsync "master" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2)
+# capture DAI is SSP2 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2) + +# +# BE configurations - overrides config in ACPI if present +# +DAI_CONFIG(SSP, 2, NoCodec, I2S, I2S, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3)) diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index 0648df2..cbbbfbe 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -18,29 +18,40 @@ include(`dsps/hsw.m4') # # Define the pipelines # +# PCM0 ----> volume ---------------+ +# |--low latency mixer ----> volume ----> SSP2 +# PCM2 ----> SRC -----> volume ----+ +# | +# PCM3 ----> SRC -----> volume ----+ +# | +# Tone -----> volume ----+ +# +# PCM1 <---- Volume <---- SSP0 +#
-# Low Latency playback pipeline 1 on PCM 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) - -# Low Latency capture pipeline 2 on PCM 1 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) - -# PCM Media Playback pipeline 3 on PCM 2 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) - -# PCM Media Playback pipeline 4 on PCM 3 -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, 0, 0, 1)
-# Tone Playback pipeline 5 -PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 2 for PCM audio capture data +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
+# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3)
-# -# DAI configuration -# +# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 4 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4)
-# SSP port 2 is our pipeline DAI -DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) +# Tone Playback pipeline 5 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 2 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 2, s32le, 192, 4000, 2, 0)
# Connect pipelines together SectionGraph."pipe-hsw-rt5640" { @@ -48,29 +59,31 @@ SectionGraph."pipe-hsw-rt5640" {
lines [ # media 0 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_3) # media 1 - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_4) #tone - dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_5) ] }
+# +# DAI configuration +# +# SSP port 0 is our only pipeline DAI +# + +# playback DAI is SSP0 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, SSP, 0, I2S, PIPELINE_SOURCE_1, 2) + +# capture DAI is SSP0 using I2S DAPM stream and 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2)
# # BE configurations - overrides config in ACPI if present # -SectionHWConfig."SSP0" { - - id "2" - format "I2S" - bclk_master "true" - bclk_freq "2400000" - mclk_freq "24000000" - fsyn_master "true" - fsync_freq "48000" - tdm_slots "2" - tdm_slot_width "25" - tx_slots "2" - rx_slots "2" -} +DAI_CONFIG(SSP, 0, Codec, I2S, I2S, + DAI_CLOCK(mclk, 24000000, slave), + DAI_CLOCK(bclk, 2400000, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, 24, 3, 3))
participants (1)
-
Liam Girdwood