Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/topology/sof-tgl-max98357a-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we just need to hide this change behind a flag similar to line L#254

PIPELINE_PCM_ADD(sof/pipe-waves-playback.m4,
2, 1, 2, s32le,
1000, 0, 0,
48000, 48000, 48000)
Expand Down
66 changes: 65 additions & 1 deletion tools/topology/sof/pipe-volume-demux-playback.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,62 @@ include(`pga.m4')
include(`muxdemux.m4')
include(`mixercontrol.m4')
include(`bytecontrol.m4')
include(`dai.m4')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this file i think it might be better to just copy this file and make a "waves-demux" pipeline

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,
Expand Down Expand Up @@ -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"))
Expand All @@ -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)
Expand All @@ -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))',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pipe-volume-demux-playback.m4 is quite generic, adding codec_adapter to this makes confusion, as @cujomalainey commented, create a new .m4 for it is better choice.

`dapm(N_PGA(1), N_BUFFER(0))',
`dapm(N_BUFFER(1), N_PGA(1))',
`dapm(N_MUXDEMUX(0), N_BUFFER(1))',
Expand Down
121 changes: 121 additions & 0 deletions tools/topology/sof/pipe-waves-playback.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Low Latency Passthrough with codec_adapter Pipeline and PCM
# codec_adapter instantiates Waves codec
#
Copy link
Collaborator

@dbaluta dbaluta Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what is the utility of pipe-codec-adapter-playback.m4 if we create this kind of files for each new type of codec.

Cc: @johnylin76

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point that might be the better solution, good point for the generic pipeline, demux will likely sill need copying.

# 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi all files need a new line at the end.