-
Notifications
You must be signed in to change notification settings - Fork 347
Tools: Topology: Add deep buffer capture for DMIC #10393
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
singalsu
wants to merge
2
commits into
thesofproject:main
Choose a base branch
from
singalsu:add_dmic0_deepbuffer_capture
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.
+258
−0
Open
Changes from all commits
Commits
Show all changes
2 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
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
111 changes: 111 additions & 0 deletions
111
tools/topology/topology2/include/pipelines/cavs/deepbuffer-capture.conf
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,111 @@ | ||
| # | ||
| # FE capture pipeline: deepbuffer-capture | ||
| # | ||
| # All attributes defined herein are namespaced | ||
| # by alsatplg to "Object.Pipeline.deepbuffer-capture.N.attribute_name" | ||
| # | ||
| # Usage: deepbuffer-capture pipeline object can be instantiated as: | ||
| # | ||
| # Object.Pipeline.deepbuffer-capture."N" { | ||
| # period 1000 | ||
| # time_domain "timer" | ||
| # } | ||
| # | ||
| # Where N is the unique pipeline ID within the same alsaconf node. | ||
| # | ||
|
|
||
| <include/common/input_audio_format.conf> | ||
| <include/common/output_audio_format.conf> | ||
| <include/components/host-copier.conf> | ||
| <include/components/pipeline.conf> | ||
|
|
||
| Class.Pipeline."deepbuffer-capture" { | ||
|
|
||
| <include/pipelines/pipeline-common.conf> | ||
|
|
||
| attributes { | ||
| !constructor [ | ||
| "index" | ||
| ] | ||
|
|
||
| !immutable [ | ||
| "direction" | ||
| ] | ||
|
|
||
| # | ||
| # deepbuffer-capture objects instantiated within the same alsaconf node must have | ||
| # unique pipeline_id attribute | ||
| # | ||
| unique "instance" | ||
| } | ||
|
|
||
| Object.Widget { | ||
| host-copier."1" { | ||
| type "aif_out" | ||
| node_type $HDA_HOST_INPUT_CLASS | ||
| deep_buffer_dma_ms $DEEPBUFFER_FW_DMA_MS | ||
| num_input_pins 1 | ||
| num_input_audio_formats 2 | ||
| num_output_audio_formats 6 | ||
| # Input sample format is always 32-bit for capture | ||
| Object.Base.input_audio_format [ | ||
| { | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 | ||
| } | ||
| { | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 | ||
| in_channels 4 | ||
| in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| in_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| ] | ||
| Object.Base.output_audio_format [ | ||
| { | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 24 | ||
| } | ||
| { | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| } | ||
| { | ||
| out_bit_depth 16 | ||
| out_valid_bit_depth 16 | ||
| } | ||
| { | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 24 | ||
| out_channels 4 | ||
| out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| out_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| { | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| out_channels 4 | ||
| out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| out_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| { | ||
| out_bit_depth 16 | ||
| out_valid_bit_depth 16 | ||
| out_channels 4 | ||
| out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| out_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| pipeline."1" { | ||
| priority 0 | ||
| # enable lp mode | ||
| lp_mode 1 | ||
| } | ||
| } | ||
|
|
||
| direction "capture" | ||
| dynamic_pipeline 1 | ||
| time_domain "timer" | ||
| } |
117 changes: 117 additions & 0 deletions
117
tools/topology/topology2/platform/intel/dmic-deep-buffer.conf
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,117 @@ | ||
| Object.Pipeline.deepbuffer-capture [ | ||
| { | ||
| format $FORMAT | ||
| index $DMIC0_DEEP_BUFFER_PIPELINE_ID | ||
| Object.Widget.pipeline.1 { | ||
| stream_name "$DMIC0_DEEP_BUFFER_PCM_NAME" | ||
| } | ||
| Object.Widget.host-copier.1 { | ||
| stream_name $DMIC0_DEEP_BUFFER_PCM_NAME | ||
| pcm_id $DMIC0_DEEP_BUFFER_PCM_ID | ||
| num_input_audio_formats 2 | ||
| Object.Base.input_audio_format [ | ||
| { | ||
| in_rate $DMIC0_RATE | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 | ||
| } | ||
| { | ||
| in_rate $DMIC0_RATE | ||
| in_channels 4 | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 | ||
| in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| in_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| ] | ||
|
|
||
| num_output_audio_formats 6 | ||
| Object.Base.output_audio_format [ | ||
| { | ||
| out_rate $DMIC0_RATE | ||
| out_bit_depth 16 | ||
| out_valid_bit_depth 16 | ||
| } | ||
| { | ||
| out_rate $DMIC0_RATE | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 24 | ||
| } | ||
| { | ||
| out_rate $DMIC0_RATE | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| } | ||
| { | ||
| out_rate $DMIC0_RATE | ||
| out_channels 4 | ||
| out_bit_depth 16 | ||
| out_valid_bit_depth 16 | ||
| out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| out_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| { | ||
| out_rate $DMIC0_RATE | ||
| out_channels 4 | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 24 | ||
| out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| out_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| { | ||
| out_rate $DMIC0_RATE | ||
| out_channels 4 | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 | ||
| out_ch_map $CHANNEL_MAP_3_POINT_1 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| ] | ||
| Object.PCM.pcm [ | ||
| { | ||
| name "$DMIC0_DEEP_BUFFER_PCM_NAME" | ||
| id $DMIC0_DEEP_BUFFER_PCM_ID | ||
| direction "capture" | ||
| capture_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE | ||
|
|
||
| Object.Base.fe_dai."$DMIC0_DEEP_BUFFER_PCM_NAME" {} | ||
|
|
||
| Object.PCM.pcm_caps."capture" { | ||
| name $DMIC0_DEEP_BUFFER_PCM_NAME | ||
| formats 'S16_LE,S24_LE,S32_LE' | ||
| channels_min $NUM_DMICS | ||
| channels_max $NUM_DMICS | ||
| # To avoid DMA spinning on a buffer we need bigger | ||
| # buffer than the host buffer size, let's say twice as | ||
| # big | ||
| # (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2 | ||
| # | ||
| # Note: The lower limit for the buffer size is rate | ||
| # dependent | ||
| IncludeByKey.DMIC0_RATE { | ||
| "16000" { | ||
| buffer_size_min "$[(((2 * $NUM_DMICS) * 16) * $DEEPBUFFER_FW_DMA_MS) * 2]" | ||
| rates '16000' | ||
| } | ||
| "48000" { | ||
| buffer_size_min "$[(((2 * $NUM_DMICS) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]" | ||
| rates '48000' | ||
| } | ||
| "96000" { | ||
| buffer_size_min "$[(((2 * $NUM_DMICS) * 96) * $DEEPBUFFER_FW_DMA_MS) * 2]" | ||
| rates '96000' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| Object.Base.route [ | ||
| { | ||
| source "module-copier.$DMIC0_DAI_PIPELINE_ID.2" | ||
| sink "host-copier.$DMIC0_DEEP_BUFFER_PCM_ID.capture" | ||
| } | ||
| ] | ||
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 |
|---|---|---|
|
|
@@ -47,4 +47,10 @@ Define { | |
|
|
||
| # Note: This will be redefined in dmic-generic.conf if not set from cmake | ||
| DMIC0_PCM_CHANNELS 0 | ||
|
|
||
| # Deep buffer capture | ||
| DMIC0_DEEP_BUFFER_PCM_NAME "DMIC Deep Buffer" | ||
| DMIC0_DEEP_BUFFER_PIPELINE_ID 18 | ||
| DMIC0_DEEP_BUFFER_PCM_ID 46 | ||
|
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. Longterm, do we have a topology file that lists all PCM IDs ? Not a blocker now. |
||
| DMIC0_DEEP_BUFFER false | ||
| } | ||
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
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.
The route configuration references 'module-copier.$DMIC0_DAI_PIPELINE_ID.2' but there is no comment explaining what the '.2' suffix represents or why this specific instance is used. Adding a brief comment would improve maintainability.