Skip to content

topology2: add support form compressed playback#10547

Open
ujfalusi wants to merge 5 commits intothesofproject:mainfrom
ujfalusi:peter/pr/ipc4_compr_topology
Open

topology2: add support form compressed playback#10547
ujfalusi wants to merge 5 commits intothesofproject:mainfrom
ujfalusi:peter/pr/ipc4_compr_topology

Conversation

@ujfalusi
Copy link
Contributor

@ujfalusi ujfalusi commented Feb 13, 2026

Hi,

the PR adds support for compressed playback pipeline which can be connected to a mixout widget to be mixed with normal PCM streams.
Both cavs-hda-generic and cavs-sdw based topologies can enable the support and the PR enables three for now:
sof-hda-generic-compr.tplg in production
sof-arl-cs42l43-l0-compr.tplg and sof-ptl-rt722-compr.tplg in development.

The implementation supports different endpoint configuration on sdw: Jack only, Speaker only or both Jack and Speaker.
In theory this can be enabled in functions as well, but not tested.

To play mp3 to HDA analog or Soundwire jack:
cplay -c0 -d50 -I MP3 <path to mp3 file>

To play mp3 to Soundwire Speaker:
cplay -c0 -d52 -I MP3 <path to mp3 file>

Copilot AI review requested due to automatic review settings February 13, 2026 10:35
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 adds support for compressed audio playback pipelines that can be mixed with normal PCM streams through a mixout widget. The implementation enables compressed playback for both HDA-generic and SoundWire-based topologies.

Changes:

  • Added compressed playback pipeline configuration files and component definitions (decoder/encoder widgets)
  • Enabled compressed playback in three topology configurations: sof-hda-generic-compr.tplg (production), sof-arl-cs42l43-l0-compr.tplg and sof-ptl-rt722-compr.tplg (development)
  • Added support for flexible SoundWire endpoint configurations (Jack only, Speaker only, or both)

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tools/topology/topology2/sof-hda-generic.conf Includes new compressed playback configuration files
tools/topology/topology2/production/tplg-targets-hda-generic.cmake Adds production build target for HDA generic compressed topology
tools/topology/topology2/platform/intel/compr.conf Defines compressed playback pipeline configurations for Jack and Speaker endpoints
tools/topology/topology2/platform/intel/compr-default.conf Provides default settings for compressed audio playback
tools/topology/topology2/include/pipelines/cavs/compr-playback.conf Defines the compressed playback pipeline class structure
tools/topology/topology2/include/components/encoder.conf Adds encoder widget component definition
tools/topology/topology2/include/components/decoder.conf Adds decoder widget component definition
tools/topology/topology2/development/tplg-targets.cmake Adds development build targets for SoundWire topologies with compressed support
tools/topology/topology2/cavs-sdw.conf Integrates compressed playback support into SoundWire topology with endpoint-specific configuration
tools/topology/topology2/cavs-mixin-mixout-hda.conf Adds compressed playback pipeline definitions for HDA analog output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +279 to +280
# converts the input to 48KHz
# note: this is wrong for 96/192KHz HiRes audio!!!!
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment indicates known incorrect behavior for high-resolution audio at 96/192KHz sample rates. This should either be fixed or the limitation should be documented more clearly with an explanation of why this limitation exists and what the impact is.

Suggested change
# converts the input to 48KHz
# note: this is wrong for 96/192KHz HiRes audio!!!!
# Sample-rate conversion stage.
# NOTE: This SRC always converts the input to 48 kHz (see rate_out below),
# including 96/192 kHz high-resolution streams. This is a known limitation
# of this topology: downstream widgets (gain/mixin) are constrained to
# 48 kHz operation, so high-resolution audio is downsampled to 48 kHz
# and is not preserved end-to-end. Use an alternative pipeline/topology
# if true 96/192 kHz playback is required.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it brief as it was.

Comment on lines 631 to 634
out_bit_depth [ 32 ]
out_valid_bit_depth [ 32 ]
}
]
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation with tabs vs spaces. Lines 631-633 use spaces while the rest of the file uses tabs, making the code harder to maintain and visually inconsistent.

Suggested change
out_bit_depth [ 32 ]
out_valid_bit_depth [ 32 ]
}
]
out_bit_depth [ 32 ]
out_valid_bit_depth [ 32 ]
}
]

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

}

# converts the input to 48KHz
# note: this is wrong for 96/192KHz HiRes audio!!!!
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of the same issue on line 280. This comment indicates known incorrect behavior for high-resolution audio at 96/192KHz sample rates. This should either be fixed or the limitation should be documented more clearly.

Suggested change
# note: this is wrong for 96/192KHz HiRes audio!!!!
# NOTE: This SRC unconditionally resamples all input (including 96/192 kHz
# high‑resolution audio) down to 48 kHz. As a result, this pipeline
# does not preserve bit‑perfect 96/192 kHz playback and currently
# does not support true HiRes output at those sample rates.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,63 @@
#
# Decoder widget component definition
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment incorrectly says 'Decoder widget component definition' when this file defines an encoder widget.

