diff --git a/tools/topology/sof-tgl-max98357a-rt5682.m4 b/tools/topology/sof-tgl-max98357a-rt5682.m4 index 4ee1128394a6..688b91747c74 100644 --- a/tools/topology/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/sof-tgl-max98357a-rt5682.m4 @@ -101,7 +101,7 @@ PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s24le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, +PIPELINE_PCM_ADD(sof/pipe-waves-playback.m4, 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) diff --git a/tools/topology/sof/pipe-volume-demux-playback.m4 b/tools/topology/sof/pipe-volume-demux-playback.m4 index 409e1281e7cd..a1999560a32f 100644 --- a/tools/topology/sof/pipe-volume-demux-playback.m4 +++ b/tools/topology/sof/pipe-volume-demux-playback.m4 @@ -21,6 +21,62 @@ include(`pga.m4') include(`muxdemux.m4') include(`mixercontrol.m4') include(`bytecontrol.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`codec_adapter.m4') + +ifdef(`PP_CORE',`', `define(`PP_CORE', 1)') + +CONTROLBYTES_PRIV(PP_SETUP_CONFIG, +` bytes "0x53,0x4f,0x46,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x20,0x00,0x00,0x00,' +` 0x00,0x10,0x00,0x03,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' + +` 0x00,0x01,0x41,0x57,' +` 0x00,0x00,0x00,0x00,' +` 0x80,0xBB,0x00,0x00,' +` 0x20,0x00,0x00,0x00,' +` 0x02,0x00,0x00,0x00,' + +` 0x00,0x00,0x00,0x00,' +` 0x0c,0x00,0x00,0x00,' + +` 0x00,0x00,0x00,0x00"' +) + +# Post process Bytes control for setup config +C_CONTROLBYTES(MaxxChrome Setup PIPELINE_ID, PIPELINE_ID, + CONTROLBYTES_OPS(bytes), + CONTROLBYTES_EXTOPS(void, 258, 258), + , , , + CONTROLBYTES_MAX(, 8192), + , + PP_SETUP_CONFIG) + +CONTROLBYTES_PRIV(PP_RUNTIME_PARAMS, +` bytes "0x53,0x4f,0x46,0x00,' +` 0x01,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x10,0x00,0x03,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00"' +) + +# Post process Bytes control for runtime config +C_CONTROLBYTES(MaxxChrome Runtime PIPELINE_ID, PIPELINE_ID, + CONTROLBYTES_OPS(bytes), + CONTROLBYTES_EXTOPS(void, 258, 258), + , , , + CONTROLBYTES_MAX(, 8192), + , + PP_RUNTIME_PARAMS) # demux Bytes control with max value of 255 C_CONTROLBYTES(concat(`DEMUX', PIPELINE_ID), PIPELINE_ID, @@ -60,6 +116,9 @@ W_DATA(DEF_PGA_CONF, DEF_PGA_TOKENS) # with 2 sink and 0 source periods W_PCM_PLAYBACK(PCM_ID, Low Latency Playback, 2, 0, SCHEDULE_CORE) +W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, PP_CORE, + LIST(` ', "MaxxChrome Runtime PIPELINE_ID", "MaxxChrome Setup PIPELINE_ID")) + # "Master Playback Volume" has 2 source and x sink periods for DAI ping-pong W_PGA(1, PIPELINE_FORMAT, DAI_PERIODS, 2, DEF_PGA_CONF, SCHEDULE_CORE, LIST(` ', "PIPELINE_ID Master Playback Volume")) @@ -69,6 +128,9 @@ W_MUXDEMUX(0, 1, PIPELINE_FORMAT, 2, 2, SCHEDULE_CORE, LIST(` ', concat(`DEMUX', PIPELINE_ID))) # Low Latency Buffers +W_BUFFER(3, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_HOST_MEM_CAP) W_BUFFER(0, COMP_BUFFER_SIZE(2, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), PLATFORM_HOST_MEM_CAP) @@ -86,7 +148,9 @@ W_BUFFER(2, COMP_BUFFER_SIZE(DAI_PERIODS, P_GRAPH(pipe-ll-playback-PIPELINE_ID, PIPELINE_ID, LIST(` ', - `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', + `dapm(N_BUFFER(3), N_PCMP(PCM_ID))', + `dapm(N_CODEC_ADAPTER(0), N_BUFFER(3))', + `dapm(N_BUFFER(0), N_CODEC_ADAPTER(0))', `dapm(N_PGA(1), N_BUFFER(0))', `dapm(N_BUFFER(1), N_PGA(1))', `dapm(N_MUXDEMUX(0), N_BUFFER(1))', diff --git a/tools/topology/sof/pipe-waves-playback.m4 b/tools/topology/sof/pipe-waves-playback.m4 new file mode 100644 index 000000000000..670715222e89 --- /dev/null +++ b/tools/topology/sof/pipe-waves-playback.m4 @@ -0,0 +1,121 @@ +# Low Latency Passthrough with codec_adapter Pipeline and PCM +# codec_adapter instantiates Waves codec +# +# Pipeline Endpoints for connection are :- +# +# host PCM_P --> B0 --> Codec Adapter --> B1 --> sink DAI0 + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`codec_adapter.m4') +include(`bytecontrol.m4') + +ifdef(`PP_CORE',`', `define(`PP_CORE', 1)') + +# +# Controls +# + +# Post process setup config +CONTROLBYTES_PRIV(PP_SETUP_CONFIG, +` bytes "0x53,0x4f,0x46,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x20,0x00,0x00,0x00,' +` 0x00,0x10,0x00,0x03,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' + +` 0x00,0x01,0x41,0x57,' +` 0x00,0x00,0x00,0x00,' +` 0x80,0xBB,0x00,0x00,' +` 0x20,0x00,0x00,0x00,' +` 0x02,0x00,0x00,0x00,' + +` 0x00,0x00,0x00,0x00,' +` 0x0c,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00"' +) + +# Post process Bytes control for setup config +C_CONTROLBYTES(MaxxChrome Setup PIPELINE_ID, PIPELINE_ID, + CONTROLBYTES_OPS(bytes), + CONTROLBYTES_EXTOPS(void, 258, 258), + , , , + CONTROLBYTES_MAX(, 8192), + , + PP_SETUP_CONFIG) + +# Post process runtime params +CONTROLBYTES_PRIV(PP_RUNTIME_PARAMS, +` bytes "0x53,0x4f,0x46,0x00,' +` 0x01,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x10,0x00,0x03,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00"' +) + +# Post process Bytes control for runtime config +C_CONTROLBYTES(MaxxChrome Runtime PIPELINE_ID, PIPELINE_ID, + CONTROLBYTES_OPS(bytes), + CONTROLBYTES_EXTOPS(void, 258, 258), + , , , + CONTROLBYTES_MAX(, 8192), + , + PP_RUNTIME_PARAMS) + + + +# +# Components and Buffers +# + +# Host "Playback with post process" PCM +# with 2 sink and 0 source periods +W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, DAI_PERIODS, 0, SCHEDULE_CORE) + + +# Codec Adapter +W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, PP_CORE, + LIST(` ', "MaxxChrome Runtime PIPELINE_ID", "MaxxChrome Setup PIPELINE_ID")) + +# Playback Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_HOST_MEM_CAP, SCHEDULE_CORE) +W_BUFFER(1, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP, SCHEDULE_CORE) + + +# +# Pipeline Graph +# +# host PCM_P --> B0 --> CODEC_ADAPTER -> B1 --> sink DAI0 + +P_GRAPH(pipe-pass-playback-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', + `dapm(N_CODEC_ADAPTER(0), N_BUFFER(0))', + `dapm(N_BUFFER(1), N_CODEC_ADAPTER(0))')) + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID) + + +# +# PCM Configuration +# + +PCM_CAPABILITIES(Passthrough Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) \ No newline at end of file