Skip to content

audio: ecns: add 48 kHz rate support and add to topologies - #11533

Merged
lgirdwood merged 7 commits into
thesofproject:intel/wov-d0i3-002from
singalsu:intel_wov-d0i3-002_add_dmic1648_ecns_capture
Nov 27, 2026
Merged

lgirdwood merged 7 commits into
thesofproject:intel/wov-d0i3-002from
singalsu:intel_wov-d0i3-002_add_dmic1648_ecns_capture

Conversation

@singalsu

@singalsu singalsu commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

The new wov-multi topology adds two new ECNS capture PCMs:

sof-wcl-rt722-4ch-wov-multi
  • wov: add ECNS output capture PCM 13: a module-copier (pipeline 117) between ECNS and KPB feeds the 16 kHz mono ECNS output to the new PCM 13 "DMIC16k ECNS". Its host-copier is in its own pipeline 121.

  • audio: ecns: add 48 kHz rate support: ECNS now runs at 16 or 48 kHz, taking the rate from the pin 0 format. It has 48 kHz high-pass coefficients and fails prepare if the echo reference rate doesn't match.

  • wov: add 48 kHz ECNS capture PCM 15:

    • A second ECNS (pipeline 122) feeds the new PCM 15 "DMIC48k ECNS" (pipeline 123), mono 48 kHz for VoIP.
    • For wov-multi topologies only, the DMIC0 IIR moved to the raw PCM's host pipeline; all other topologies build byte-identical.
    • A module-copier after siggen in pipeline 120 provides the 48 kHz echo reference.

Add a module-copier between the ECNS and the KPB in the DMIC WoV
topologies to make the processed 16 kHz mono microphone available
for capture. The copier output pin 0 feeds the KPB and pin 1 the host
copier of the new PCM 11 "DMIC16k ECNS" (1ch 16 kHz S16_LE).

The copier is in its own pipeline 117, so PCM 11 can be captured
without setting up the KPB, and so that its LL pipeline walk starts
from it.

The host copier is in its own pipeline 121. If it was in pipeline 117,
starting PCM 11 while the WoV PCM 12 runs would not trigger any
pipeline because all of them are already running. The host copier
would then never be started and stopping PCM 11 would fail in firmware
with IPC4_PIPELINE_STATE_NOT_SET, also pausing the pipelines shared
with PCM 12.

The PCM stream name is "ECNS Capture 11". The includers use "Gain
Capture N" names for the DMIC Raw PCM, e.g. "Gain Capture 13" in
cavs-rt5682.conf and "Gain Capture 11" in sof-hda-generic.conf.

The documentation is updated for the new graph.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsu force-pushed the intel_wov-d0i3-002_add_dmic1648_ecns_capture branch 3 times, most recently from 0733075 to cee5e02 Compare November 25, 2026 18:01
Take the sample rate from the input pin 0 format in the IPC4 base config
instead of the fixed 16 kHz. The supported rates are 16 kHz for WoV and
48 kHz for VoIP capture. Other rates are rejected when the module is
created. The output format uses the same rate. The processing does not
convert rates, so an input with a different rate than pin 0 fails the
prepare.

Add the 100 Hz high-pass filter coefficients for 48 kHz with +30 dB and
0 dB gain, converted from highpass_100hz_30db_48khz.conf and
highpass_100hz_0db_48khz.conf, and select the coefficient set by the
rate.

Take the output channel count and channel map, as the bit depth, from
the consumer input format, up to ECNS_OUT_CH_MAX (4) channels. With a
mono output, e.g. to KPB, the processing is unchanged. With two or more
output channels the Average microphone channel setting passes the
microphone channels through and a single channel selection, e.g. Mic1,
is duplicated to all output channels. With AEC the echo reference
average is subtracted from all output channels. The high-pass filter
has a state for each output channel. The filters of channels 1 and up
are cleared when the mic channel control switches from a duplicated
single channel to pass-through, since only the channel 0 filter runs
while duplicating.

Take the format of an input buffer from the producer base config when
the buffer has no format at prepare. ECNS is not a module adapter module
and does not set its input buffer formats at bind. A siggen in
pass-through mode, as used for the jack echo reference, does not set its
output buffer format, so the 2ch s32 reference was processed as mono s16.

The ECNS_RATE definition is replaced with ECNS_RATE_16K and
ECNS_RATE_48K. The Kconfig help and the README are updated.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add a second ECNS instance at 48 kHz for VoIP to the multi-slot WoV
topologies. The ecns.122.1 in a 20 ms DP pipeline 122 takes the DMIC0
microphones from the DAI pipeline module-copier into pin 0 and the 48 kHz
speaker echo reference into pin 1. The s32 output has the DMIC0 DAI channel
count, 2 or 4 by NUM_DMICS, and is captured with PCM 15 "DMIC48k ECNS",
48 kHz S16_LE or S32_LE. The host copier is in its own pipeline 123, as
for PCM 11. The controls are named "DMIC0 ECNS boost", "DMIC0 ECNS AEC
switch", "DMIC0 ECNS NS switch" and "DMIC0 ECNS mic channel".

