-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add topology1 for CTC component. Signed-off-by: Eddy Hsu <eddyhsu@google.com>
- Loading branch information
Eddy Hsu
committed
Feb 12, 2025
1 parent
f35420b
commit 7ff357f
Showing
3 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
tools/topology/topology1/m4/google_ctc_audio_processing.m4
This file contains 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,65 @@ | ||
divert(-1) | ||
|
||
dnl Define macro for CTC Processing effect widget | ||
DECLARE_SOF_RT_UUID("google-ctc-audio-processing", google_ctc_audio_processing_uuid, | ||
0xbf0e1bbc, 0xdc6a, 0x45fe, 0xbc, 0x90, 0x25, 0x54, 0xcb, 0x13, 0x7a, 0xb4) | ||
|
||
dnl N_GOOGLE_CTC_AUDIO_PROCESSING(name) | ||
define(`N_GOOGLE_CTC_AUDIO_PROCESSING', `GOOGLE_CTC_AUDIO_PROCESSING'PIPELINE_ID`.'$1) | ||
|
||
dnl W_GOOGLE_CTC_AUDIO_PROCESSING(name, format, periods_sink, periods_source, core, kcontrols_list) | ||
define(`W_GOOGLE_CTC_AUDIO_PROCESSING', | ||
`SectionVendorTuples."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_uuid" {' | ||
` tokens "sof_comp_tokens"' | ||
` tuples."uuid" {' | ||
` SOF_TKN_COMP_UUID' STR(google_ctc_audio_processing_uuid) | ||
` }' | ||
`}' | ||
`SectionData."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_uuid" {' | ||
` tuples "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_uuid"' | ||
`}' | ||
`SectionVendorTuples."'N_GOOGLE_CTC_AUDIO_PROCESSING($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_CORE_ID' STR($5) | ||
` }' | ||
`}' | ||
`SectionData."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_w" {' | ||
` tuples "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_w"' | ||
`}' | ||
`SectionVendorTuples."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_str" {' | ||
` tokens "sof_comp_tokens"' | ||
` tuples."string" {' | ||
` SOF_TKN_COMP_FORMAT' STR($2) | ||
` }' | ||
`}' | ||
`SectionData."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_str" {' | ||
` tuples "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_str"' | ||
`}' | ||
`SectionVendorTuples."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_str_type" {' | ||
` tokens "sof_process_tokens"' | ||
` tuples."string" {' | ||
` SOF_TKN_PROCESS_TYPE' "GOOGLE_CTC_AUDIO_PROCESSING" | ||
` }' | ||
`}' | ||
`SectionData."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_str_type" {' | ||
` tuples "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_tuples_str_type"' | ||
`}' | ||
`SectionWidget."'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`" {' | ||
` index "'PIPELINE_ID`"' | ||
` type "effect"' | ||
` no_pm "true"' | ||
` data [' | ||
` "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_uuid"' | ||
` "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_w"' | ||
` "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_str"' | ||
` "'N_GOOGLE_CTC_AUDIO_PROCESSING($1)`_data_str_type"' | ||
` ]' | ||
` bytes [' | ||
$6 | ||
` ]' | ||
`}') | ||
|
||
divert(0)dnl |
10 changes: 10 additions & 0 deletions
10
tools/topology/topology1/m4/google_ctc_audio_processing_coef_default.m4
This file contains 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,10 @@ | ||
CONTROLBYTES_PRIV(DEF_CTC_PRIV, | ||
` bytes "0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,' | ||
` 0x18,0x10,0x00,0x00,0x00,0xD0,0x01,0x03,' | ||
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' | ||
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' | ||
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' | ||
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' | ||
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' | ||
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00"' | ||
) |
This file contains 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,79 @@ | ||
# CTC Pipeline and PCM | ||
# | ||
# Pipeline Endpoints for connection are :- | ||
# | ||
# host PCM_P --> B0 --> CTC --> B1 --> sink DAI0 | ||
|
||
# Include topology builder | ||
include(`utils.m4') | ||
include(`buffer.m4') | ||
include(`pcm.m4') | ||
include(`dai.m4') | ||
include(`bytecontrol.m4') | ||
include(`pipeline.m4') | ||
include(`google_ctc_audio_processing.m4') | ||
|
||
# | ||
# Controls | ||
# | ||
|
||
# Host "Playback with codec adapter" PCM | ||
# with 2 sink and 0 source periods | ||
W_PCM_PLAYBACK(PCM_ID, CTC Processing Playback, 2, 0, SCHEDULE_CORE) | ||
|
||
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) | ||
|
||
# | ||
# Components and Buffers | ||
# | ||
|
||
W_GOOGLE_CTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, 2, 2, SCHEDULE_CORE, | ||
LIST(` ', "DEF_CTC_BYTES")) | ||
|
||
# Playback Buffers | ||
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) | ||
W_BUFFER(1, COMP_BUFFER_SIZE(DAI_PERIODS, | ||
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), | ||
PLATFORM_DAI_MEM_CAP) | ||
|
||
# | ||
# Pipeline Graph | ||
# | ||
# host PCM_P --> B0 --> CTC -> B1 --> sink DAI0 | ||
|
||
P_GRAPH(pipe-ctc-playback, PIPELINE_ID, | ||
LIST(` ', | ||
`dapm(N_BUFFER(0), N_PCMP(PCM_ID))', | ||
`dapm(N_GOOGLE_CTC_AUDIO_PROCESSING(0), N_BUFFER(0))', | ||
`dapm(N_BUFFER(1), N_GOOGLE_CTC_AUDIO_PROCESSING(0))')) | ||
|
||
# | ||
# Pipeline Source and Sinks | ||
# | ||
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1)) | ||
indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), CTC Processing Playback PCM_ID) | ||
|
||
# | ||
# PCM Configuration | ||
# | ||
|
||
PCM_CAPABILITIES(CTC Processing 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') |