Skip to content

Conversation

@singalsu
Copy link
Collaborator

No description provided.

@singalsu singalsu requested a review from bardliao August 27, 2025 16:04
@singalsu singalsu force-pushed the sdw_2way_speaker branch 4 times, most recently from 8ffea5c to ca0c11c Compare September 1, 2025 10:54
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor questions.

Comment on lines 8 to 12
#
# Object.Pipeline.mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback."N" {
# time_domain "timer"
# }
#
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if AI can help with an ASCII art pipeline diagrams...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The above pipeline name isn't very readable, so ASCII art would not hurt here.

Comment on lines 80 to 82
"default" "include/components/eqiir/passthrough.conf"
"xover_lr4_2000hz_lhlh_48khz" "include/components/eqiir/xover_lr4_2000hz_lhlh_48khz.conf"
"xover_lr4_2000hz_llhh_48khz" "include/components/eqiir/xover_lr4_2000hz_llhh_48khz.conf"
Copy link
Member

Choose a reason for hiding this comment

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

I had to double take here, as it looked like the same file was being used twice, juts the naming is very similar.

Copy link
Collaborator Author

@singalsu singalsu Sep 1, 2025

Choose a reason for hiding this comment

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

Yep, I came with this kind of naming for blobs. I started internally a thread to find out what kind of channels configurations we need for various hardware. And @bardliao is finding out if it can be discovered from SDW configuration data.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a fixed order of the 4 channels? Like LT RT LW RW or it is configurable? And can it change in runtime?

