-
Notifications
You must be signed in to change notification settings - Fork 350
topology: add Waves codec #3951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,62 @@ include(`pga.m4') | |
| include(`muxdemux.m4') | ||
| include(`mixercontrol.m4') | ||
| include(`bytecontrol.m4') | ||
| include(`dai.m4') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
|
@@ -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))', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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))', | ||
|
|
||
| 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 | ||
| # | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder what is the utility of Cc: @johnylin76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fyi all files need a new line at the end. |
||
There was a problem hiding this comment.
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