With INCLUDE_WOV=multi the DMIC0 IIR is moved from the DAI pipeline to
the host pipeline of the raw capture PCM, so that the ECNS gets the
microphones before it. The DAI pipeline uses the
dai-copier-gain-module-copier-capture class instead. The gain stays in
the DAI pipeline, so the volume and mute apply to both captures. The
dai-copier, module-copier, IIR and gain widgets of the DMIC0 DAI pipeline
are moved to include files to use them in both variants. The other
topologies are built byte identical.

The siggen supports only one sink, so a module-copier is added after the
siggen of the echo reference pipeline 120 to provide the 48 kHz echo
reference. The pipeline class is renamed from siggen-src-capture to
siggen-copier-capture, and the SRC to 16 kHz for ecns.115.1 is moved to
its own pipeline 124. The SRC must not stay in pipeline 120, because that
pipeline keeps running for the 48 kHz ECNS when the 16 kHz ECNS is
stopped: the kernel frees the SRC widget, but the firmware deletes a
module only with its pipeline, so the SRC would be left running without
a sink and creating it again would fail.

The PCM stream name is "ECNS Capture 15", for the same reason as for
PCM 11.

The documentation is updated for the new graph.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add a third ECNS instance at 48 kHz for the SoundWire headset microphone
to the multi-slot WoV topologies. The ecns.151.1 in a 20 ms DP pipeline
151 takes the stereo headset microphone from module-copier.11.0 into
pin 0 and the stereo jack echo reference into pin 1. The stereo s32
output is captured with PCM 13 "Jack In ECNS", 2ch 48 kHz S16_LE or
S32_LE, with the host copier in its own pipeline 152. The controls are
named "Jack ECNS boost", "Jack ECNS AEC switch", "Jack ECNS NS switch"
and "Jack ECNS mic channel".

The jack echo reference pipeline 150 has a siggen that takes the jack
playback from module-copier.1.12 and produces silence when the jack
playback is not running. There is only one Loopback_Virtual DAI, so the
same alh-copier.Loopback_Virtual.25 is routed also to the new siggen to
start the setup of the jack echo reference pipeline with the PCM 13
capture.

The new platform/intel/sdw-jack-ecns.conf is included from
dmic-wov-multi.conf with INCLUDE_SDW_JACK_ECNS=true, because it reuses
the pipeline classes and UUIDs defined there. It is enabled in the PTL
rt721 and rt722 2ch and 4ch wov-multi targets, the WCL topologies are
symlinks to them.

The documentation is updated for the new graph.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The typical laptop speaker distorts easily with the basic speaker
playback pipeline without any filtering. Add the
SDW_SPK_BASIC_PLAYBACK_IIR option that adds an IIR equalizer after
gain.21.1 when SDW_SPK_ENHANCED_PLAYBACK is false, without the FIR and
DRC of the enhanced playback.

The coefficients come from EFX_SPK_IIR_PARAMS, by
default the 100 Hz high-pass with 0 dB gain, and the control name is the
same as with the enhanced playback.

The IIR is before module-copier.21.22, so the ECNS echo reference is the
filtered speaker signal. The widget instance is eqiir.21.2 because a
top-level eqiir."1" object, e.g. the DMIC0 host IIR, would be merged
with it.

The option defaults to false, so the other topologies are not changed.
It is enabled in the PTL rt721 and rt722 2ch and 4ch wov-multi targets,
the WCL topologies are symlinks to them.

The documentation is updated.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
With 4ch microphones the pin 0 of ecns.115.1 lists also a 2ch format
for the params of the kernel echo reference walk. It used ECNS_PIN0_IBS,
which is 5120 bytes for 4ch, so the input buffer for the 2ch format was
sized for 40 ms instead of the 20 ms DP period. Add ECNS_PIN0_2CH_IBS
with 20 ms of 16 kHz 2ch s32, 2560 bytes, for it.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Rename the PCM 12 "DMIC Multi-WOV" to "DMIC WOV" and the PCM 14
"Headset Multi-WOV" to "Headset WOV". The multi-slot detection is
an internal detail and not needed in the user visible PCM name.

The run_wov_10x.py capture script detects the device by the PCM
name, so it is updated to match. The topology2, WOV arbiter and
microWakeWord README files are updated for the new names.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsu force-pushed the intel_wov-d0i3-002_add_dmic1648_ecns_capture branch from e9d1635 to cade93a Compare November 26, 2026 12:47
@singalsu

Copy link
Copy Markdown
Collaborator Author

I just updated this with a fix to echo reference format handling. It occurred with headset ECNS where it didn't operate with correct format for audio from siggen module.

@singalsu
singalsu marked this pull request as ready for review November 26, 2026 13:50
@lgirdwood
lgirdwood merged commit 6cd8a89 into thesofproject:intel/wov-d0i3-002 Nov 27, 2026
33 of 39 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.

2 participants