Suggested change
# Decoder widget component definition
# Encoder widget component definition

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, copy-paste

Comment on lines 58 to 62
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation with leading spaces instead of tabs as used elsewhere in the file.

Suggested change
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment on lines 58 to 62
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation with leading spaces instead of tabs as used elsewhere in the file.

Suggested change
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1

Copilot uses AI. Check for mistakes.
Comment on lines 58 to 62
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation with leading spaces instead of tabs as used elsewhere in the file.

Suggested change
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1
# cadence codec UUID
uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa"
no_pm "true"
num_output_pins 1
num_input_pins 1

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid

Comment on lines 87 to 93
COMPR_PCM_NAME 'Compr Jack Out'

COMPR_2_PIPELINE_ID 32
COMPR_2_PCM_ID 52
COMPR_2_PIPELINE_SRC 'mixin.32.1'
COMPR_2_PIPELINE_SINK 'mixout.21.1'
COMPR_2_PCM_NAME 'Compr Speaker'
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The abbreviated name 'Compr' is less clear than 'Compressed'. Consider using 'Compressed Jack Out' for consistency and clarity.

Suggested change
COMPR_PCM_NAME 'Compr Jack Out'
COMPR_2_PIPELINE_ID 32
COMPR_2_PCM_ID 52
COMPR_2_PIPELINE_SRC 'mixin.32.1'
COMPR_2_PIPELINE_SINK 'mixout.21.1'
COMPR_2_PCM_NAME 'Compr Speaker'
COMPR_PCM_NAME 'Compressed Jack Out'
COMPR_2_PIPELINE_ID 32
COMPR_2_PCM_ID 52
COMPR_2_PIPELINE_SRC 'mixin.32.1'
COMPR_2_PIPELINE_SINK 'mixout.21.1'
COMPR_2_PCM_NAME 'Compressed Speaker'

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

COMPR_2_PCM_ID 52
COMPR_2_PIPELINE_SRC 'mixin.32.1'
COMPR_2_PIPELINE_SINK 'mixout.21.1'
COMPR_2_PCM_NAME 'Compr Speaker'
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The abbreviated name 'Compr' is less clear than 'Compressed'. Consider using 'Compressed Speaker' for consistency and clarity.

Suggested change
COMPR_2_PCM_NAME 'Compr Speaker'
COMPR_2_PCM_NAME 'Compressed Speaker'

Copilot uses AI. Check for mistakes.
COMPR_PCM_ID 50
COMPR_PIPELINE_SRC 'mixin.20.1'
COMPR_PIPELINE_SINK 'mixout.2.1'
COMPR_PCM_NAME 'Compr HDA Analog'
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The abbreviated name 'Compr' is less clear than 'Compressed'. Consider using 'Compressed HDA Analog' for consistency and clarity.

Suggested change
COMPR_PCM_NAME 'Compr HDA Analog'
COMPR_PCM_NAME 'Compressed HDA Analog'

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@ujfalusi ujfalusi force-pushed the peter/pr/ipc4_compr_topology branch from ee5d196 to 813f209 Compare February 13, 2026 12:27
@ujfalusi
Copy link
Contributor Author

Changes since v1:

  • address comments from copilot (indentation)
  • rename streams from Compr* to Compressed*
  • Add sof-ptl-rt721-compr.tplg
  • minor white space and arrangement changes

ranj063 and others added 5 commits February 13, 2026 16:46
This will be used in the compressed playback pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
This will be used in the compressed capture pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add the basic building blocks for compress playback support following
the way deepbuffer is defined as the compr pipeline will be used in a
similar way in topology files.

We support two COMPRESSED pipeline initially, the second one is used for
SDW Speaker path, but the naming is generic for easier adaptation to
other topologies

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The compr pipeline will connect to `mixout.2.1` if COMPRESSED is set to
true.
Normal PCM, DeepBuffer and Compr can be used concurrently to play audio.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
If COMPRESSED is set to true then a compr pipeline will be attached to the
Jack and Speaker path.

Add example topology under development:
sof-arl-cs42l43-l0-compr.tplg
sof-ptl-rt721-compr.tplg
sof-ptl-rt722-compr.tplg
The patch supports:
- no compressed pipeline - no regression
- When COMPRESSED is set to true then it enables the compr pipeline
  dynamically for Jack and Speaker depending on their availability, in
  other words will work in tish combination: only Jack, only Speaker, both
  Jack and Speaker

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
@ujfalusi ujfalusi force-pushed the peter/pr/ipc4_compr_topology branch from 813f209 to 92a8bf5 Compare February 13, 2026 14:58
@ujfalusi
Copy link
Contributor Author

Changes since v2:

  • Rename the ALSA devices to Compress* (from Compressed*)

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.

2 participants