{
in_bit_depth 32
in_valid_bit_depth 32
IncludeByKey.SDW_AMP_NUM_CHANNELS {
Copy link
Member

Choose a reason for hiding this comment

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

Question for @bardliao on how NUM_SDW_AMP_LINKS=3 should be handled

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also question if feedback alh-copiers and pipelines need more channels for xover tplg variant build, or do they already contain all channels from all amplifiers.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Question for @bardliao on how NUM_SDW_AMP_LINKS=3 should be handled

The question is how we should allocate the channels. Assume there are 2 amps per link. Which means there are 6 amps in total and we have LT, LW, RT, RW 4 channels. I think we need more information to allocate the channels to the amps.

Also question if feedback alh-copiers and pipelines need more channels for xover tplg variant build, or do they already contain all channels from all amplifiers.

It may depend on the amps. I would suggest that we leave the feedback channels as it is for now. And submit another PR if we need to change it in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Question for @bardliao on how NUM_SDW_AMP_LINKS=3 should be handled

I think we should do the same for all NUM_SDW_AMP_LINKS values. IOW, we should do the same for NUM_SDW_AMP_LINKS=3.

{
source "gain.21.1"
sink "virtual.sdw-amp"
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure why this is needed. It is just a virtual widget. So, I guess it will work if it always connects to the gain widget.

@singalsu singalsu force-pushed the sdw_2way_speaker branch 2 times, most recently from 6e3b1dc to e98d8a8 Compare September 8, 2025 12:50
This patch adds to script sof_selector_blobs.m export of
stereo stream upmix to duplicated channels. The duplicated
channels are then filtered with desired crossover
characteristics.

The added script for IIR EQ sof_example_lr4.m exports 4th order
Linkwitz-Riley files for crossover low-pass and high-pass.

The added example should be quite typical for laptop PCs. With
larger speakers the frequency could be lower, with smaller higher.

Also the crossover order could be changed to lower and higher.
The 4th order should be quite typical.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The files are in this patch identical and next patches will do
the modifications to add the DSP crossover filter feature.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces the speaker endpoint render pipeline with
a version that adds selector/micsel and EQIIR components to
perform processing for crossover filter.

When the channels count is set to four for stereo woofer and
tweeter the channel map and channel configuration for alh-copier
are set to 4ch (the used define has somewhat confusing name 3.1).

The selector input is two channels and the output four channels.
The EQIIR input and output are four channels. The selector and
IIR blobs are set to perform desired channels duplication and
filtering.

The patch also modifies amplifier feedback stream and host copier
for 4ch. The feedback data can be also used to debug the playback
feature.  The crossover processed playback can be captured if
the kernel and the amplifiers are set to use the feedback.

The PASSTHROUGH define support is removed from this topology
variant to keep it simpler. The normal sdw-amp-generic.conf
should be used for the need.

TODO: Add FIR for delays adjust with fractional delay response.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds blobs for selector and EQIIR for an example
Linkwitz-Riley 4th order crossover with a few channels order
options.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The two pipelines are for SDW_SPK_ENHANCED_PLAYBACK true and false.
They add to the base pipeline classes the selector component
to duplicate channels in a stream and IIR filter to perform the
low-pass and high-pass responses. The FIR filter is added to
optionally delay the woofer channels.

All added processing is pass-through until enabled with
SDW_AMP_XOVER_SELECTOR_PARAMS, SDW_AMP_XOVER_EQIIR_PARAMS,
and SDW_AMP_XOVER_EQFIR_PARAMS.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch modifies cavs-sdw.conf to use sdw-amp-xover.conf
when crossover feature is enabled with SDW_AMP_XOVER set
to true.

The built SDCA function topologies are
sof-sdca-2amp-id2-xover.tplg and
sof-sdca-2amp-feedback-id3-xover.tplg.

The currently built topology duplicates a stereo L,R stream
into L,R,L,R stream and applies 4th order Linkwitz-Riley
low-pass for the first pair and high-pass for the second pair.

The crossover frequency is set to 2 kHz as example. The
crossover parameters should be changed to match the acoustical
design of speaker acoustics of the device. Also there could be
different channels mappings and high/low-pass apply need.

Other variants can be created with the Octave scripts in the
next patch.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

LGTM

@singalsu singalsu marked this pull request as ready for review September 9, 2025 08:13
Copilot AI review requested due to automatic review settings September 9, 2025 08:13
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 2-way speaker crossover topology with speaker configuration using a 4-channel output stream. The crossover filter splits stereo input into low and high frequency components distributed across four channels (L-low, R-low, L-high, R-high).

  • Adds new topology targets for 2-way crossover with specific channel mapping configurations
  • Introduces specialized pipeline configurations supporting crossover filtering chains
  • Creates coefficient configuration blobs for channel routing and crossover filters

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/topology/topology2/production/tplg-targets-sdca-generic.cmake Adds two new topology targets with crossover configuration parameters
tools/topology/topology2/platform/intel/sdw-amp-xover.conf New comprehensive platform configuration for crossover-enabled amplifier topologies
tools/topology/topology2/include/pipelines/cavs/mixout-gain-micsel-eqiir-eqfir-alh-dai-copier-playback.conf Pipeline configuration extending base pipeline with crossover processing chain
tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-micsel-eqiir-eqfir-alh-dai-copier-playback.conf Enhanced pipeline configuration with DRC and crossover processing
tools/topology/topology2/include/components/micsel/*.conf Channel selector coefficient blobs for crossover routing patterns
tools/topology/topology2/include/components/eqiir/xover_lr4_*.conf LR4 crossover filter coefficient blobs for different channel arrangements
tools/topology/topology2/cavs-sdw.conf Main configuration updated to conditionally include crossover support
src/audio/selector/tune/sof_selector_blobs.m MATLAB script for generating crossover channel selector coefficients
src/audio/eq_iir/tune/sof_example_lr4.m MATLAB script for generating Linkwitz-Riley 4th order crossover filter coefficients

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kv2019i
Copy link
Collaborator

kv2019i commented Sep 11, 2025

Any blockers to merging @singalsu @bardliao ?

@bardliao
Copy link
Collaborator

Any blockers to merging @singalsu @bardliao ?

The topology looks good to me, but we need thesofproject/linux#5527 to make it work.

@lgirdwood lgirdwood merged commit 7540307 into thesofproject:main Oct 22, 2025
37 of 45 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.

4 participants