-
Notifications
You must be signed in to change notification settings - Fork 349
Tools: Topology2: cavs-nocodec: Fix formats for Port0 first/second ca… #10081
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
Tools: Topology2: cavs-nocodec: Fix formats for Port0 first/second ca… #10081
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| # 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 | ||
| } |
Copilot
AI
Jun 30, 2025
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.
[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.
| # 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 |
|
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. |
…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.