Skip to content

Conversation

@ujfalusi
Copy link
Contributor

…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.

…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>
Copy link

Copilot AI left a 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_formats and 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
}
Copy link

Copilot AI Jun 30, 2025

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.

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

Copilot uses AI. Check for mistakes.
@ujfalusi
Copy link
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 kv2019i merged commit 4ecaa95 into thesofproject:main Jul 1, 2025
25 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants