Tools: Topology2: cavs-nocodec: Fix formats for Port0 first/second ca…#10081
Merged
kv2019i merged 1 commit intothesofproject:mainfrom Jul 1, 2025
Merged
Conversation
…pture The 'Port0' and 'Port0 2nd' branches out at module-copier.8.2, which only supports 32bit in/out format. The two branch on top of it is identical: module-copier.X.2 - 16/32 in/out support gain.X.1 - 16/32 in/out support host-copier.X.capture - 32bit in, and various output formats. In these branches from module-copier.8.2 to the host-copier we cannot have 16bit format, so update the module-copier and gain audio format definitions to reflect this. The current way causes errors if one of the branch is already in use and the second branch is started since the module-copier.8.2 has been already configured, we skip it's configuration but the next copier have multiple formats to be chosen from and this can cause misconfiguration of formats. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that both the primary and secondary Port0 branches use only 32-bit audio formats by explicitly defining 32-bit input and output configurations.
- Restricts module-copier and gain branches to a single 32-bit format
- Adds
num_input_audio_formats,num_output_audio_formatsand corresponding format blocks for both Port0 instances
Comments suppressed due to low confidence (1)
tools/topology/topology2/cavs-nocodec.conf:421
- [nitpick] The comment mentions 48 KHz and 2 channels, but the block only defines bit depths. If sample rate and channel count need explicit configuration, consider adding them here or adjust the comment to avoid confusion.
# 32-bit 48KHz 2ch
Comment on lines
+473
to
+504
| # 32-bit 48KHz 2ch | ||
| { | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 | ||
| } | ||
| ] | ||
|
|
||
| num_output_audio_formats 1 | ||
| Object.Base.output_audio_format [ | ||
| { | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| } | ||
| ] | ||
| } | ||
| Object.Widget.module-copier.2 { | ||
| num_input_audio_formats 1 | ||
|
|
||
| Object.Base.input_audio_format [ | ||
| # 32-bit 48KHz 2ch | ||
| { | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 | ||
| } | ||
| ] | ||
|
|
||
| num_output_audio_formats 1 | ||
| Object.Base.output_audio_format [ | ||
| { | ||
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| } |
There was a problem hiding this comment.
[nitpick] These input/output format blocks are duplicated for both Port0 branches. Consider extracting the 32-bit format definition into a shared template or macro to reduce repetition and ease future updates.
Suggested change
| # 32-bit 48KHz 2ch | |
| { | |
| in_bit_depth 32 | |
| in_valid_bit_depth 32 | |
| } | |
| ] | |
| num_output_audio_formats 1 | |
| Object.Base.output_audio_format [ | |
| { | |
| out_bit_depth 32 | |
| out_valid_bit_depth 32 | |
| } | |
| ] | |
| } | |
| Object.Widget.module-copier.2 { | |
| num_input_audio_formats 1 | |
| Object.Base.input_audio_format [ | |
| # 32-bit 48KHz 2ch | |
| { | |
| in_bit_depth 32 | |
| in_valid_bit_depth 32 | |
| } | |
| ] | |
| num_output_audio_formats 1 | |
| Object.Base.output_audio_format [ | |
| { | |
| out_bit_depth 32 | |
| out_valid_bit_depth 32 | |
| } | |
| # Use shared 32-bit format template | |
| @include:32bit_audio_format | |
| ] | |
| num_output_audio_formats 1 | |
| Object.Base.output_audio_format [ | |
| # Use shared 32-bit format template | |
| @include:32bit_audio_format | |
| ] | |
| } | |
| Object.Widget.module-copier.2 { | |
| num_input_audio_formats 1 | |
| Object.Base.input_audio_format [ | |
| # Use shared 32-bit format template | |
| @include:32bit_audio_format | |
| ] | |
| num_output_audio_formats 1 | |
| Object.Base.output_audio_format [ | |
| # Use shared 32-bit format template | |
| @include:32bit_audio_format |
Contributor
Author
|
Fixes the issue which was made visible by thesofproject/linux#5435 The problem has been present for a long time, but it has not been failing due to the fact that we were happily accepted a wrong configuration of formats. |
kv2019i
approved these changes
Jun 30, 2025
bardliao
approved these changes
Jun 30, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…pture
The 'Port0' and 'Port0 2nd' branches out at module-copier.8.2, which only supports 32bit in/out format.
The two branch on top of it is identical:
module-copier.X.2 - 16/32 in/out support
gain.X.1 - 16/32 in/out support
host-copier.X.capture - 32bit in, and various output formats.
In these branches from module-copier.8.2 to the host-copier we cannot have 16bit format, so update the module-copier and gain audio format definitions to reflect this.
The current way causes errors if one of the branch is already in use and the second branch is started since the module-copier.8.2 has been already configured, we skip it's configuration but the next copier have multiple formats to be chosen from and this can cause misconfiguration of formats.