forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
[mt8196] waves codec and google ctc integration #1
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
Open
johnylin76
wants to merge
3
commits into
main
Choose a base branch
from
main-waves-ctc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| CONFIG_COMP_MODULE_ADAPTER=y | ||
| CONFIG_WAVES_CODEC=y | ||
| CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,9 @@ define(`W_GOOGLE_CTC_AUDIO_PROCESSING', | |
| ` bytes [' | ||
| $6 | ||
| ` ]' | ||
| ` mixer [' | ||
| $7 | ||
| ` ]' | ||
| `}') | ||
|
|
||
| divert(0)dnl | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 155 additions & 0 deletions
155
tools/topology/topology1/sof/pipe-waves-codec-ctc-playback.m4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| # Low Latency Waves codec and CTC Pipeline and PCM | ||
| # | ||
| # Pipeline Endpoints for connection are :- | ||
| # | ||
| # host PCM_P --> B0 --> Waves codec --> B1 --> CTC --> B2 --> sink DAI0 | ||
|
|
||
| # Include topology builder | ||
| include(`utils.m4') | ||
| include(`buffer.m4') | ||
| include(`pcm.m4') | ||
| include(`dai.m4') | ||
| include(`pipeline.m4') | ||
| include(`bytecontrol.m4') | ||
| include(`mixercontrol.m4') | ||
| include(`google_ctc_audio_processing.m4') | ||
|
|
||
| ifdef(`ENDPOINT_NAME',`',`fatal_error(`Pipe requires ENDPOINT_NAME to be defined: Speakers, Headphones, etc.')') | ||
|
|
||
| # Waves codec setup config | ||
| define(`CA_SETUP_CONTROLBYTES', | ||
| `` bytes "0x53,0x4f,0x46,0x00,' | ||
| ` 0x00,0x00,0x00,0x00,' | ||
| ` 0x0C,0x00,0x00,0x00,' | ||
| ` 0x00,0x10,0x00,0x03,' | ||
| ` 0x00,0x00,0x00,0x00,' | ||
| ` 0x00,0x00,0x00,0x00,' | ||
| ` 0x00,0x00,0x00,0x00,' | ||
| ` 0x00,0x00,0x00,0x00,' | ||
|
|
||
| ` 0x00,0x00,0x00,0x00,' | ||
| ` 0x0c,0x00,0x00,0x00,' | ||
| ` 0x00,0x00,0x00,0x00"'' | ||
| ) | ||
| define(`CA_SETUP_CONTROLBYTES_MAX', 8192) | ||
| define(`CA_SETUP_CONTROLBYTES_NAME', `Waves' `ENDPOINT_NAME' `Setup ') | ||
|
|
||
| define(`CA_SCHEDULE_CORE', 0) | ||
|
|
||
| DECLARE_SOF_RT_UUID("Waves codec", waves_codec_uuid, 0xd944281a, 0xafe9, | ||
| 0x4695, 0xa0, 0x43, 0xd7, 0xf6, 0x2b, 0x89, 0x53, 0x8e); | ||
| define(`CA_UUID', waves_codec_uuid) | ||
|
|
||
| # Include codec_adapter after CA_UUID definition | ||
| include(`codec_adapter.m4') | ||
|
|
||
| define(CA_SETUP_CONFIG, concat(`ca_setup_config_', PIPELINE_ID)) | ||
| define(CA_SETUP_CONTROLBYTES_NAME_PIPE, concat(CA_SETUP_CONTROLBYTES_NAME, PIPELINE_ID)) | ||
|
|
||
| # Codec adapter setup config | ||
| CONTROLBYTES_PRIV(CA_SETUP_CONFIG, CA_SETUP_CONTROLBYTES) | ||
|
|
||
| # Codec adapter Bytes control for setup config | ||
| C_CONTROLBYTES(CA_SETUP_CONTROLBYTES_NAME_PIPE, PIPELINE_ID, | ||
| CONTROLBYTES_OPS(bytes), | ||
| CONTROLBYTES_EXTOPS(void, 258, 258), | ||
| , , , | ||
| CONTROLBYTES_MAX(void, CA_SETUP_CONTROLBYTES_MAX), | ||
| , | ||
| CA_SETUP_CONFIG) | ||
|
|
||
| define(DEF_CTC_PRIV, concat(`ctc_priv_', PIPELINE_ID)) | ||
| define(DEF_CTC_BYTES, concat(`ctc_bytes_', PIPELINE_ID)) | ||
| include(`google_ctc_audio_processing_coef_default.m4') | ||
|
|
||
| # CTC Bytes control | ||
| C_CONTROLBYTES(DEF_CTC_BYTES, PIPELINE_ID, | ||
| CONTROLBYTES_OPS(bytes, | ||
| 258 binds the mixer control to bytes get/put handlers, | ||
| 258, 258), | ||
| CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, | ||
| 258, 258), | ||
| , , , | ||
| CONTROLBYTES_MAX(void, 4244), | ||
| , | ||
| DEF_CTC_PRIV) | ||
|
|
||
| define(DEF_CTC_SWITCH, concat(`ctc_enable_', PIPELINE_ID)) | ||
| define(`CONTROL_NAME', `DEF_CTC_SWITCH') | ||
| C_CONTROLMIXER(DEF_CTC_SWITCH, PIPELINE_ID, | ||
| CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259), | ||
| CONTROLMIXER_MAX(max 1 indicates switch type control, 1), | ||
| false, | ||
| , | ||
| Channel register and shift for Front Center, | ||
| LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)), | ||
| "1") | ||
| undefine(`CONTROL_NAME') | ||
|
|
||
| # | ||
| # Components and Buffers | ||
| # | ||
|
|
||
| # For codec developers, please define the schedule core of codec adapter if it you would like it to | ||
| # be different from SCHEDULE_CORE. | ||
| ifdef(`CA_SCHEDULE_CORE',`', `define(`CA_SCHEDULE_CORE', `SCHEDULE_CORE')') | ||
|
|
||
| # Host "Playback with codec adapter" PCM | ||
| # with DAI_PERIODS sink and 0 source periods | ||
| W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, DAI_PERIODS, 0, SCHEDULE_CORE) | ||
|
|
||
| W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, CA_SCHEDULE_CORE, | ||
| LIST(` ', "CA_SETUP_CONTROLBYTES_NAME_PIPE")) | ||
|
|
||
| W_GOOGLE_CTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, SCHEDULE_CORE, | ||
| LIST(` ', "DEF_CTC_BYTES"), | ||
| LIST(` ', "DEF_CTC_SWITCH")) | ||
|
|
||
| # 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) | ||
| W_BUFFER(2, 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 --> Waves codec --> B1 --> CTC --> B2 --> sink DAI0 | ||
|
|
||
| P_GRAPH(pipe-codec-adapter-ctc-playback, 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))', | ||
| `dapm(N_GOOGLE_CTC_AUDIO_PROCESSING(0), N_BUFFER(1))', | ||
| `dapm(N_BUFFER(2), N_GOOGLE_CTC_AUDIO_PROCESSING(0))', | ||
| )) | ||
|
|
||
| # | ||
| # Pipeline Source and Sinks | ||
| # | ||
| indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2)) | ||
| 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) | ||
|
|
||
| undefine(`DEF_CTC_PRIV') | ||
| undefine(`DEF_CTC_BYTES') | ||
| undefine(`DEF_CTC_SWITCH') | ||
|
|
||
| undefine(`CA_SETUP_CONTROLBYTES_NAME_PIPE') | ||
| undefine(`CA_SETUP_PARAMS') | ||
|
|
||
| undefine(`CA_SCHEDULE_CORE') | ||
| undefine(`CA_SETUP_CONTROLBYTES_NAME') | ||
| undefine(`CA_SETUP_CONTROLBYTES_MAX') | ||
| undefine(`CA_SETUP_CONTROLBYTES') | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[fixed] this include line should be moved after line#40, i.e.
CA_UUIDdefinition for Waves module. Otherwise,CA_UUIDwill be set a default value so during device boot while the kernel enables this pipeline, it cannot find the matched UUID and crashes.