diff --git a/doc/developer_guides/wov_ecns_integration_guide.md b/doc/developer_guides/wov_ecns_integration_guide.md
index 91cfe8e7aced..a36360df43f7 100644
--- a/doc/developer_guides/wov_ecns_integration_guide.md
+++ b/doc/developer_guides/wov_ecns_integration_guide.md
@@ -22,7 +22,7 @@ The reference topology establishes a unified 4-channel native 16 kHz architectur
## 1. System Architecture Overview
The pipeline separates real-time audio ingest into two primary scheduling domains:
-- **Low-Latency (LL) Domain (1 ms period)**: Ingests 2/4-channel 16 kHz and 48 kHz microphone data from the DMIC DAIs and the speaker echo reference (48 kHz, converted to 16 kHz stereo by `src.120.1`) without frame jitter.
+- **Low-Latency (LL) Domain (1 ms period)**: Ingests 2/4-channel 16 kHz and 48 kHz microphone data from the DMIC DAIs and the speaker echo reference (48 kHz, converted to 16 kHz stereo by `src.124.1`) without frame jitter.
- **Data Processing (DP) Domain (20 ms period)**: Runs block-based processing for acoustic echo cancellation, noise suppression, circular buffering, feature extraction, and neural network keyword classification.
```mermaid
@@ -55,9 +55,11 @@ flowchart TD
SPK["Speaker playback
(module-copier + loopback DAI,
per platform)"]
subgraph P120 ["Pipeline 120: Speaker Echo Reference (Core 0, LL 1ms)"]
SIGGEN["siggen.120.1
(48 kHz · 2ch · passthrough,
silence when speaker is idle)"]
- SRC_120["src.120.1
(48 kHz → 16 kHz · 2ch · S32_LE)"]
- SIGGEN --> SRC_120
end
+ subgraph P124 ["Pipeline 124: 16 kHz Echo Reference SRC (Core 0, LL 1ms)"]
+ SRC_120["src.124.1
(48 kHz → 16 kHz · 2ch · S32_LE)"]
+ end
+ SIGGEN --> SRC_120
SPK --> SIGGEN
%% Pipeline 115: ECNS DP Pipeline
@@ -128,7 +130,7 @@ flowchart TD
## 2. Developing a Custom ECNS Module
-An ECNS component acts as a two-source Data Processing (DP) block. It consumes the interleaved multi-channel microphone stream and the speaker echo reference on two input pins and emits cleaned mono audio on a single output pin. The reference implementation `src/audio/ecns/ecns.c` averages the microphone channels to mono (or takes the single channel selected with the `mic channel` enum), applies a 100 Hz high-pass IIR (`boost` switch selects +30 dB or 0 dB), and when the `AEC switch` is on subtracts the `(L+R)/2` average of the echo reference after the IIR. The `NS switch` has no function yet. The echo reference is always consumed, also when the AEC switch is off.
+An ECNS component acts as a two-source Data Processing (DP) block. It consumes the interleaved multi-channel microphone stream and the speaker echo reference on two input pins and emits cleaned mono audio on a single output pin. The reference implementation `src/audio/ecns/ecns.c` averages the microphone channels to mono (or takes the single channel selected with the `mic channel` enum), applies a 100 Hz high-pass IIR (`boost` switch selects +30 dB or 0 dB), and when the `AEC switch` is on subtracts the `(L+R)/2` average of the echo reference after the IIR. The `NS switch` has no function yet. The echo reference is always consumed, also when the AEC switch is off. The output channel count follows the consumer input format: the KPB path is mono, while a multichannel host capture (e.g. the 48 kHz `DMIC0 ECNS` PCM) gets the microphone channels passed through with `Average`, or the selected `MicN` duplicated to all channels, with the reference average subtracted from each channel.
### Audio Data Interface Contract
- **Input Pin 0 (Source 0 — Microphones)**:
@@ -137,7 +139,7 @@ An ECNS component acts as a two-source Data Processing (DP) block. It consumes t
- Sample Format: `S32_LE` in the topology (the firmware also accepts `S16_LE`).
- Frame Period: 20 ms (`ibs` 2,560 bytes).
- **Input Pin 1 (Source 1 — Speaker Echo Reference)**:
- - Channels: 2 (far-end playback, from `src.120.1`).
+ - Channels: 2 (far-end playback, from `src.124.1`).
- Rate: 16,000 Hz.
- Sample Format: `S32_LE`.
- Frame Period: 20 ms (320 frames = 2,560 bytes).
@@ -484,7 +486,7 @@ Class.Control.enum."score_enum" {
> provide. They are kept as an illustration of the pipeline structure. The
> current ECNS in `platform/intel/dmic-wov-multi.conf` (`ecns.115.1`) has two
> input pins (16 kHz microphones from `dmic16k` and the 16 kHz stereo speaker
-> echo reference from `src.120.1`) and a single 16 kHz mono output pin to
+> echo reference from `src.124.1`) and a single 16 kHz mono output pin to
> `kpb.116.1`, without mixin/mixout widgets.
#### 1. ECNS Pipeline (Pipeline 105)
@@ -611,8 +613,11 @@ Follow this step-by-step checklist to integrate your own algorithms:
`cavs-sdw` `*-wov-multi` targets in `production/tplg-targets-ace3.cmake`.
Wildcat Lake topologies are symlinks to the Panther Lake ones.
4. Route the speaker echo reference into `siggen.120.1` of the echo reference
- pipeline 120 (`siggen-src-capture`), which feeds ECNS input pin 1 through
- `src.120.1`. This is enabled with `SDW_SPK_ECHO_REF_ECNS=true` (SoundWire,
+ pipeline 120 (`siggen-copier-capture`), which feeds ECNS input pin 1 through
+ `src.124.1` in pipeline 124. Keep a widget that only some of the PCMs use,
+ such as this SRC, out of a pipeline that other PCMs keep running: the
+ kernel frees the widget when its last PCM stops, but the firmware deletes
+ the module only with its pipeline. This is enabled with `SDW_SPK_ECHO_REF_ECNS=true` (SoundWire,
together with `SDW_SPK_ECHO_REF=true` and `SDW_ECHO_REF_DAI=true`),
`SPEAKER_ECHO_REF_ECNS=true` (ADL rt5682 SSP, needs `INCLUDE_ECHO_REF=true`)
or `HDA_SPEAKER_ECHO_REF_ECNS=true` (HDA generic). A dai_out widget upstream
diff --git a/src/audio/Kconfig b/src/audio/Kconfig
index 145662429f5a..22ad83cf4eb4 100644
--- a/src/audio/Kconfig
+++ b/src/audio/Kconfig
@@ -122,10 +122,11 @@ config COMP_ECNS
help
Select to build the ECNS (Echo Cancellation and Noise Suppression)
Data Processing (DP) component. Operates with a 20ms period. Input
- pin 0 takes the 16 kHz microphone stream and input pin 1 the 16 kHz
- echo reference. The single output pin provides 16 kHz mono, e.g.
- to KPB. The microphone channel enum control selects the average
- of all channels or a single channel. The AEC switch control
+ pin 0 takes the microphone stream and input pin 1 the echo
+ reference, both at 16 kHz or 48 kHz. The single output pin provides
+ mono at the same rate, e.g. 16 kHz to KPB for WoV or 48 kHz to a
+ host PCM for VoIP. The microphone channel enum control selects the
+ average of all channels or a single channel. The AEC switch control
subtracts the echo reference from the output. The NS switch
control has no function yet.
diff --git a/src/audio/ecns/README.md b/src/audio/ecns/README.md
index d2e3a74c36e7..0511441ac25a 100644
--- a/src/audio/ecns/README.md
+++ b/src/audio/ecns/README.md
@@ -3,7 +3,12 @@
## Overview
The `ecns` component is an IPC4 module in a 20 ms pipeline of the multi-slot
-Wake-on-Voice (WoV) topology. It has two input pins and one output pin:
+Wake-on-Voice (WoV) topology. It runs at 16 kHz or 48 kHz, the rate is taken
+from the input pin 0 format in the IPC4 base config. Both inputs and the
+output must have the same rate, the module does not convert rates. Other
+rates are rejected when the module is created, and an echo reference with a
+different rate when it is prepared. It has two input pins and one output pin,
+described here for the 16 kHz WoV use:
- **Input Pin 0**: 16 kHz microphone stream from the `dmic16k` DMIC DAI copier,
2 or 4 channels, 16 or 32 bit.
@@ -11,18 +16,36 @@ Wake-on-Voice (WoV) topology. It has two input pins and one output pin:
topology provides it from the speaker playback via a siggen and a 48 kHz to
16 kHz SRC.
- **Output Pin 0**: 16 kHz mono to the Key Phrase Buffer (`kpb.116.1`), 16 or
- 32 bit. The firmware follows the bit depth of the KPB input format defined in
- topology.
+ 32 bit. The firmware follows the channel count, channel map and bit depth of
+ the consumer input format defined in topology. Up to `ECNS_OUT_CH_MAX` (4)
+ output channels are supported, e.g. for a 48 kHz host capture.
+
+ECNS is not a module adapter module, so it does not set the format of its
+input buffers at bind as IPC4 consumer modules do. The copier and SRC set
+the format of their output buffers, but e.g. a siggen in pass-through mode
+does not. When prepared, ECNS takes the format of an input buffer without
+one from the base config of the producer.
The processing for each frame is:
-1. Average the microphone channels into mono, or take a single channel. The
- selection is done with the microphone channel enum control.
+1. Take the microphone signal. The microphone channel enum control selects
+ between the average and a single channel:
+ - Mono output: average the microphone channels into mono, or take the
+ selected channel.
+ - Two or more output channels: with `Average` pass microphone channel *c*
+ to output channel *c*. If the output has more channels than the
+ microphone input, the input channels repeat. With a single channel
+ selection, e.g. `Mic1`, duplicate that channel to all output channels.
2. Filter with the built-in 100 Hz second-order high-pass IIR
- (`CONFIG_ECNS_KPB_HPF`, default `y`).
+ (`CONFIG_ECNS_KPB_HPF`, default `y`). There are coefficients for 16 kHz
+ and 48 kHz, the set is selected by the rate. Each output channel has its
+ own filter state; a duplicated channel is filtered once. The filters of
+ channels 1 and up are cleared when the mic channel control switches from
+ a single channel to pass-through.
3. When the AEC switch is on, subtract the average of the echo reference
- channels, (L+R)/2 for stereo, from the filtered signal with saturation.
-4. Write the mono sample as s16 or s32.
+ channels, (L+R)/2 for stereo, from each filtered output channel with
+ saturation.
+4. Write the samples as s16 or s32.
The echo reference is always consumed, also when the AEC switch is off. If
the reference has fewer frames available than the microphone, the missing
@@ -47,10 +70,10 @@ added in the widget instance with
| Value | Topology name (DMIC WoV) | Function | Default |
|---|---|---|---|
-| 0 | `DMIC ECNS mic channel` `Average` | Average of all microphone channels | yes |
-| 1..2 or 1..4 | `Mic1`, `Mic2`, (`Mic3`, `Mic4` with 4ch) | Single microphone channel | |
+| 0 | `DMIC ECNS mic channel` `Average` | Average of all microphone channels, or pass-through with a multichannel output | yes |
+| 1..2 or 1..4 | `Mic1`, `Mic2`, (`Mic3`, `Mic4` with 4ch) | Single microphone channel, duplicated to all output channels | |
-A channel beyond the input channel count falls back to the average.
+A channel beyond the input channel count falls back to `Average`.
The firmware keeps duplicate coefficient sets for the boost and only moves the
IIR coefficient pointers, so the filter state is kept. The firmware starts
@@ -64,32 +87,51 @@ flowchart TD
SPK["speaker playback module-copier
(e.g. module-copier.21.22)"]
LOOP["echo reference start DAI
(e.g. alh-copier.Loopback_Virtual.25)"]
SIGGEN["siggen.120.1
48 kHz stereo, silence without speaker"]
- SRC["src.120.1
48 kHz → 16 kHz stereo s32"]
+ MC120["module-copier.120.2
48 kHz stereo, also to the 48 kHz ECNS"]
+ SRC["src.124.1, own pipeline 124
48 kHz → 16 kHz stereo s32"]
ECNS["ecns.115.1
mic average or channel → 100 Hz HPF → − (L+R)/2 ref"]
KPB["kpb.116.1
16 kHz mono"]
DMIC16K -->|"Pin 0"| ECNS
SPK --> SIGGEN
LOOP --> SIGGEN
- SIGGEN --> SRC
+ SIGGEN --> MC120
+ MC120 --> SRC
SRC -->|"Pin 1"| ECNS
ECNS -->|"Out Pin 0"| KPB
```
-The 48 kHz DMIC stream is not processed by ECNS. It is captured with the
-regular DMIC0 pipelines of
+The 48 kHz DMIC stream is captured with the regular DMIC0 pipelines of
`tools/topology/topology2/platform/intel/dmic-generic.conf`, without the
-TDFB and DRC enhancements.
+TDFB and DRC enhancements, to the raw PCM. A second ECNS instance,
+`ecns.122.1` in `tools/topology/topology2/platform/intel/dmic-wov-multi.conf`,
+runs at 48 kHz for VoIP. It takes the microphones from the DMIC0 DAI pipeline
+module-copier, before the raw PCM IIR, and the 48 kHz echo reference from
+`module-copier.120.2` between the siggen and the SRC. Its controls are named
+`DMIC0 ECNS boost`, `DMIC0 ECNS AEC switch`, `DMIC0 ECNS NS switch` and
+`DMIC0 ECNS mic channel`. Its output and PCM 15 have the DMIC0 DAI channel
+count, 2 or 4, so the multichannel output processing described above is
+used.
+
+A third instance, `ecns.151.1` in
+`tools/topology/topology2/platform/intel/sdw-jack-ecns.conf`
+(`INCLUDE_SDW_JACK_ECNS=true`), runs at 48 kHz for the SoundWire headset
+microphone. It takes the stereo microphone from `module-copier.11.0` and the
+stereo jack echo reference from `module-copier.1.12` via `siggen.150.1`. The
+stereo output is captured with PCM 13 `Jack In ECNS`. Its controls are named
+`Jack ECNS boost`, `Jack ECNS AEC switch`, `Jack ECNS NS switch` and
+`Jack ECNS mic channel`.
## Specifications
| Parameter | Specification |
|---|---|
| Module UUID | `6c:8a:4f:21:3a:49:1e:4b:8b:1e:0d:3b:6f:8a:2c:15` |
-| Execution Period | 20 ms (320 frames at 16 kHz) |
-| Input Pin 0 | 16 kHz · 2 or 4 channels · s16/s32 |
-| Input Pin 1 | 16 kHz · 2 channels · s16/s32 |
-| Output Pin 0 | 16 kHz · 1 channel · s16/s32 |
+| Sample Rate | 16 kHz or 48 kHz, the same for all pins |
+| Execution Period | 20 ms (320 frames at 16 kHz, 960 frames at 48 kHz) |
+| Input Pin 0 | 2 or 4 channels · s16/s32 |
+| Input Pin 1 | 2 channels · s16/s32 |
+| Output Pin 0 | 1 to 4 channels · s16/s32, follows the consumer input format |
| Dynamic Pipeline | Compatible (`dynamic_pipeline 1`) |
| Power States | S0 active streaming and D0i3 low-power listening supported |
diff --git a/src/audio/ecns/ecns.c b/src/audio/ecns/ecns.c
index c2fd2250a61f..e048608aa937 100644
--- a/src/audio/ecns/ecns.c
+++ b/src/audio/ecns/ecns.c
@@ -7,13 +7,21 @@
* \file
* \brief ECNS (Echo Cancellation & Noise Suppression) DP component
*
- * Input pin 0 receives the 16 kHz microphone stream and input pin 1 the
- * 16 kHz echo reference. The microphone channels are averaged to mono, or a
- * single channel is selected with the microphone channel enum control, and
- * high-pass filtered. When the AEC switch is enabled the average of the echo
- * reference channels is subtracted from the filtered microphone signal. The
- * result is written as 16 kHz mono s16 or s32 to the single output pin. The
- * echo reference is always consumed, also when the AEC switch is disabled.
+ * Input pin 0 receives the microphone stream and input pin 1 the echo
+ * reference, both at the same 16 kHz or 48 kHz rate. The rate is taken from
+ * the pin 0 format in the IPC4 base config. The output channel count and bit
+ * depth follow the consumer input format, e.g. mono for KPB or 2 or 4
+ * channels for a host capture.
+ *
+ * With a mono output the microphone channels are averaged, or a single
+ * channel is selected with the microphone channel enum control. With two or
+ * more output channels the average setting passes the microphone channels
+ * through and a single channel selection is duplicated to all output
+ * channels. Each output channel is high-pass filtered. When the AEC switch is
+ * enabled the average of the echo reference channels is subtracted from all
+ * filtered output channels. The result is written as s16 or s32 at the input
+ * rate to the single output pin. The echo reference is always consumed, also
+ * when the AEC switch is disabled.
*/
#include
@@ -44,11 +52,13 @@ SOF_DEFINE_REG_UUID(ecns);
DECLARE_TR_CTX(ecns_tr, SOF_UUID(ecns_uuid), LOG_LEVEL_INFO);
/**
- * \brief Get the microphone channels used for the mono output.
+ * \brief Get the microphone channels used for the output.
*
* The selection comes from the microphone channel enum control. Value 0
* averages all channels, values 1..N select a single channel. A channel
* beyond the input channel count falls back to the average of all channels.
+ * With a multichannel output a window of more than one channel means that
+ * the microphone channels are passed through instead of averaged.
*
* \param[in] mic_sel Microphone channel enum control value
* \param[in] ch Number of microphone input channels
@@ -96,6 +106,38 @@ static inline int32_t ecns_frame_avg(const void *frame, bool s32, uint32_t start
return (int32_t)(acc / (int32_t)cnt);
}
+/**
+ * \brief Get one channel of an interleaved frame as a Q1.31 sample.
+ *
+ * \param[in] frame Pointer to the first sample of the frame
+ * \param[in] s32 True for 32-bit samples, false for 16-bit samples
+ * \param[in] c Channel index
+ * \return The sample as Q1.31
+ */
+static inline int32_t ecns_frame_sample(const void *frame, bool s32, uint32_t c)
+{
+ if (s32)
+ return ((const int32_t *)frame)[c];
+
+ return (int32_t)((const int16_t *)frame)[c] << 16;
+}
+
+/**
+ * \brief Write one channel of an interleaved output frame.
+ *
+ * \param[out] frame Pointer to the first sample of the frame
+ * \param[in] s32 True for 32-bit samples, false for 16-bit samples
+ * \param[in] c Channel index
+ * \param[in] y Sample as Q1.31
+ */
+static inline void ecns_frame_write(void *frame, bool s32, uint32_t c, int32_t y)
+{
+ if (s32)
+ ((int32_t *)frame)[c] = y;
+ else
+ ((int16_t *)frame)[c] = sat_int16(Q_SHIFT_RND(y, 31, 15));
+}
+
#if CONFIG_ECNS_KPB_HPF
/**
* \brief 100 Hz second-order high-pass filter with +30 dB gain at 16 kHz.
@@ -120,6 +162,24 @@ static const uint32_t hp_100hz_0db_16k[13] = {
0x1f32926e, 0xc19adb24, 0x1f32926e, 0x00000000,
0x00007fb4
};
+
+/**
+ * \brief As hp_100hz_30db_16k for 48 kHz, from highpass_100hz_30db_48khz.conf.
+ */
+static const uint32_t hp_100hz_30db_48k[13] = {
+ 0x00000001, 0x00000001, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0xc12c82bd, 0x7ed0b52e,
+ 0x1fc7cc0c, 0xc07067e9, 0x1fc7cc0c, 0xfffffffb,
+ 0x00007e33
+};
+
+/** \brief As hp_100hz_0db_16k for 48 kHz, from highpass_100hz_0db_48khz.conf. */
+static const uint32_t hp_100hz_0db_48k[13] = {
+ 0x00000001, 0x00000001, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0xc12c82bd, 0x7ed0b52e,
+ 0x1fc7cc0c, 0xc07067e9, 0x1fc7cc0c, 0x00000000,
+ 0x00007fb4
+};
#endif
/** \brief Switch control indexes, mixer."1" to mixer."3" in ecns.conf */
@@ -133,28 +193,52 @@ static const uint32_t hp_100hz_0db_16k[13] = {
/** \brief ECNS component private data */
struct ecns_comp_data {
struct ipc4_base_module_cfg base_cfg; /**< IPC4 base config, pin 0 input format */
+ uint32_t rate; /**< Sample rate of all pins, 16 or 48 kHz */
bool capture_boost; /**< Boosted high-pass filter response in use */
bool capture_boost_req; /**< Boost requested by the control */
bool aec_enable; /**< AEC switch, subtract the echo reference */
bool ns_enable; /**< NS switch, no function yet */
uint32_t mic_sel; /**< Microphone channel, 0 average, 1..N single channel */
- struct iir_state_df1 hp_iir; /**< Output high-pass filter state */
- int32_t *hp_delay; /**< Output high-pass filter delay line */
+ struct iir_state_df1 hp_iir[ECNS_OUT_CH_MAX]; /**< Output high-pass filter states */
+ int32_t *hp_delay; /**< Delay lines of all output high-pass filters */
+ size_t hp_delay_size; /**< Size in bytes of all delay lines */
+ bool hp_dup; /**< Last processing used only the channel 0 filter */
};
#if CONFIG_ECNS_KPB_HPF
+/**
+ * \brief Get the high-pass filter coefficients for the rate and boost.
+ *
+ * \param[in] cd ECNS component data
+ * \return IIR coefficient header followed by the biquad
+ */
static struct sof_eq_iir_header *ecns_iir_coef(struct ecns_comp_data *cd)
{
+ if (cd->rate == ECNS_RATE_48K)
+ return (struct sof_eq_iir_header *)
+ (cd->capture_boost ? hp_100hz_30db_48k : hp_100hz_0db_48k);
+
return (struct sof_eq_iir_header *)
(cd->capture_boost ? hp_100hz_30db_16k : hp_100hz_0db_16k);
}
#endif
-/* Only the coefficient pointers move, the filter delay line is kept. */
+/**
+ * \brief Update the high-pass filter coefficients of all output channels.
+ *
+ * Selects the coefficients for the rate and the capture boost. Only the
+ * coefficient pointers move, the filter delay lines are kept.
+ *
+ * \param[in,out] cd ECNS component data
+ */
static void ecns_update_iir_coef(struct ecns_comp_data *cd)
{
#if CONFIG_ECNS_KPB_HPF
- iir_init_coef_df1(&cd->hp_iir, ecns_iir_coef(cd));
+ struct sof_eq_iir_header *hdr = ecns_iir_coef(cd);
+ int c;
+
+ for (c = 0; c < ECNS_OUT_CH_MAX; c++)
+ iir_init_coef_df1(&cd->hp_iir[c], hdr);
#endif
}
@@ -173,6 +257,13 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv,
return NULL;
}
+ if (base_cfg->audio_fmt.sampling_frequency != ECNS_RATE_16K &&
+ base_cfg->audio_fmt.sampling_frequency != ECNS_RATE_48K) {
+ comp_cl_err(drv, "ecns_new: unsupported rate %u",
+ base_cfg->audio_fmt.sampling_frequency);
+ return NULL;
+ }
+
dev = comp_alloc(drv, sizeof(*dev));
if (!dev)
return NULL;
@@ -186,6 +277,7 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv,
}
memcpy_s(&cd->base_cfg, sizeof(cd->base_cfg), base_cfg, sizeof(*base_cfg));
+ cd->rate = base_cfg->audio_fmt.sampling_frequency;
comp_set_drvdata(dev, cd);
dev->direction = SOF_IPC_STREAM_CAPTURE;
@@ -200,6 +292,7 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv,
struct sof_eq_iir_header *hp_hdr = ecns_iir_coef(cd);
int hp_size = iir_delay_size_df1(hp_hdr);
int32_t *delay;
+ int c;
if (hp_size < 0) {
rfree(cd);
@@ -207,16 +300,23 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv,
return NULL;
}
- cd->hp_delay = rzalloc(SOF_MEM_FLAG_USER, hp_size);
+ /* One delay line per output channel, the output channel count is
+ * known only when the module is prepared.
+ */
+ cd->hp_delay_size = (size_t)hp_size * ECNS_OUT_CH_MAX;
+ cd->hp_delay = rzalloc(SOF_MEM_FLAG_USER, cd->hp_delay_size);
if (!cd->hp_delay) {
rfree(cd);
comp_free_device(dev);
return NULL;
}
+ /* iir_init_delay_df1() advances the pointer past each delay line */
delay = cd->hp_delay;
- iir_init_coef_df1(&cd->hp_iir, hp_hdr);
- iir_init_delay_df1(&cd->hp_iir, &delay);
+ for (c = 0; c < ECNS_OUT_CH_MAX; c++) {
+ iir_init_coef_df1(&cd->hp_iir[c], hp_hdr);
+ iir_init_delay_df1(&cd->hp_iir[c], &delay);
+ }
#endif
comp_info(dev, "ecns_new: rate=%u in_ch=%u valid_bits=%u",
@@ -250,54 +350,131 @@ static int ecns_params(struct comp_dev *dev, struct sof_ipc_stream_params *param
}
/**
- * \brief Get the output sample container depth.
+ * \brief Get the output format.
*
* The output format is defined in topology, but the IPC4 base config of ECNS
* only describes the input pin 0 format. The topology output format matches
- * the consumer input format, so the depth is taken from the consumer base
- * config.
+ * the consumer input format, so the channel count, channel map and depth are
+ * taken from the consumer base config. Without a consumer base config the
+ * output is mono s32.
*
- * \param[in] dev ECNS component device
- * \param[in] sink Output buffer
- * \return 16 or 32
+ * \param[in] dev ECNS component device
+ * \param[in] sink Output buffer
+ * \param[out] fmt Output format
+ * \return 0 on success, -EINVAL for an unsupported channel count
*/
-static uint32_t ecns_out_depth(struct comp_dev *dev, struct comp_buffer *sink)
+static int ecns_out_format(struct comp_dev *dev, struct comp_buffer *sink,
+ struct ipc4_audio_format *fmt)
{
+ struct ecns_comp_data *cd = comp_get_drvdata(dev);
struct comp_dev *consumer = comp_buffer_get_sink_component(sink);
struct ipc4_base_module_cfg cfg;
+ uint32_t depth = 32;
+ uint32_t ch = 1;
+
+ fmt->ch_map = ECNS_CH_MAP_MONO;
+ fmt->ch_cfg = IPC4_CHANNEL_CONFIG_MONO;
+
+ if (consumer && !comp_get_attribute(consumer, COMP_ATTR_BASE_CONFIG, &cfg)) {
+ if (cfg.audio_fmt.depth == 16)
+ depth = 16;
+
+ if (cfg.audio_fmt.channels_count > 1) {
+ ch = cfg.audio_fmt.channels_count;
+ fmt->ch_map = cfg.audio_fmt.ch_map;
+ fmt->ch_cfg = cfg.audio_fmt.ch_cfg;
+ }
+ }
- if (consumer && !comp_get_attribute(consumer, COMP_ATTR_BASE_CONFIG, &cfg) &&
- cfg.audio_fmt.depth == 16)
- return 16;
+ if (ch > ECNS_OUT_CH_MAX) {
+ comp_err(dev, "ecns_out_format: %u output channels, max %u",
+ ch, ECNS_OUT_CH_MAX);
+ return -EINVAL;
+ }
- return 32;
+ fmt->sampling_frequency = cd->rate;
+ fmt->channels_count = ch;
+ fmt->depth = depth;
+ fmt->valid_bit_depth = depth;
+ fmt->s_type = depth == 16 ? IPC4_TYPE_SIGNED_INTEGER : IPC4_TYPE_MSB_INTEGER;
+ fmt->interleaving_style = IPC4_CHANNELS_INTERLEAVED;
+ return 0;
+}
+
+/**
+ * \brief Set the format of an input buffer if the producer did not set it.
+ *
+ * In IPC4 the consumer module sets the format of its input buffers at bind.
+ * ECNS is not a module adapter module and does not do it, so an input buffer
+ * has a format only if the producer sets the format of its output buffer, as
+ * the copier and SRC do. E.g. a siggen in pass-through mode for the echo
+ * reference does not, and the buffer would be processed as mono s16. The
+ * format of such a buffer is taken from the producer base config, the
+ * producer output format equals its input format.
+ *
+ * \param[in] dev ECNS component device
+ * \param[in,out] source Input buffer
+ * \return 0 on success, -EINVAL if the format can't be determined
+ */
+static int ecns_in_format(struct comp_dev *dev, struct comp_buffer *source)
+{
+ struct comp_dev *producer;
+ struct ipc4_base_module_cfg cfg;
+
+ if (audio_stream_get_channels(&source->stream) && audio_stream_get_rate(&source->stream))
+ return 0;
+
+ producer = comp_buffer_get_source_component(source);
+ if (!producer || comp_get_attribute(producer, COMP_ATTR_BASE_CONFIG, &cfg)) {
+ comp_err(dev, "ecns_in_format: input pin %u has no format",
+ IPC4_SINK_QUEUE_ID(buf_get_id(source)));
+ return -EINVAL;
+ }
+
+ ipc4_update_buffer_format(source, &cfg.audio_fmt);
+ comp_info(dev, "ecns_in_format: input pin %u format from producer, %uch s%u",
+ IPC4_SINK_QUEUE_ID(buf_get_id(source)), cfg.audio_fmt.channels_count,
+ cfg.audio_fmt.depth);
+ return 0;
}
static int ecns_prepare(struct comp_dev *dev)
{
struct ecns_comp_data *cd = comp_get_drvdata(dev);
+ struct comp_buffer *source;
struct comp_buffer *sink;
+ uint32_t rate;
+ int ret;
comp_info(dev, "ecns_prepare");
+ comp_dev_for_each_producer(dev, source) {
+ ret = ecns_in_format(dev, source);
+ if (ret)
+ return ret;
+
+ /* The processing does not convert rates, all inputs must match pin 0 */
+ rate = audio_stream_get_rate(&source->stream);
+ if (rate && rate != cd->rate) {
+ comp_err(dev, "ecns_prepare: input pin %u rate %u, expected %u",
+ IPC4_SINK_QUEUE_ID(buf_get_id(source)), rate, cd->rate);
+ return -EINVAL;
+ }
+ }
+
comp_dev_for_each_consumer(dev, sink) {
if (IPC4_SRC_QUEUE_ID(buf_get_id(sink)) != ECNS_PIN_OUT)
continue;
- uint32_t depth = ecns_out_depth(dev, sink);
- struct ipc4_audio_format fmt = {
- .sampling_frequency = ECNS_RATE,
- .channels_count = 1,
- .depth = depth,
- .valid_bit_depth = depth,
- .s_type = depth == 16 ? IPC4_TYPE_SIGNED_INTEGER : IPC4_TYPE_MSB_INTEGER,
- .interleaving_style = IPC4_CHANNELS_INTERLEAVED,
- .ch_map = ECNS_CH_MAP_MONO,
- .ch_cfg = IPC4_CHANNEL_CONFIG_MONO,
- };
+ struct ipc4_audio_format fmt;
+
+ ret = ecns_out_format(dev, sink, &fmt);
+ if (ret)
+ return ret;
ipc4_update_buffer_format(sink, &fmt);
- comp_info(dev, "ecns_prepare: output s%u", depth);
+ comp_info(dev, "ecns_prepare: output %uch s%u",
+ fmt.channels_count, fmt.depth);
}
cd->capture_boost = cd->capture_boost_req;
@@ -306,19 +483,33 @@ static int ecns_prepare(struct comp_dev *dev)
return comp_set_state(dev, COMP_TRIGGER_PREPARE);
}
+/**
+ * \brief Clear the high-pass filter delay lines from a channel onwards.
+ *
+ * The delay lines of the output channels follow each other in hp_delay, as
+ * set up with iir_init_delay_df1() in ecns_new().
+ *
+ * \param[in,out] cd ECNS component data
+ * \param[in] first_ch First output channel to clear
+ */
+static void ecns_clear_hp_delay(struct ecns_comp_data *cd, uint32_t first_ch)
+{
+ size_t ch_size = cd->hp_delay_size / ECNS_OUT_CH_MAX;
+ size_t offset = first_ch * ch_size;
+
+ if (!cd->hp_delay || first_ch >= ECNS_OUT_CH_MAX)
+ return;
+
+ memset_s((uint8_t *)cd->hp_delay + offset, cd->hp_delay_size - offset, 0,
+ cd->hp_delay_size - offset);
+}
+
static int ecns_reset(struct comp_dev *dev)
{
struct ecns_comp_data *cd = comp_get_drvdata(dev);
comp_info(dev, "ecns_reset");
-#if CONFIG_ECNS_KPB_HPF
- if (cd->hp_delay) {
- int hp_size = iir_delay_size_df1(ecns_iir_coef(cd));
-
- if (hp_size > 0)
- memset_s(cd->hp_delay, hp_size, 0, hp_size);
- }
-#endif
+ ecns_clear_hp_delay(cd, 0);
return comp_set_state(dev, COMP_TRIGGER_RESET);
}
@@ -328,10 +519,18 @@ static int ecns_trigger(struct comp_dev *dev, int cmd)
return comp_set_state(dev, cmd);
}
-static inline int32_t ecns_filter(struct ecns_comp_data *cd, int32_t x)
+/**
+ * \brief High-pass filter one sample of an output channel.
+ *
+ * \param[in,out] cd ECNS component data
+ * \param[in] c Output channel index, filter state to use
+ * \param[in] x Input sample as Q1.31
+ * \return Filtered sample as Q1.31, or x without CONFIG_ECNS_KPB_HPF
+ */
+static inline int32_t ecns_filter(struct ecns_comp_data *cd, uint32_t c, int32_t x)
{
#if CONFIG_ECNS_KPB_HPF
- return iir_df1(&cd->hp_iir, x);
+ return iir_df1(&cd->hp_iir[c], x);
#else
return x;
#endif
@@ -370,6 +569,13 @@ static uint32_t ecns_avail_frames(const struct ecns_stream *s)
/**
* \brief Process microphone and echo reference frames to the output.
*
+ * A mono output, or a single microphone channel selection, is filtered once
+ * and written to all output channels. Otherwise output channel c is the
+ * filtered microphone channel c, wrapped if the output has more channels
+ * than the microphone input. The filters of channels 1 and up are cleared
+ * when the processing changes from the first case to the second. The echo reference average is subtracted from
+ * all output channels when AEC is enabled.
+ *
* \param[in,out] cd ECNS component data
* \param[in] mic Microphone input stream
* \param[in] ref Echo reference input stream, buffer may be NULL
@@ -389,10 +595,21 @@ static void ecns_process(struct ecns_comp_data *cd, const struct ecns_stream *mi
uint32_t mic_sample_bytes = mic->s32 ? sizeof(int32_t) : sizeof(int16_t);
uint32_t avg_start, avg_cnt;
uint32_t remaining = frames;
- uint32_t i, n;
+ uint32_t i, n, c;
+ int32_t ref_avg;
int32_t y;
+ bool dup;
ecns_mono_window(cd->mic_sel, mic->ch, &avg_start, &avg_cnt);
+ dup = out->ch == 1 || avg_cnt == 1;
+
+ /* Only the channel 0 filter runs while duplicating, so the other
+ * filters have stale state when the mic channel control switches to
+ * pass-through.
+ */
+ if (cd->hp_dup && !dup)
+ ecns_clear_hp_delay(cd, 1);
+ cd->hp_dup = dup;
while (remaining > 0) {
n = MIN(remaining, audio_stream_frames_without_wrap(&mic->buf->stream, mic_ptr));
@@ -403,29 +620,29 @@ static void ecns_process(struct ecns_comp_data *cd, const struct ecns_stream *mi
}
for (i = 0; i < n; i++) {
- y = ecns_filter(cd, ecns_frame_avg(mic_ptr, mic->s32, avg_start, avg_cnt));
- mic_ptr += mic->ch * mic_sample_bytes;
-
+ ref_avg = 0;
if (ref_frames) {
if (cd->aec_enable)
- y = sat_int32((int64_t)y -
- ecns_frame_avg(ref_ptr, ref->s32, 0, ref->ch));
+ ref_avg = ecns_frame_avg(ref_ptr, ref->s32, 0, ref->ch);
ref_ptr += ref->frame_bytes;
}
- if (out->s32) {
- int32_t *o = (int32_t *)out_ptr;
-
- o[0] = y;
- for (uint32_t c = 1; c < out->ch; c++)
- o[c] = 0;
+ if (dup) {
+ y = ecns_filter(cd, 0, ecns_frame_avg(mic_ptr, mic->s32,
+ avg_start, avg_cnt));
+ y = sat_int32((int64_t)y - ref_avg);
+ for (c = 0; c < out->ch; c++)
+ ecns_frame_write(out_ptr, out->s32, c, y);
} else {
- int16_t *o = (int16_t *)out_ptr;
-
- o[0] = sat_int16(Q_SHIFT_RND(y, 31, 15));
- for (uint32_t c = 1; c < out->ch; c++)
- o[c] = 0;
+ for (c = 0; c < out->ch; c++) {
+ y = ecns_filter(cd, c, ecns_frame_sample(mic_ptr, mic->s32,
+ c % mic->ch));
+ y = sat_int32((int64_t)y - ref_avg);
+ ecns_frame_write(out_ptr, out->s32, c, y);
+ }
}
+
+ mic_ptr += mic->ch * mic_sample_bytes;
out_ptr += out->frame_bytes;
}
@@ -449,12 +666,12 @@ static void ecns_drain(const struct ecns_stream *s)
}
/*
- * Main 20 ms DP processing function:
+ * Main 20 ms DP processing function, all pins at the same 16 or 48 kHz rate:
* Consumes:
- * - Pin 0 in: 16 kHz microphone stream (2 or 4 channels, 16/32-bit)
- * - Pin 1 in: 16 kHz echo reference (stereo, 16/32-bit)
+ * - Pin 0 in: microphone stream (2 or 4 channels, 16/32-bit)
+ * - Pin 1 in: echo reference (stereo, 16/32-bit)
* Produces:
- * - Pin 0 out: 16 kHz mono processed stream (16/32-bit)
+ * - Pin 0 out: processed stream, 1 to ECNS_OUT_CH_MAX channels (16/32-bit)
*/
static int ecns_copy(struct comp_dev *dev)
{
@@ -496,6 +713,13 @@ static int ecns_copy(struct comp_dev *dev)
ecns_stream_init(&ref, src_ref);
ecns_stream_init(&out, snk);
+ /* The filter states are allocated for ECNS_OUT_CH_MAX channels */
+ if (snk && out.ch > ECNS_OUT_CH_MAX) {
+ comp_err(dev, "ecns_copy: %u output channels, max %u",
+ out.ch, ECNS_OUT_CH_MAX);
+ return -EINVAL;
+ }
+
/* Drain all available input bounded by sink space; a one-period cap
* would let the source ring overflow under DMIC vs DSP clock drift.
*/
diff --git a/src/audio/microwakeword/README.md b/src/audio/microwakeword/README.md
index 040a595dac06..e50b4ce9ee72 100644
--- a/src/audio/microwakeword/README.md
+++ b/src/audio/microwakeword/README.md
@@ -28,10 +28,13 @@ graph TD
subgraph P120["Pipeline 120 — Speaker Echo Reference (Core 0, LL 1ms)"]
SIGGEN["siggen.120.1\n(48 kHz stereo speaker playback,\nsilence when speaker is idle)"]
- SRC120["src.120.1\n(48 kHz -> 16 kHz · 2ch · S32_LE)"]
- SIGGEN --> SRC120
end
+ subgraph P124["Pipeline 124 — 16 kHz Echo Reference SRC (Core 0, LL 1ms)"]
+ SRC120["src.124.1\n(48 kHz -> 16 kHz · 2ch · S32_LE)"]
+ end
+ SIGGEN --> SRC120
+
subgraph P115["Pipeline 115 — ECNS DP Processing (Core 0, DP 20ms)"]
ECNS["ecns.115.1\n(ECNS DP Module, 20ms = 320 frames)\nPin 0 In: Mics | Pin 1 In: Echo Ref\nMono, 100 Hz HPF, optional AEC"]
end
@@ -67,7 +70,7 @@ graph TD
subgraph P114["Pipeline 114 — WOV Host PCM Capture (Core 0, LL 1ms)"]
ARB["wov-arbiter.114.1\n(4 input pins, 1 output pin\nPin 0: Audio | Pins 1-3: Features\n1ch mono 16 kHz S16_LE)"]
- HC12["host-copier.12\n(hw:0,12 · PCM 12 'DMIC Multi-WOV')\n1ch · 16 kHz · S16_LE / S32_LE"]
+ HC12["host-copier.12\n(hw:0,12 · PCM 12 'DMIC WOV')\n1ch · 16 kHz · S16_LE / S32_LE"]
ARB --> HC12
end
@@ -128,7 +131,7 @@ The SoundWire headset WoV (`sdw-jack-wov-multi.conf`, `INCLUDE_SDW_JACK_WOV=true
has no ECNS: `module-copier.11.0` (Jack In, 48 kHz 2ch) -> `micsel.140.1`
(`(L+R)/2` mono) -> `src.140.1` (48 -> 16 kHz) -> `module-copier.140.1`
(to 16-bit) -> `kpb.146.1` -> detector slots 141-143 -> `wov-arbiter.144.1` ->
-PCM 14 `Headset Multi-WOV`.
+PCM 14 `Headset WOV`.
---
diff --git a/src/audio/wov_arbiter/README.md b/src/audio/wov_arbiter/README.md
index a76f17f527b4..c69c752cc11c 100644
--- a/src/audio/wov_arbiter/README.md
+++ b/src/audio/wov_arbiter/README.md
@@ -40,11 +40,11 @@ The Multi-Slot WOV subsystem supports two primary topology architectures:
In this architecture, two dedicated physical PDM digital microphone interfaces and a speaker echo reference feed the topology:
- **PDM1 (`dmic16k`)**: Dedicated 16 kHz 2ch or 4ch (`DMIC_WOV_DAI_CHANNELS`) 32-bit stream via Pipeline 119 feeding ECNS Input Pin 0.
-- **Speaker echo reference**: Pipeline 120 (`siggen-src-capture`) collects the 48 kHz stereo speaker playback in `siggen.120.1` (passthrough when bound, silence when the speaker is not running) and converts it to 16 kHz stereo 32-bit in `src.120.1`, feeding ECNS Input Pin 1. The platform topology routes the speaker playback into `siggen.120.1` (SoundWire `SDW_SPK_ECHO_REF_ECNS=true`, ADL rt5682 SSP `SPEAKER_ECHO_REF_ECNS=true`, HDA generic `HDA_SPEAKER_ECHO_REF_ECNS=true`).
+- **Speaker echo reference**: Pipeline 120 (`siggen-copier-capture`) collects the 48 kHz stereo speaker playback in `siggen.120.1` (passthrough when bound, silence when the speaker is not running) and `module-copier.120.2` fans it out. `src.124.1` in its own Pipeline 124 converts it to 16 kHz stereo 32-bit, feeding ECNS Input Pin 1. The SRC is not in Pipeline 120, because that pipeline keeps running for the 48 kHz ECNS and the firmware deletes a module only with its pipeline. The platform topology routes the speaker playback into `siggen.120.1` (SoundWire `SDW_SPK_ECHO_REF_ECNS=true`, ADL rt5682 SSP `SPEAKER_ECHO_REF_ECNS=true`, HDA generic `HDA_SPEAKER_ECHO_REF_ECNS=true`).
- **PDM0 (`dmic01`)**: 48 kHz 2ch or 4ch (`NUM_DMICS`) 32-bit stream captured with the same regular DMIC0 pipelines of `platform/intel/dmic-generic.conf` as in the non-WoV topologies, without the TDFB/DRC enhancements (`DMIC0_ENHANCED_CAPTURE` false). It does not pass through ECNS: `dai-copier.DMIC.dmic01.capture` -> `gain.101.1` (muting and volume) -> `eqiir.101.1` (`DMIC0_DAI_EQIIR`, 40 Hz high-pass) -> `module-copier.101.2` -> `host-copier.10.capture` (ALSA PCM 10, `hw:0,10`, `DMIC Raw`, S32_LE). The IDs are for SoundWire (DAI pipeline 101, host pipeline 100, PCM 10); HDA generic uses pipelines 12/11 and PCM 6, ADL rt5682 uses pipelines 14/13 and PCM 99. This PCM is not D0i3 compatible.
The ECNS DP module (20 ms period) has a single output:
-- **Pin 0 Out (16 kHz mono)**: The microphone channels of Pin 0 In are averaged to mono, or a single channel is selected with the `DMIC ECNS mic channel` enum (`Average` by default, `Mic1`..`Mic2` or `Mic1`..`Mic4`), and filtered by a 100 Hz high-pass IIR. The `DMIC ECNS boost` switch selects the +30 dB or the 0 dB filter response. When the `DMIC ECNS AEC switch` is on, the `(L+R)/2` average of the echo reference is subtracted after the IIR. The `DMIC ECNS NS switch` has no function yet. Both AEC and NS switches default to off. The output is s16 in the topology (the firmware follows the KPB input bit depth). It routes to KPB (Pipeline 116, 2.0s history depth = 64 KB mono buffer), then fans out via `module-copier.118.1` to 3 concurrent **microWakeWord (MWW)** keyword spotting slots (running MFCC feature extraction + TFLM streaming graph in lock-step). Upon keyword detection, the detector notifies KPB (`NOTIFIER_ID_KPB_CLIENT_EVT`) to drain and the WOV Arbiter (`NOTIFIER_ID_WOV_DETECT`) to set `wov_active_slot` and pause sibling slots. The WOV Arbiter routes the active slot audio (pre-roll + live) to ALSA PCM 12 (`hw:0,12`, `DMIC Multi-WOV`, `capture_compatible_d0i3: true`).
+- **Pin 0 Out (16 kHz mono)**: The microphone channels of Pin 0 In are averaged to mono, or a single channel is selected with the `DMIC ECNS mic channel` enum (`Average` by default, `Mic1`..`Mic2` or `Mic1`..`Mic4`), and filtered by a 100 Hz high-pass IIR. The `DMIC ECNS boost` switch selects the +30 dB or the 0 dB filter response. When the `DMIC ECNS AEC switch` is on, the `(L+R)/2` average of the echo reference is subtracted after the IIR. The `DMIC ECNS NS switch` has no function yet. Both AEC and NS switches default to off. The output is s16 in the topology (the firmware follows the KPB input bit depth). It routes to KPB (Pipeline 116, 2.0s history depth = 64 KB mono buffer), then fans out via `module-copier.118.1` to 3 concurrent **microWakeWord (MWW)** keyword spotting slots (running MFCC feature extraction + TFLM streaming graph in lock-step). Upon keyword detection, the detector notifies KPB (`NOTIFIER_ID_KPB_CLIENT_EVT`) to drain and the WOV Arbiter (`NOTIFIER_ID_WOV_DETECT`) to set `wov_active_slot` and pause sibling slots. The WOV Arbiter routes the active slot audio (pre-roll + live) to ALSA PCM 12 (`hw:0,12`, `DMIC WOV`, `capture_compatible_d0i3: true`).
```mermaid
flowchart TD
@@ -76,9 +76,11 @@ flowchart TD
SPK["Speaker playback
(SDW / SSP / HDA module-copier
+ loopback DAI where available)"]
subgraph P120 ["Pipeline 120: Speaker Echo Reference (Core 0, LL 1ms)"]
SIGGEN["siggen.120.1
(48 kHz · 2ch · passthrough,
silence when speaker is idle)"]
- SRC_120["src.120.1
(48 kHz → 16 kHz · 2ch · S32_LE)"]
- SIGGEN --> SRC_120
end
+ subgraph P124 ["Pipeline 124: 16 kHz Echo Reference SRC (Core 0, LL 1ms)"]
+ SRC_120["src.124.1
(48 kHz → 16 kHz · 2ch · S32_LE)"]
+ end
+ SIGGEN --> SRC_120
SPK --> SIGGEN
%% Pipeline 115: ECNS DP Pipeline
@@ -129,7 +131,7 @@ flowchart TD
%% Pipeline 114: WoV Arbiter & Host Capture PCM 12
subgraph P114 ["Pipeline 114: WoV Arbiter (Core 0, LL 1ms)"]
ARB["wov-arbiter.114.1
• Pin 0: Drained audio stream
• Pins 1-3: Keyword triggers"]
- HOST_12["host-copier.12.capture
(PCM 12: 'DMIC Multi-WOV'
hw:0,12 · d0i3_compatible=true)"]
+ HOST_12["host-copier.12.capture
(PCM 12: 'DMIC WOV'
hw:0,12 · d0i3_compatible=true)"]
ARB --> HOST_12
end
@@ -208,7 +210,7 @@ graph TD
subgraph P104["Pipeline 104 — Host Regular PCM Capture (Core 0)"]
ARB["wov_arbiter\n(3 input pins)"]
- HC["host-copier\npcmC0D11c (hw:0,11)\n'DMIC Multi-WOV'"]
+ HC["host-copier\npcmC0D11c (hw:0,11)\n'DMIC WOV'"]
ARB --> HC
end
@@ -599,7 +601,7 @@ The WOV audio is exposed as a standard **ALSA PCM** capture device (`hw:0,11` or
Standard tools like `arecord` and the zero-dependency C capture utility `wov_capture_app` interact directly with this endpoint:
```text
-Card: 0 PCM device: 11 Name: "DMIC Multi-WOV" (/dev/snd/pcmC0D11c)
+Card: 0 PCM device: 11 Name: "DMIC WOV" (/dev/snd/pcmC0D11c)
Formats: S16_LE / S32_LE (raw PCM)
Rate: 16000 Hz
Channels: 2 (stereo)
@@ -1156,7 +1158,7 @@ modprobe snd_sof_pci_intel_tgl \
tplg_filename=intel/sof-ipc4-tplg/sof-tgl-dmic-4ch.tplg
# 1. Verify the PCM capture device is visible
-arecord -l # expect: card 0, device 11: DMIC Multi-WOV
+arecord -l # expect: card 0, device 11: DMIC WOV
cat /proc/asound/card0/pcm11c/info
# 2. Run capture test with arecord or wov_capture_app
diff --git a/src/include/sof/audio/ecns.h b/src/include/sof/audio/ecns.h
index b39a91041ee5..9ab394405c24 100644
--- a/src/include/sof/audio/ecns.h
+++ b/src/include/sof/audio/ecns.h
@@ -14,21 +14,26 @@
#include
#include
-/** \brief Input pin 0: 16 kHz microphone stream from the DMIC DAI copier */
+/** \brief Input pin 0: microphone stream from the DMIC DAI copier */
#define ECNS_PIN_MIC_IN 0
-/** \brief Input pin 1: 16 kHz echo reference stream from the speaker */
+/** \brief Input pin 1: echo reference stream from the speaker */
#define ECNS_PIN_REF_IN 1
-/** \brief Output pin 0: 16 kHz mono processed stream, e.g. to KPB */
+/** \brief Output pin 0: processed stream, mono e.g. to KPB or multichannel to host */
#define ECNS_PIN_OUT 0
-/** \brief Output sample rate in Hz */
-#define ECNS_RATE 16000
+/** \brief Supported sample rate in Hz, e.g. for WoV */
+#define ECNS_RATE_16K 16000
+/** \brief Supported sample rate in Hz, e.g. for VoIP capture */
+#define ECNS_RATE_48K 48000
/** \brief Microphone channel enum value to average all channels */
#define ECNS_MIC_SEL_AVERAGE 0
/** \brief Largest microphone channel enum value, Mic4 */
#define ECNS_MIC_SEL_MAX 4
+/** \brief Largest output channel count, one high-pass filter state per channel */
+#define ECNS_OUT_CH_MAX 4
+
/** \brief IPC4 channel map for mono, one nibble per channel, 0xF marks unused */
#define ECNS_CH_MAP_MONO 0xFFFFFFF0
diff --git a/tools/topology/topology2/README.md b/tools/topology/topology2/README.md
index 45457adf26a5..383ae7cceefa 100644
--- a/tools/topology/topology2/README.md
+++ b/tools/topology/topology2/README.md
@@ -501,25 +501,28 @@ Production hardware integrates the full multi-slot WoV subsystem alongside the p
The **`sof-wcl-rt721-4ch-wov-multi.tplg`** (and corresponding PTL variant `sof-ptl-rt721-4ch-wov-multi.tplg`) includes:
- **SoundWire RT721 Headphone Subsystem**: Standard playback (`PCM 0`, `Jack Out`) and low-power deep buffer (`PCM 31`, `Deepbuffer Jack Out`) mixed into ALH endpoint `Playback-SimpleJack`.
- **SoundWire RT721 Headset Mic Subsystem**: Hardware capture (`PCM 1`, `Jack In`) via ALH endpoint `Capture-SimpleJack` with dedicated IIR EQ.
-- **SoundWire SmartAmp Speaker Subsystem**: Standard speaker playback (`PCM 2`, `Speaker`) and deep buffer (`PCM 35`, `Deepbuffer Speaker`) mixed into a post-mixer DSP pipeline (IIR, FIR, DRC) before output to ALH endpoint `Playback-SmartAmp`.
+- **48 kHz headset ECNS (Pipelines 150, 151 and 152, `INCLUDE_SDW_JACK_ECNS=true`, `platform/intel/sdw-jack-ecns.conf`)**: `ecns.151.1` (20 ms DP, `lp_mode 1`) takes the 48 kHz stereo headset microphone from `module-copier.11.0` into Pin 0 and the 48 kHz stereo jack echo reference from `siggen.150.1` into Pin 1. The jack playback `module-copier.1.12` feeds `siggen.150.1` (silence when the jack playback is not running). The single `alh-copier.Loopback_Virtual.25` is routed to both `siggen.120.1` and `siggen.150.1` as the dai_out widget that starts the setup of the echo reference pipelines. The stereo s32 output goes to `host-copier.13.capture` (Pipeline 152, `PCM 13`, `Jack In ECNS`, 2ch 48 kHz S16_LE/S32_LE). The controls are `Jack ECNS boost`, `Jack ECNS AEC switch`, `Jack ECNS NS switch` and `Jack ECNS mic channel`. The jack rate must be 48 kHz.
+- **SoundWire SmartAmp Speaker Subsystem**: Standard speaker playback (`PCM 2`, `Speaker`) and deep buffer (`PCM 35`, `Deepbuffer Speaker`) mixed into the basic post-mixer pipeline (`SDW_SPK_ENHANCED_PLAYBACK=false`) with only a 100 Hz high-pass IIR (`SDW_SPK_BASIC_PLAYBACK_IIR=true`, `EFX_SPK_IIR_PARAMS`, control `Post Mixer Speaker Playback IIR Eq bytes`) after the volume, before output to ALH endpoint `Playback-SmartAmp`. The IIR is before `module-copier.21.22`, so the echo reference is the filtered signal.
- **SoundWire SmartMic Subsystem**: Microphone capture (`PCM 4`, `Microphone`) with hardware Time-Domain Filtered Beamforming (TDFB), Dynamic Range Compression (DRC), and IIR filter via ALH endpoint `Capture-SmartMic`.
- **Intel Display Audio (HDMI / DP)**: Three independent playback streams (`PCM 5`, `PCM 6`, `PCM 7`) connected to HDA copiers (`iDisp1`, `iDisp2`, `iDisp3`).
- **Dual-Rate DMIC Subsystem with Multi-Slot WoV**:
- **Dual PDM Hardware Interfaces**:
- `dmic01` (PDM0): 48 kHz 2ch or 4ch (`NUM_DMICS`) 32-bit capture via the regular DMIC0 DAI pipeline 101 of `platform/intel/dmic-generic.conf`.
- `dmic16k` (PDM1): Dedicated 16 kHz 2ch or 4ch 32-bit capture via Pipeline 119.
- - **48 kHz DMIC capture (Pipelines 101 and 100)**: The same regular DMIC0 capture as in the non-WoV topologies, without the TDFB/DRC enhancements (`DMIC0_ENHANCED_CAPTURE` false): `dai-copier.DMIC.dmic01.capture` -> `gain.101.1` (muting and volume) -> `eqiir.101.1` (`DMIC0_DAI_EQIIR`, `highpass_40hz_20db`) -> `module-copier.101.2` -> `host-copier.10.capture`. This path does not pass through ECNS.
+ - **48 kHz DMIC capture (Pipelines 101 and 100)**: The regular DMIC0 capture without the TDFB/DRC enhancements (`DMIC0_ENHANCED_CAPTURE` false): `dai-copier.DMIC.dmic01.capture` -> `gain.101.1` (muting and volume) -> `module-copier.101.2` -> `eqiir.100.1` (`DMIC0_DAI_EQIIR`, `highpass_40hz_20db`) -> `host-copier.10.capture`. With `INCLUDE_WOV=multi` the IIR is in the host pipeline 100 instead of the DAI pipeline 101, so that it filters only the raw capture PCM and the 48 kHz ECNS branches from `module-copier.101.2` before it. The gain is shared, so the volume and mute apply to both.
+ - **48 kHz ECNS for VoIP (Pipelines 122 and 123)**: `ecns.122.1` (20 ms DP, `lp_mode 1`) takes the 48 kHz 2/4ch microphones from `module-copier.101.2` into Pin 0 and the 48 kHz stereo echo reference from `module-copier.120.2` into Pin 1. The s32 output has the DMIC0 channel count (`NUM_DMICS`, 2 or 4) and goes to `host-copier.15.capture` (Pipeline 123, `PCM 15`, `DMIC48k ECNS`, 2/4ch 48 kHz S16_LE/S32_LE). With `Average` the microphone channels pass through, with `MicN` the selected channel is duplicated to all channels. The controls are `DMIC0 ECNS boost`, `DMIC0 ECNS AEC switch`, `DMIC0 ECNS NS switch` and `DMIC0 ECNS mic channel`. The DMIC0 rate must be 48 kHz.
- `PCM 10` (`DMIC Raw`): 48 kHz 2ch or 4ch `S32_LE` capture (`hw:0,10`, not D0i3 compatible). The HDA generic WoV topologies use pipelines 12/11 and PCM 6, the ADL rt5682 WoV topologies use pipelines 14/13 and PCM 99.
- - **Speaker echo reference (Pipeline 120, `siggen-src-capture`)**: The speaker playback is routed into `siggen.120.1` (48 kHz stereo, passthrough when bound, silence when the speaker is not running) and converted to 16 kHz stereo 32-bit by `src.120.1`. In SoundWire topologies (`SDW_SPK_ECHO_REF_ECNS=true`) `alh-copier.Loopback_Virtual.25` and `module-copier.21.22` feed `siggen.120.1`.
+ - **Speaker echo reference (Pipelines 120 and 124)**: The speaker playback is routed into `siggen.120.1` (Pipeline 120, `siggen-copier-capture`, 48 kHz stereo, passthrough when bound, silence when the speaker is not running). The siggen supports one sink only, so `module-copier.120.2` feeds the 48 kHz echo reference to `ecns.122.1` and to `src.124.1`, which converts it to 16 kHz stereo 32-bit in its own Pipeline 124. The SRC is not in Pipeline 120, because that pipeline keeps running for the 48 kHz ECNS when the 16 kHz ECNS stops: the kernel frees the 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. In SoundWire topologies (`SDW_SPK_ECHO_REF_ECNS=true`) `alh-copier.Loopback_Virtual.25` and `module-copier.21.22` feed `siggen.120.1`.
- **20ms DP ECNS Engine (`ecns.115.1`, Pipeline 115, `lp_mode 1`)**:
- Input Pin 0: 16 kHz 2ch or 4ch s32 microphones from `dai-copier.DMIC.dmic16k.capture`.
- - Input Pin 1: 16 kHz stereo s32 speaker echo reference from `src.120.1`.
- - Output Pin 0: The microphone channels are averaged to mono, or a single channel is selected with the `DMIC ECNS mic channel` enum (`Average` by default, `Mic1`..`Mic2` or `Mic1`..`Mic4`), and filtered by a 100 Hz high-pass IIR (`DMIC ECNS boost` selects +30 dB or 0 dB). With `DMIC ECNS AEC switch` on, the `(L+R)/2` average of the echo reference is subtracted after the IIR. `DMIC ECNS NS switch` has no function yet. Both default to off. 16 kHz mono (s16 in topology, the firmware follows the KPB input bit depth) to KPB (`kpb.116.1`, Pipeline 116).
+ - Input Pin 1: 16 kHz stereo s32 speaker echo reference from `src.124.1`.
+ - Output Pin 0: The microphone channels are averaged to mono, or a single channel is selected with the `DMIC ECNS mic channel` enum (`Average` by default, `Mic1`..`Mic2` or `Mic1`..`Mic4`), and filtered by a 100 Hz high-pass IIR (`DMIC ECNS boost` selects +30 dB or 0 dB). With `DMIC ECNS AEC switch` on, the `(L+R)/2` average of the echo reference is subtracted after the IIR. `DMIC ECNS NS switch` has no function yet. Both default to off. 16 kHz mono (s16 in topology, the firmware follows the sink bit depth) to the fanout copier (`module-copier.117.1`, Pipeline 117).
+ - **ECNS output fanout (`module-copier.117.1`, Pipeline 117)**: Output Pin 0 feeds the KPB (`kpb.116.1`, Pipeline 116). Output Pin 1 feeds the processed microphone to `host-copier.11.capture` (Pipeline 121, `PCM 11`, `DMIC16k ECNS`, 1ch 16 kHz S16_LE). PCM 11 can be captured without the WoV PCM 12, the KPB is then not set up. The host copier has its own pipeline because the kernel does not trigger pipelines that already run for PCM 12, so a host copier inside them would never be started.
- Key Phrase Buffer (KPB, Pipeline 116, 64 KB history buffer = 2000 ms, 16 kHz 1ch mono) with dual-sink topology fanout:
- Sink Pin 0 (`sel_sink`): Real-time live audio feed to detector slots.
- Sink Pin 1 (`host_sink`): Buffered history drain to WOV Arbiter upon keyword trigger.
- 3 concurrent microWakeWord detector slots (10ms DP MFCC + MWW) armed individually via ALSA volatile controls `wovdebug_111`, `wovdebug_112`, and `wovdebug_113`.
- - 4-pin WOV Arbiter (`wov-arbiter.114.1`, Pipeline 114) with active slot selection, host wake support, and audio history stream delivery (`PCM 12`, `DMIC Multi-WOV`, 1ch 16 kHz, `capture_compatible_d0i3: true`).
+ - 4-pin WOV Arbiter (`wov-arbiter.114.1`, Pipeline 114) with active slot selection, host wake support, and audio history stream delivery (`PCM 12`, `DMIC WOV`, 1ch 16 kHz, `capture_compatible_d0i3: true`).
#### Dual-Rate DMIC & Multi-Slot WoV Architecture Diagram
@@ -538,9 +541,8 @@ flowchart TD
subgraph P101["Pipeline 101 — 48 kHz DMIC0 DAI Capture (Core 0, LL 1ms)"]
DAI0["dai-copier.DMIC.dmic01.capture\n(48 kHz · 2/4ch · S32_LE)"]
GAIN101["gain.101.1\n(Dmic0 Capture Volume / Switch)"]
- IIR101["eqiir.101.1\n(DMIC0_DAI_EQIIR · 40 Hz high-pass, +20 dB)"]
MC101["module-copier.101.2"]
- DAI0 --> GAIN101 --> IIR101 --> MC101
+ DAI0 --> GAIN101 --> MC101
end
%% Pipeline 119: 16 kHz DAI Ingest
@@ -555,9 +557,13 @@ flowchart TD
SPKREF["Speaker playback\n(alh-copier.Loopback_Virtual.25,\nmodule-copier.21.22)"]
subgraph P120["Pipeline 120 — Speaker Echo Reference (Core 0, LL 1ms)"]
SIGGEN["siggen.120.1\n(48 kHz · 2ch · passthrough,\nsilence when speaker is idle)"]
- SRC120["src.120.1\n(48 kHz -> 16 kHz · 2ch · S32_LE)"]
- SIGGEN --> SRC120
+ MC120["module-copier.120.2\n(48 kHz · 2ch fanout)"]
+ SIGGEN --> MC120
end
+ subgraph P124["Pipeline 124 — 16 kHz Echo Reference SRC (Core 0, LL 1ms)"]
+ SRC120["src.124.1\n(48 kHz -> 16 kHz · 2ch · S32_LE)"]
+ end
+ MC120 --> SRC120
SPKREF --> SIGGEN
%% Pipeline 115: ECNS DP Engine
@@ -570,12 +576,36 @@ flowchart TD
%% Pipeline 100: 48 kHz DMIC0 Host Capture PCM 10 (no ECNS)
subgraph P100["Pipeline 100 — DMIC0 Host Capture (Core 0, LL 1ms)"]
+ IIR100["eqiir.100.1\n(DMIC0_DAI_EQIIR · 40 Hz high-pass, +20 dB)"]
HOST10["host-copier.10.capture\n(PCM 10: 'DMIC Raw' · hw:0,10)\n2/4ch · 48 kHz · S32_LE"]
+ IIR100 --> HOST10
+ end
+
+ MC101 --> IIR100
+
+ %% Pipelines 122 and 123: 48 kHz ECNS and Host Capture PCM 15
+ subgraph P122["Pipeline 122 — 48 kHz ECNS (Core 0, DP 20ms, lp_mode 1)"]
+ ECNS48["ecns.122.1\nPin 0 In: 48 kHz mic, 2/4ch s32\nPin 1 In: 48 kHz echo ref, 2ch s32\nDMIC0 ECNS boost / AEC / NS / mic channel\nPin 0 Out: 48 kHz, 2/4ch s32"]
+ end
+ subgraph P123["Pipeline 123 — 48 kHz ECNS Host Capture (Core 0, LL 1ms)"]
+ HOST15["host-copier.15.capture\n(PCM 15: 'DMIC48k ECNS')\n2/4ch · 48 kHz · S16_LE/S32_LE"]
+ end
+ MC101 -->|"Pin 0 In (48k mic)"| ECNS48
+ MC120 -->|"Pin 1 In (48k 2ch echo ref)"| ECNS48
+ ECNS48 --> HOST15
+
+ %% Pipeline 117: ECNS output fanout
+ subgraph P117["Pipeline 117 — ECNS Output Fanout (Core 0, LL 1ms)"]
+ MC117["module-copier.117.1\n(2-way fanout)"]
end
- MC101 --> HOST10
+ %% Pipeline 121: ECNS Host Capture PCM 11
+ subgraph P121["Pipeline 121 — ECNS Host Capture (Core 0, LL 1ms)"]
+ HOST11["host-copier.11.capture\n(PCM 11: 'DMIC16k ECNS')\n1ch · 16 kHz · S16_LE"]
+ end
+ MC117 -->|"Pin 1"| HOST11
- %% Pipeline 116: KPB History Buffer (Direct from ECNS Pin 0)
+ %% Pipeline 116: KPB History Buffer (from the ECNS fanout copier)
subgraph P116["Pipeline 116 — KPB History Buffer (Core 0, LL 1ms)"]
KPB["kpb.116.1\n(Key Phrase Buffer · 2000ms = 64 KB)\n16 kHz · 1ch mono · S16_LE\nPin 0: sel_sink | Pin 1: host_sink"]
end
@@ -586,7 +616,8 @@ flowchart TD
end
KPB -->|"Pin 0 (Live Audio Feed)"| MIX116
- ECNS -- "Pin 0 Out (Mono 16k)" --> KPB
+ ECNS -- "Pin 0 Out (Mono 16k)" --> MC117
+ MC117 -->|"Pin 0"| KPB
%% Pipelines 111-113: microWakeWord Detector Slots
subgraph SLOTS["Pipelines 111–113 — microWakeWord Detector Slots (Core 0, DP 10ms)"]
@@ -608,7 +639,7 @@ flowchart TD
%% Pipeline 114: WOV Arbiter & Multi-WOV Host Capture
subgraph P114["Pipeline 114 — WOV Arbiter & Multi-WOV Host Capture (Core 0, LL 1ms)"]
ARB["wov-arbiter.114.1\n(4-Pin Arbiter · Active Slot Routing)\nPin 0: Audio Drain | Pins 1-3: Trigger Features"]
- HOST12["host-copier.12.capture\n(PCM 12: 'DMIC Multi-WOV' · hw:0,12)\n1ch · 16 kHz · S16/S32_LE\ncapture_compatible_d0i3: true"]
+ HOST12["host-copier.12.capture\n(PCM 12: 'DMIC WOV' · hw:0,12)\n1ch · 16 kHz · S16/S32_LE\ncapture_compatible_d0i3: true"]
ARB --> HOST12
end
@@ -694,9 +725,10 @@ graph TD
subgraph P21["Pipeline 21 — SmartAmp Mixer, DSP & DAI (Core 0, LL 1ms)"]
MO21["mixout.21.1"]
G21["gain.21.1\n(Post-Mixer Speaker Volume)"]
+ IIR21["eqiir.21.2\n(100 Hz high-pass, 0 dB)"]
MC21["module-copier.21.22"]
ALH2["alh-copier.Playback-SmartAmp.0\n(ALH Link 2 · DAI Playback-SmartAmp)"]
- MO21 --> G21 --> MC21 --> ALH2
+ MO21 --> G21 --> IIR21 --> MC21 --> ALH2
end
MIX20 --> MO21
MIX16 --> MO21
@@ -731,9 +763,8 @@ graph TD
subgraph P101["Pipeline 101 — 48 kHz DMIC0 DAI Capture (Core 0, LL 1ms)"]
DAI0["dai-copier.DMIC.dmic01.capture\n(dmic01 · PDM0 · 2/4ch · 48 kHz · S32_LE)"]
GAIN101["gain.101.1\n(Dmic0 Capture Volume / Switch)"]
- IIR101["eqiir.101.1\n(40 Hz high-pass, +20 dB)"]
MC101["module-copier.101.2"]
- DAI0 --> GAIN101 --> IIR101 --> MC101
+ DAI0 --> GAIN101 --> MC101
end
subgraph P119["Pipeline 119 — 16 kHz DAI Capture (Core 0, LL 1ms)"]
@@ -743,9 +774,13 @@ graph TD
subgraph P120["Pipeline 120 — Speaker Echo Reference (Core 0, LL 1ms)"]
LBV["alh-copier.Loopback_Virtual.25"]
SIGGEN120["siggen.120.1\n(48 kHz · 2ch · passthrough,\nsilence when speaker is idle)"]
- SRC120["src.120.1\n(48 kHz -> 16 kHz · 2ch · S32_LE)"]
- LBV --> SIGGEN120 --> SRC120
+ MC120["module-copier.120.2"]
+ LBV --> SIGGEN120 --> MC120
end
+ subgraph P124["Pipeline 124 — 16 kHz Echo Reference SRC (Core 0, LL 1ms)"]
+ SRC120["src.124.1\n(48 kHz -> 16 kHz · 2ch · S32_LE)"]
+ end
+ MC120 --> SRC120
MC21 --> SIGGEN120
subgraph P115["Pipeline 115 — 20ms DP ECNS Audio Processing (Core 0, DP 20ms, lp_mode 1)"]
@@ -755,9 +790,36 @@ graph TD
SRC120 -->|"Pin 1 In (16k echo ref)"| ECNS115
subgraph P100["Pipeline 100 — DMIC0 Host Capture (Core 0, LL 1ms)"]
+ IIR100["eqiir.100.1\n(40 Hz high-pass, +20 dB)"]
HC10["host-copier.10.capture\n(PCM 10: 'DMIC Raw')\n2/4ch · 48 kHz · S32_LE"]
+ IIR100 --> HC10
+ end
+ MC101 --> IIR100
+
+ subgraph P122["Pipeline 122 — 48 kHz ECNS (Core 0, DP 20ms, lp_mode 1)"]
+ ECNS122["ecns.122.1\n(DP Module · 20ms period)\nPin 0 Out: 48 kHz 2/4ch"]
+ end
+ subgraph P123["Pipeline 123 — 48 kHz ECNS Host Capture (Core 0, LL 1ms)"]
+ HC15["host-copier.15.capture\n(PCM 15: 'DMIC48k ECNS')\n2/4ch · 48 kHz · S16_LE/S32_LE"]
+ end
+ MC101 -->|"Pin 0 In (48k mic)"| ECNS122
+ MC120 -->|"Pin 1 In (48k echo ref)"| ECNS122
+ ECNS122 --> HC15
+
+ subgraph P150["Pipeline 150 — Jack Echo Reference (Core 0, LL 1ms)"]
+ SIGGEN150["siggen.150.1\n(48 kHz · 2ch · passthrough,\nsilence when jack playback is idle)"]
+ end
+ LBV --> SIGGEN150
+ MC1 --> SIGGEN150
+ subgraph P151["Pipeline 151 — 48 kHz Jack ECNS (Core 0, DP 20ms, lp_mode 1)"]
+ ECNS151["ecns.151.1\n(DP Module · 20ms period)\nPin 0 Out: 48 kHz 2ch"]
+ end
+ subgraph P152["Pipeline 152 — 48 kHz Jack ECNS Host Capture (Core 0, LL 1ms)"]
+ HC13["host-copier.13.capture\n(PCM 13: 'Jack In ECNS')\n2ch · 48 kHz · S16_LE/S32_LE"]
end
- MC101 --> HC10
+ MC11 -->|"Pin 0 In (48k headset mic)"| ECNS151
+ SIGGEN150 -->|"Pin 1 In (48k jack echo ref)"| ECNS151
+ ECNS151 --> HC13
subgraph P116["Pipeline 116 — KPB History Buffer (Core 0, LL 1ms)"]
KPB116["kpb.116.1\n(Key Phrase Buffer · 2000ms = 64 KB)\nPin 0: sel_sink (Real-time live feed)\nPin 1: host_sink (Drain History)"]
@@ -794,7 +856,7 @@ graph TD
subgraph P114["Pipeline 114 — WOV Arbiter & Host Capture (Core 0, LL 1ms)"]
ARB["wov-arbiter.114.1\n(4-Pin Arbiter · Active Slot Routing)\nPin 0: Audio Drain | Pins 1-3: Features"]
- HC12["host-copier.12.capture\n(PCM 12: 'DMIC Multi-WOV')\n1ch · 16 kHz · S16/S32_LE\ncapture_compatible_d0i3 = true"]
+ HC12["host-copier.12.capture\n(PCM 12: 'DMIC WOV')\n1ch · 16 kHz · S16/S32_LE\ncapture_compatible_d0i3 = true"]
ARB --> HC12
end
@@ -841,13 +903,16 @@ graph TD
|---|---|---|---|---|---|---|---|---|
| **PCM 0** | `Jack Out` | Playback | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P0, P1 | SoundWire headphone playback (`host-copier.0.playback` -> `gain.0.1` -> `mixin.0.1` -> `mixout.1.1` -> `gain.1.1` -> `alh-copier.Playback-SimpleJack.0`) | No |
| **PCM 1** | `Jack In` | Capture | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P11, P10 | SoundWire headset mic capture (`alh-copier.Capture-SimpleJack.0` -> `eqiir.11.0` -> `module-copier.11.0` -> `host-copier.1.capture`) | No |
-| **PCM 2** | `Speaker` | Playback | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P20, P21 | SoundWire SmartAmp speaker playback, basic pipeline with `SDW_SPK_ENHANCED_PLAYBACK=false` (`host-copier.2.playback` -> `gain.20.1` -> `mixin.20.1` -> `mixout.21.1` -> `gain.21.1` -> `module-copier.21.22` -> `alh-copier.Playback-SmartAmp.0`) | No |
+| **PCM 2** | `Speaker` | Playback | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P20, P21 | SoundWire SmartAmp speaker playback, basic pipeline with `SDW_SPK_ENHANCED_PLAYBACK=false` and `SDW_SPK_BASIC_PLAYBACK_IIR=true` (`host-copier.2.playback` -> `gain.20.1` -> `mixin.20.1` -> `mixout.21.1` -> `gain.21.1` -> `eqiir.21.2` -> `module-copier.21.22` -> `alh-copier.Playback-SmartAmp.0`) | No |
| **PCM 4** | `Microphone` | Capture | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P41, P40 | SoundWire SmartMic capture, basic pipeline with `SDW_DMIC_ENHANCED_CAPTURE=false` (`alh-copier.Capture-SmartMic.0` -> `eqiir.41.0` -> `module-copier.41.0` -> `host-copier.4.capture`) | No |
| **PCM 5** | `HDMI1` | Playback | 2–8 | 48 kHz | S16_LE, S32_LE | P50, P51 | Intel Display Audio HDMI/DP 1 (`host-copier.5.playback` -> `dai-copier.HDA.iDisp1.playback`) | No |
| **PCM 6** | `HDMI2` | Playback | 2–8 | 48 kHz | S16_LE, S32_LE | P60, P61 | Intel Display Audio HDMI/DP 2 (`host-copier.6.playback` -> `dai-copier.HDA.iDisp2.playback`) | No |
| **PCM 7** | `HDMI3` | Playback | 2–8 | 48 kHz | S16_LE, S32_LE | P70, P71 | Intel Display Audio HDMI/DP 3 (`host-copier.7.playback` -> `dai-copier.HDA.iDisp3.playback`) | No |
-| **PCM 10** | `DMIC Raw` | Capture | 2 or 4 | 48 kHz | S32_LE | P101, P100 | Regular DMIC0 capture without TDFB/DRC, 40 Hz high-pass with +20 dB gain, no ECNS (`dai-copier.DMIC.dmic01.capture` -> `gain.101.1` -> `eqiir.101.1` -> `module-copier.101.2` -> `host-copier.10.capture`). HDA generic: PCM 6, P12/P11. ADL rt5682: PCM 99, P14/P13. | No |
-| **PCM 12** | `DMIC Multi-WOV` | Capture | 1 | 16 kHz | S16_LE, S32_LE | P119, P120, P115, P116, P118, P111-113, P114 | Gated mono Wake-on-Voice capture stream from 4-pin WOV Arbiter (`dai-copier.DMIC.dmic16k.capture` -> `ecns.115.1` Pin 0 in, `siggen.120.1` -> `src.120.1` -> `ecns.115.1` Pin 1 in echo reference, `ecns.115.1` Pin 0 out mono -> `kpb.116.1` -> `wov-arbiter.114.1` -> `host-copier.12.capture`). Supports S0 keyword detection and D0i3 platform suspend/wake via AudioDSP MSI IRQ. | **Yes** (`capture_compatible_d0i3 true`) |
+| **PCM 10** | `DMIC Raw` | Capture | 2 or 4 | 48 kHz | S32_LE | P101, P100 | Regular DMIC0 capture without TDFB/DRC, 40 Hz high-pass with +20 dB gain, no ECNS (`dai-copier.DMIC.dmic01.capture` -> `gain.101.1` -> `module-copier.101.2` -> `eqiir.100.1` -> `host-copier.10.capture`). HDA generic: PCM 6, P12/P11. ADL rt5682: PCM 99, P14/P13. | No |
+| **PCM 11** | `DMIC16k ECNS` | Capture | 1 | 16 kHz | S16_LE | P119, P120, P124, P115, P117, P121 | 16 kHz ECNS processed microphone (`ecns.115.1` -> `module-copier.117.1` -> `host-copier.11.capture`) | No |
+| **PCM 12** | `DMIC WOV` | Capture | 1 | 16 kHz | S16_LE, S32_LE | P119, P120, P124, P115, P116, P118, P111-113, P114 | Gated mono Wake-on-Voice capture stream from 4-pin WOV Arbiter (`dai-copier.DMIC.dmic16k.capture` -> `ecns.115.1` Pin 0 in, `siggen.120.1` -> `module-copier.120.2` -> `src.124.1` -> `ecns.115.1` Pin 1 in echo reference, `ecns.115.1` Pin 0 out mono -> `module-copier.117.1` -> `kpb.116.1` -> `wov-arbiter.114.1` -> `host-copier.12.capture`). Supports S0 keyword detection and D0i3 platform suspend/wake via AudioDSP MSI IRQ. | **Yes** (`capture_compatible_d0i3 true`) |
+| **PCM 13** | `Jack In ECNS` | Capture | 2 | 48 kHz | S16_LE, S32_LE | P11, P1, P150, P151, P152 | 48 kHz ECNS processed headset microphone, `INCLUDE_SDW_JACK_ECNS=true` (`module-copier.11.0` -> `ecns.151.1` Pin 0 in, `module-copier.1.12` -> `siggen.150.1` -> `ecns.151.1` Pin 1 in jack echo reference, `ecns.151.1` -> `host-copier.13.capture`) | No |
+| **PCM 15** | `DMIC48k ECNS` | Capture | 2 or 4 (`NUM_DMICS`) | 48 kHz | S16_LE, S32_LE | P101, P120, P122, P123 | 48 kHz ECNS processed microphone for VoIP (`module-copier.101.2` -> `ecns.122.1` Pin 0 in, `siggen.120.1` -> `module-copier.120.2` -> `ecns.122.1` Pin 1 in echo reference, `ecns.122.1` -> `host-copier.15.capture`). HDA generic: P12, ADL rt5682: P14 as the DAI pipeline. | No |
| **PCM 31** | `Deepbuffer Jack Out` | Playback | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P15, P1 | Low-power deep-buffer playback to headphone jack (`host-copier.31.playback` -> `gain.15.1` -> `mixin.15.1` -> `mixout.1.1`) | No |
| **PCM 35** | `Deepbuffer Speaker` | Playback | 2 | 48 kHz | S16_LE, S24_LE, S32_LE | P16, P21 | Low-power deep-buffer playback to SmartAmp speakers (`host-copier.35.playback` -> `gain.16.1` -> `mixin.16.1` -> `mixout.21.1`) | No |
@@ -941,6 +1006,7 @@ SDW_SPK_ECHO_REF=true,\
SDW_ECHO_REF_DAI=true,\
SDW_SPK_ECHO_REF_ECNS=true,\
SDW_SPK_ENHANCED_PLAYBACK=false,\
+SDW_SPK_BASIC_PLAYBACK_IIR=true,\
SDW_DMIC_ENHANCED_CAPTURE=false,\
INCLUDE_WOV=multi' \
-c /tmp/sof-wcl-rt721-4ch-wov-multi.conf \
@@ -1046,7 +1112,7 @@ cat tools/topology/topology2/abi.conf tools/topology/topology2/cavs-sdw.conf > /
ALSA_CONFIG_DIR=$PWD/tools/topology/topology2 \
ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/alsa-topology \
alsatplg -I $PWD/tools/topology/topology2 -p \
- -D 'PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=5,DMIC1_ID=6,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9,SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true,SDW_SPK_ECHO_REF_ECNS=true,SDW_SPK_ENHANCED_PLAYBACK=false,SDW_DMIC_ENHANCED_CAPTURE=false,INCLUDE_WOV=multi' \
+ -D 'PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=5,DMIC1_ID=6,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9,SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true,SDW_SPK_ECHO_REF_ECNS=true,SDW_SPK_ENHANCED_PLAYBACK=false,SDW_SPK_BASIC_PLAYBACK_IIR=true,SDW_DMIC_ENHANCED_CAPTURE=false,INCLUDE_WOV=multi' \
-c /tmp/sof-ptl-rt721-4ch-wov-multi.conf \
-o build/sof-ptl-rt721-4ch-wov-multi.tplg
```
diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf
index 56d3248646d4..5dd4480906e2 100644
--- a/tools/topology/topology2/cavs-rt5682.conf
+++ b/tools/topology/topology2/cavs-rt5682.conf
@@ -26,6 +26,7 @@
+
@@ -60,7 +61,7 @@
-
+
diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf
index 03ca8dec2db1..c5d83f84c3bb 100644
--- a/tools/topology/topology2/cavs-sdw.conf
+++ b/tools/topology/topology2/cavs-sdw.conf
@@ -24,6 +24,7 @@
+
@@ -65,7 +66,7 @@
-
+
@@ -123,6 +124,9 @@ Define {
SDW_LINK_VALID_BITS 24
# Used when NUM_SDW_AMP_LINKS is 1 or more
SDW_SPK_ENHANCED_PLAYBACK true
+ # IIR after the speaker gain when SDW_SPK_ENHANCED_PLAYBACK is false,
+ # with the EFX_SPK_IIR_PARAMS coefficients
+ SDW_SPK_BASIC_PLAYBACK_IIR false
# Used when SDW_DMIC is 1
SDW_DMIC_ENHANCED_CAPTURE true
EFX_SPK_IIR_PARAMS "highpass_100hz_0db_48khz"
diff --git a/tools/topology/topology2/dmic-wov-multi-manifest.conf b/tools/topology/topology2/dmic-wov-multi-manifest.conf
index 55389c935ded..c7842e4e6e34 100644
--- a/tools/topology/topology2/dmic-wov-multi-manifest.conf
+++ b/tools/topology/topology2/dmic-wov-multi-manifest.conf
@@ -629,7 +629,7 @@ Object.Dai.DMIC [
# PCM 11 (Regular PCM)
# ---------------------------------------------------------------------------
Object.PCM.pcm."$DMIC_PCM_ID" {
- name "DMIC Multi-WOV"
+ name "DMIC WOV"
id $DMIC_PCM_ID
direction "capture"
capture_compatible_d0i3 true
diff --git a/tools/topology/topology2/dmic-wov-multi-ptl-manifest.conf b/tools/topology/topology2/dmic-wov-multi-ptl-manifest.conf
index 6b9d9053ec4f..a2bb0bb05721 100644
--- a/tools/topology/topology2/dmic-wov-multi-ptl-manifest.conf
+++ b/tools/topology/topology2/dmic-wov-multi-ptl-manifest.conf
@@ -636,7 +636,7 @@ Object.Dai.DMIC [
# PCM 11 (Regular PCM)
# ---------------------------------------------------------------------------
Object.PCM.pcm."$DMIC_PCM_ID" {
- name "DMIC Multi-WOV"
+ name "DMIC WOV"
id $DMIC_PCM_ID
direction "capture"
capture_compatible_d0i3 true
diff --git a/tools/topology/topology2/include/pipelines/cavs/siggen-src-capture.conf b/tools/topology/topology2/include/pipelines/cavs/siggen-copier-capture.conf
similarity index 55%
rename from tools/topology/topology2/include/pipelines/cavs/siggen-src-capture.conf
rename to tools/topology/topology2/include/pipelines/cavs/siggen-copier-capture.conf
index 54c183b75eb1..c2d7887ebb5a 100644
--- a/tools/topology/topology2/include/pipelines/cavs/siggen-src-capture.conf
+++ b/tools/topology/topology2/include/pipelines/cavs/siggen-copier-capture.conf
@@ -1,26 +1,33 @@
#
# Echo reference pipeline for ECNS
#
-# siggen.1 (48 kHz stereo) -> src.1 (48 to 16 kHz stereo)
+# siggen.1 (48 kHz stereo) -> module-copier.2
#
# The siggen widget collects the speaker echo reference. When the speaker
-# is not running it produces silence. The src output feeds the echo reference
-# input pin of the ECNS in another pipeline. All attributes defined herein are
-# namespaced by alsatplg to "Object.Pipeline.siggen-src-capture.N.attribute_name".
+# is not running it produces silence. The siggen supports only one sink, so
+# the module-copier provides the 48 kHz outputs to the ECNS instances in other
+# pipelines, e.g. via an SRC for a 16 kHz ECNS. All attributes defined herein
+# are namespaced by alsatplg to
+# "Object.Pipeline.siggen-copier-capture.N.attribute_name".
#
-# Usage: siggen-src-capture pipeline object can be instantiated as:
+# Every widget of the pipeline must be used by all PCMs that use the pipeline.
+# The kernel frees a widget when its last PCM stops, but the firmware deletes
+# the module only with the whole pipeline, so a widget used by only some PCMs,
+# e.g. an SRC for one of the ECNS instances, must be in another pipeline.
#
-# Object.Pipeline.siggen-src-capture."N" {
+# Usage: siggen-copier-capture pipeline object can be instantiated as:
+#
+# Object.Pipeline.siggen-copier-capture."N" {
# index 120
# }
#
# Where N is the unique pipeline ID within the same alsaconf node.
#
-# The siggen and src widget classes must be included by the top level
-# topology. Including siggen.conf again would duplicate its default format.
+# The siggen and module-copier widget classes must be included by the top
+# level topology. Including siggen.conf again would duplicate its default
+# format.
#
-
-Class.Pipeline."siggen-src-capture" {
+Class.Pipeline."siggen-copier-capture" {
@@ -47,9 +54,7 @@ Class.Pipeline."siggen-src-capture" {
]
}
- src."1" {
- rate_in 48000
- rate_out 16000
+ module-copier."2" {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
@@ -64,7 +69,7 @@ Class.Pipeline."siggen-src-capture" {
]
Object.Base.output_audio_format [
{
- out_rate 16000
+ out_rate 48000
out_channels 2
out_ch_cfg $CHANNEL_CONFIG_STEREO
out_ch_map $CHANNEL_MAP_STEREO
@@ -84,7 +89,7 @@ Class.Pipeline."siggen-src-capture" {
!route [
{
source siggen.$index.1
- sink src.$index.1
+ sink module-copier.$index.2
}
]
}
diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf
index 31d926d48c5d..e0354b3aca86 100644
--- a/tools/topology/topology2/platform/intel/dmic-generic.conf
+++ b/tools/topology/topology2/platform/intel/dmic-generic.conf
@@ -325,358 +325,54 @@ IncludeByKey.PASSTHROUGH {
}
]
- Object.Pipeline.dai-copier-gain-eqiir-module-copier-capture [
- {
- index $DMIC0_DAI_PIPELINE_ID
- core_id $DMIC_CORE_ID
+ # The multi-slot WoV ECNS of dmic-wov-multi.conf branches from the
+ # DAI pipeline module-copier. The IIR is moved to the host pipeline
+ # so that it filters only the raw capture PCM.
+ IncludeByKey.INCLUDE_WOV {
+ "(false|true)" {
+ Object.Pipeline.dai-copier-gain-eqiir-module-copier-capture [
+ {
+ index $DMIC0_DAI_PIPELINE_ID
+ core_id $DMIC_CORE_ID
- Object.Widget.dai-copier.1 {
- dai_index 0
- dai_type "DMIC"
- copier_type "DMIC"
- type dai_out
- stream_name $DMIC0_NAME
- node_type $DMIC_LINK_INPUT_CLASS
- num_input_audio_formats 3
- num_output_audio_formats 1
- IncludeByKey.NUM_DMICS {
- "1" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 1
- in_bit_depth 16
- in_valid_bit_depth 16
- in_ch_cfg $CHANNEL_CONFIG_MONO
- in_ch_map $CHANNEL_MAP_MONO
- }
- {
- in_rate $DMIC0_RATE
- in_channels 1
- in_bit_depth 32
- in_valid_bit_depth 24
- in_sample_type $SAMPLE_TYPE_MSB_INTEGER
- in_ch_cfg $CHANNEL_CONFIG_MONO
- in_ch_map $CHANNEL_MAP_MONO
- }
- {
- in_rate $DMIC0_RATE
- in_channels 1
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_MONO
- in_ch_map $CHANNEL_MAP_MONO
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 1
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_MONO
- out_ch_map $CHANNEL_MAP_MONO
- }
- ]
- }
- "2" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_bit_depth 16
- in_valid_bit_depth 16
- }
- {
- in_rate $DMIC0_RATE
- in_bit_depth 32
- in_valid_bit_depth 24
- in_sample_type $SAMPLE_TYPE_MSB_INTEGER
- }
- {
- in_rate $DMIC0_RATE
- in_bit_depth 32
- in_valid_bit_depth 32
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_bit_depth 32
- out_valid_bit_depth 32
- }
- ]
- }
- "4" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 4
- in_bit_depth 16
- in_valid_bit_depth 16
- in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- in_ch_map $CHANNEL_MAP_3_POINT_1
- }
- {
- in_rate $DMIC0_RATE
- in_channels 4
- in_bit_depth 32
- in_valid_bit_depth 24
- in_sample_type $SAMPLE_TYPE_MSB_INTEGER
- in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- in_ch_map $CHANNEL_MAP_3_POINT_1
- }
- {
- in_rate $DMIC0_RATE
- in_channels 4
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- in_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 4
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- out_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- }
- }
- }
+
- Object.Widget.module-copier."2" {
- stream_name $DMIC0_NAME
- num_input_audio_formats 1
- num_output_audio_formats 1
- IncludeByKey.NUM_DMICS {
- "1" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 1
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_MONO
- in_ch_map $CHANNEL_MAP_MONO
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 1
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_MONO
- out_ch_map $CHANNEL_MAP_MONO
- }
- ]
- }
- "2" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_bit_depth 32
- in_valid_bit_depth 32
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_bit_depth 32
- out_valid_bit_depth 32
- }
- ]
- }
- "4" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 4
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- in_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 4
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- out_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
+ Object.Widget.eqiir.1 {
+
}
- }
- }
- Object.Widget.eqiir.1 {
- Object.Control.bytes."1" {
- name 'DMIC0 Capture IIR Eq'
- IncludeByKey.DMIC0_DAI_EQIIR {
- "passthrough" "include/components/eqiir/passthrough.conf"
- "highpass_40hz_0db" "include/components/eqiir/highpass_40hz_0db_48khz.conf"
- "highpass_40hz_20db" "include/components/eqiir/highpass_40hz_20db_48khz.conf"
- }
- }
- num_input_audio_formats 1
- num_output_audio_formats 1
- IncludeByKey.NUM_DMICS {
- "1" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 1
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_MONO
- in_ch_map $CHANNEL_MAP_MONO
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 1
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_MONO
- out_ch_map $CHANNEL_MAP_MONO
- }
- ]
- }
- "2" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_bit_depth 32
- in_valid_bit_depth 32
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_bit_depth 32
- out_valid_bit_depth 32
- }
- ]
- }
- "4" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 4
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- in_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 4
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- out_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- }
- }
- }
+
- Object.Widget.gain.1 {
- curve_duration 500000
- num_input_audio_formats 2
- num_output_audio_formats 2
- num_input_audio_formats 1
- num_output_audio_formats 1
- IncludeByKey.NUM_DMICS {
- "1" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 1
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_MONO
- in_ch_map $CHANNEL_MAP_MONO
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 1
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_MONO
- out_ch_map $CHANNEL_MAP_MONO
- }
- ]
- }
- "2" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_bit_depth 32
- in_valid_bit_depth 32
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_bit_depth 32
- out_valid_bit_depth 32
- }
- ]
+ Object.Widget.pipeline."1" {
+ core $DMIC_CORE_ID
+ priority $DMIC_PIPELINE_PRIORITY
}
- "4" {
- Object.Base.input_audio_format [
- {
- in_rate $DMIC0_RATE
- in_channels 4
- in_bit_depth 32
- in_valid_bit_depth 32
- in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- in_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- Object.Base.output_audio_format [
- {
- out_rate $DMIC0_RATE
- out_channels 4
- out_bit_depth 32
- out_valid_bit_depth 32
- out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
- out_ch_map $CHANNEL_MAP_3_POINT_1
- }
- ]
- }
- }
- Object.Control.mixer.1 {
- name 'Dmic0 Capture Volume'
}
- Object.Control.mixer.2 {
- name 'Dmic0 Capture Switch'
+ ]
+ }
+ "multi" {
+ Object.Pipeline.dai-copier-gain-module-copier-capture [
+ {
+ index $DMIC0_DAI_PIPELINE_ID
+ core_id $DMIC_CORE_ID
- mute_led_use 1
- mute_led_direction 1
- }
- }
+
+
- Object.Widget.pipeline."1" {
- core $DMIC_CORE_ID
- priority $DMIC_PIPELINE_PRIORITY
+ Object.Widget.pipeline."1" {
+ core $DMIC_CORE_ID
+ priority $DMIC_PIPELINE_PRIORITY
+ }
+ }
+ ]
+
+ Object.Widget.eqiir.1 {
+ index $DMIC0_HOST_PIPELINE_ID
+
}
}
- ]
+ }
IncludeByKey.DMIC0_ENHANCED_CAPTURE {
"true" {
@@ -825,38 +521,86 @@ IncludeByKey.PASSTHROUGH {
}
}
- IncludeByKey.DMIC0_ENHANCED_CAPTURE {
- "true" {
- Object.Base.route [
- {
- source $DMIC0_DAI_COPIER
- sink gain.$DMIC0_DAI_PIPELINE_ID.1
- }
- {
- source $DMIC0_DAI_PIPELINE_SRC
- sink tdfb.$DMIC0_HOST_PIPELINE_ID.1
- }
- {
- source tdfb.$DMIC0_HOST_PIPELINE_ID.1
- sink drc.$DMIC0_HOST_PIPELINE_ID.1
+ IncludeByKey.INCLUDE_WOV {
+ "(false|true)" {
+ IncludeByKey.DMIC0_ENHANCED_CAPTURE {
+ "true" {
+ Object.Base.route [
+ {
+ source $DMIC0_DAI_COPIER
+ sink gain.$DMIC0_DAI_PIPELINE_ID.1
+ }
+ {
+ source $DMIC0_DAI_PIPELINE_SRC
+ sink tdfb.$DMIC0_HOST_PIPELINE_ID.1
+ }
+ {
+ source tdfb.$DMIC0_HOST_PIPELINE_ID.1
+ sink drc.$DMIC0_HOST_PIPELINE_ID.1
+ }
+ {
+ source drc.$DMIC0_HOST_PIPELINE_ID.1
+ sink $DMIC0_HOST_PIPELINE_SINK
+ }
+ ]
}
- {
- source drc.$DMIC0_HOST_PIPELINE_ID.1
- sink $DMIC0_HOST_PIPELINE_SINK
+ "false" {
+ Object.Base.route [
+ {
+ source $DMIC0_DAI_COPIER
+ sink gain.$DMIC0_DAI_PIPELINE_ID.1
+ }
+ {
+ source $DMIC0_DAI_PIPELINE_SRC
+ sink $DMIC0_HOST_PIPELINE_SINK
+ }
+ ]
}
- ]
+ }
}
- "false" {
- Object.Base.route [
- {
- source $DMIC0_DAI_COPIER
- sink gain.$DMIC0_DAI_PIPELINE_ID.1
+ "multi" {
+ IncludeByKey.DMIC0_ENHANCED_CAPTURE {
+ "true" {
+ Object.Base.route [
+ {
+ source $DMIC0_DAI_COPIER
+ sink gain.$DMIC0_DAI_PIPELINE_ID.1
+ }
+ {
+ source $DMIC0_DAI_PIPELINE_SRC
+ sink eqiir.$DMIC0_HOST_PIPELINE_ID.1
+ }
+ {
+ source eqiir.$DMIC0_HOST_PIPELINE_ID.1
+ sink tdfb.$DMIC0_HOST_PIPELINE_ID.1
+ }
+ {
+ source tdfb.$DMIC0_HOST_PIPELINE_ID.1
+ sink drc.$DMIC0_HOST_PIPELINE_ID.1
+ }
+ {
+ source drc.$DMIC0_HOST_PIPELINE_ID.1
+ sink $DMIC0_HOST_PIPELINE_SINK
+ }
+ ]
}
- {
- source $DMIC0_DAI_PIPELINE_SRC
- sink $DMIC0_HOST_PIPELINE_SINK
+ "false" {
+ Object.Base.route [
+ {
+ source $DMIC0_DAI_COPIER
+ sink gain.$DMIC0_DAI_PIPELINE_ID.1
+ }
+ {
+ source $DMIC0_DAI_PIPELINE_SRC
+ sink eqiir.$DMIC0_HOST_PIPELINE_ID.1
+ }
+ {
+ source eqiir.$DMIC0_HOST_PIPELINE_ID.1
+ sink $DMIC0_HOST_PIPELINE_SINK
+ }
+ ]
}
- ]
+ }
}
}
}
diff --git a/tools/topology/topology2/platform/intel/dmic-wov-multi.conf b/tools/topology/topology2/platform/intel/dmic-wov-multi.conf
index 73c436db7c96..b7757cdc1a19 100644
--- a/tools/topology/topology2/platform/intel/dmic-wov-multi.conf
+++ b/tools/topology/topology2/platform/intel/dmic-wov-multi.conf
@@ -2,10 +2,17 @@
# Multi-Slot Wake-on-Voice (WoV) feature module with PDM DMIC input.
#
# Hardware PDM DMIC (16kHz 2/4ch) + speaker echo reference (16kHz stereo) ->
-# 20ms DP ECNS -> 2000ms dual-sink KPB -> Mixin fanout to 3 concurrent MWW
-# detector slots (MFCC + MicroWakeWord) -> 4-pin WOV Arbiter -> Host Copier
-# PCM 12 (D0i3-compatible). The 48kHz DMIC dmic01 is captured with the
-# regular DMIC0 pipelines of dmic-generic.conf.
+# 20ms DP ECNS -> module-copier fanout -> 2000ms dual-sink KPB -> Mixin fanout
+# to 3 concurrent MWW detector slots (MFCC + MicroWakeWord) -> 4-pin WOV
+# Arbiter -> Host Copier PCM 12 (D0i3-compatible). The ECNS fanout copier also
+# feeds the processed 16kHz mono microphone to Host Copier PCM 11. The 48kHz
+# DMIC dmic01 is captured with the regular DMIC0 pipelines of dmic-generic.conf
+# to the raw PCM. A second 48kHz ECNS branches from the DMIC0 DAI pipeline
+# module-copier, before the raw PCM IIR, and takes the 48kHz echo reference from
+# the module-copier after the siggen. Its mono output is captured with Host
+# Copier PCM 15 for VoIP. The DMIC0 rate must be 48kHz. Optionally a 48kHz
+# headset ECNS with the jack echo reference is captured with Host Copier
+# PCM 13, see sdw-jack-ecns.conf.
#
# The includer must route the speaker echo reference into
# siggen.$WOV_ECHO_REF_PIPELINE_ID.1 and provide a dai_out widget upstream of
@@ -84,6 +91,14 @@ Define {
DMIC_WOV_PCM_ID 12
DMIC_WOV_PCM_CAPS "Gain Capture 12"
DMIC_WOV_FORMAT "s16le"
+ # The ECNS PCM stream names must not be "Gain Capture N", the includers use
+ # those for the DMIC Raw PCM, e.g. "Gain Capture 13" in cavs-rt5682.conf.
+ DMIC_ECNS_PCM_ID 11
+ DMIC_ECNS_PCM_CAPS "ECNS Capture 11"
+ DMIC_ECNS_PCM_NAME "DMIC16k ECNS"
+ DMIC0_ECNS_PCM_ID 15
+ DMIC0_ECNS_PCM_CAPS "ECNS Capture 15"
+ DMIC0_ECNS_PCM_NAME "DMIC48k ECNS"
KWD_CPC 100000
WOV_ARB_CPC 20000
@@ -95,9 +110,14 @@ Define {
WOV_ARB_PIPELINE_ID 114
WOV_ECNS_PIPELINE_ID 115
WOV_KPB_PIPELINE_ID 116
+ WOV_ECNS_OUT_PIPELINE_ID 117
WOV_MIXIN_PIPELINE_ID 118
WOV_DAI16K_PIPELINE_ID 119
WOV_ECHO_REF_PIPELINE_ID 120
+ WOV_ECNS_HOST_PIPELINE_ID 121
+ DMIC0_ECNS_PIPELINE_ID 122
+ DMIC0_ECNS_HOST_PIPELINE_ID 123
+ WOV_ECHO_REF_SRC_PIPELINE_ID 124
WOV_CORE_ID 0
WOV_SLOT2_CORE_ID 0
@@ -105,6 +125,9 @@ Define {
# Default for non-SoundWire includers (e.g. cavs-rt5682.conf); the
# headset WoV instance is enabled per target with INCLUDE_SDW_JACK_WOV=true.
INCLUDE_SDW_JACK_WOV "false"
+ # The 48 kHz headset ECNS is enabled per target with
+ # INCLUDE_SDW_JACK_ECNS=true.
+ INCLUDE_SDW_JACK_ECNS "false"
# 16k detection-path channel count into ECNS pin0. Overridden
# to 4ch by IncludeByKey.DMIC_WOV_DAI_CHANNELS below so ECNS can select
@@ -114,9 +137,36 @@ Define {
DET16K_CH_CFG 1
DET16K_CH_MAP 0xFFFFFF10
ECNS_PIN0_IBS 2560
+ # 20 ms of 16 kHz 2ch s32 for the extra 2ch pin 0 format with 4ch
+ # microphones
+ ECNS_PIN0_2CH_IBS 2560
# 16 kHz stereo 32-bit echo reference into ECNS pin 1, 20 ms
ECNS_REF_IBS 2560
+
+ # 48 kHz ECNS: 20 ms of 2ch s32 microphones and echo reference, and of the
+ # s32 output. The output and PCM 15 have the DMIC0 DAI channel count.
+ # Overridden for 4ch microphones by IncludeByKey.NUM_DMICS.
+ ECNS48_PIN0_IBS 7680
+ # 20 ms of 2ch s32 for the extra 2ch pin 0 format with 4ch microphones
+ ECNS48_PIN0_2CH_IBS 7680
+ ECNS48_REF_IBS 7680
+ ECNS48_OBS 7680
+ ECNS48_CHANNELS 2
+ ECNS48_CH_CFG 1
+ ECNS48_CH_MAP 0xFFFFFF10
+}
+
+IncludeByKey.NUM_DMICS {
+ "4" {
+ Define {
+ ECNS48_PIN0_IBS 15360
+ ECNS48_OBS 15360
+ ECNS48_CHANNELS 4
+ ECNS48_CH_CFG 4
+ ECNS48_CH_MAP 0xFFFF3210
+ }
+ }
}
IncludeByKey.DMIC_WOV_DAI_CHANNELS {
@@ -230,8 +280,8 @@ Object.Pipeline."custom-capture" [
# ---------------------------------------------------------------------------
# Pipeline 115 — ECNS DP Pipeline (Core 0, 20ms DP, lp_mode 1)
# DAI-Copier dmic16k (pipeline 119, 16k) -> ECNS.115.1 Pin 0
-# Echo reference src.120.1 (pipeline 120, 16k stereo) -> ECNS.115.1 Pin 1
-# Pin 0 out: mono (16k) -> KPB.116.1
+# Echo reference src.124.1 (pipeline 124, 16k stereo) -> ECNS.115.1 Pin 1
+# Pin 0 out: mono (16k) -> module-copier.117.1
# ---------------------------------------------------------------------------
Object.Pipeline."custom-dp-capture" [
{
@@ -259,7 +309,7 @@ Object.Pipeline."custom-dp-capture" [
input_pin_binding_name "dai-copier.DMIC.$DMIC16K_DAI_NAME.capture"
}
Object.Base.input_pin_binding.2 {
- input_pin_binding_name "src.$WOV_ECHO_REF_PIPELINE_ID.1"
+ input_pin_binding_name "src.$WOV_ECHO_REF_SRC_PIPELINE_ID.1"
}
# The kernel matches the params of the first walked path against
@@ -326,7 +376,7 @@ Object.Pipeline."custom-dp-capture" [
in_ch_map $CHANNEL_MAP_STEREO
in_bit_depth 32
in_valid_bit_depth 32
- ibs $ECNS_PIN0_IBS
+ ibs $ECNS_PIN0_2CH_IBS
}
# Pin 1: 16 kHz stereo echo reference
{
@@ -343,8 +393,8 @@ Object.Pipeline."custom-dp-capture" [
}
}
- # Output: mono to KPB, the firmware follows the KPB input
- # format bit depth (16 or 32)
+ # Output: mono to the fanout copier, the firmware follows the
+ # sink format bit depth (16 or 32)
Object.Base.output_audio_format [
{
output_pin_index 0
@@ -359,7 +409,7 @@ Object.Pipeline."custom-dp-capture" [
]
Object.Base.output_pin_binding.1 {
- output_pin_binding_name "kpb.116.1"
+ output_pin_binding_name "module-copier.$WOV_ECNS_OUT_PIPELINE_ID.1"
}
}
@@ -374,9 +424,9 @@ Object.Pipeline."custom-dp-capture" [
# ---------------------------------------------------------------------------
# Pipeline 120 — Speaker echo reference for ECNS (Core 0, LL 1ms)
# siggen.120.1 (48k stereo, silence when the speaker is not running) ->
-# src.120.1 (48k -> 16k stereo) -> ECNS.115.1 Pin 1
+# module-copier.120.2 -> src.124.1 (pipeline 124) and ECNS.122.1 Pin 1
# ---------------------------------------------------------------------------
-Object.Pipeline."siggen-src-capture" [
+Object.Pipeline."siggen-copier-capture" [
{
index $WOV_ECHO_REF_PIPELINE_ID
@@ -386,9 +436,388 @@ Object.Pipeline."siggen-src-capture" [
}
]
+# ---------------------------------------------------------------------------
+# Pipeline 124 — 16 kHz speaker echo reference for ECNS.115.1 (Core 0, LL 1ms)
+# module-copier.120.2 (48k stereo) -> src.124.1 (48k -> 16k stereo) ->
+# ECNS.115.1 Pin 1
+#
+# The SRC is in its own pipeline, because the kernel frees a widget when the
+# last PCM that uses it stops, but the firmware deletes the module only with
+# its pipeline. In pipeline 120, which keeps running for the 48 kHz ECNS, the
+# SRC would be left running without a sink after the 16 kHz ECNS is stopped,
+# and creating it again would fail.
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-capture" [
+ {
+ index $WOV_ECHO_REF_SRC_PIPELINE_ID
+ format "s32le"
+ rate 16000
+
+ Object.Widget.src.1 {
+ rate_in 48000
+ rate_out 16000
+ num_input_audio_formats 1
+ num_output_audio_formats 1
+ Object.Base.input_audio_format [
+ {
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate 16000
+ out_channels 2
+ out_ch_cfg $CHANNEL_CONFIG_STEREO
+ out_ch_map $CHANNEL_MAP_STEREO
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 0
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Pipeline 122 — 48 kHz ECNS DP Pipeline (Core 0, 20ms DP, lp_mode 1)
+# DMIC0 DAI pipeline module-copier (48k 2/4ch) -> ECNS.122.1 Pin 0
+# Echo reference module-copier.120.2 (48k stereo) -> ECNS.122.1 Pin 1
+# Pin 0 out: 2/4ch as DMIC0 (48k s32) -> host-copier PCM 15 (pipeline 123)
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-dp-capture" [
+ {
+ index $DMIC0_ECNS_PIPELINE_ID
+ format "s32le"
+ rate 48000
+
+ Object.Widget.ecns.1 {
+ uuid $ECNS_UUID
+ num_input_pins 2
+ num_output_pins 1
+ num_output_audio_formats 1
+
+ Object.Control.mixer."1" {
+ name "DMIC0 ECNS boost"
+ }
+ Object.Control.mixer."2" {
+ name "DMIC0 ECNS AEC switch"
+ }
+ Object.Control.mixer."3" {
+ name "DMIC0 ECNS NS switch"
+ }
+
+ Object.Base.input_pin_binding.1 {
+ input_pin_binding_name $DMIC0_DAI_PIPELINE_SRC
+ }
+ Object.Base.input_pin_binding.2 {
+ input_pin_binding_name "module-copier.$WOV_ECHO_REF_PIPELINE_ID.2"
+ }
+
+ # As for ecns.115.1, with 4ch mics pin 0 lists also the 2ch
+ # format of the echo reference walk.
+ IncludeByKey.NUM_DMICS {
+ "2" {
+ Object.Control.enum."1" {
+ name "DMIC0 ECNS mic channel"
+
+ }
+ num_input_audio_formats 2
+ Object.Base.input_audio_format [
+ # Pin 0: 48 kHz microphones from dmic01
+ {
+ input_pin_index 0
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $ECNS48_PIN0_IBS
+ }
+ # Pin 1: 48 kHz stereo echo reference
+ {
+ input_pin_index 1
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $ECNS48_REF_IBS
+ }
+ ]
+ }
+ "4" {
+ Object.Control.enum."1" {
+ name "DMIC0 ECNS mic channel"
+
+ }
+ num_input_audio_formats 3
+ Object.Base.input_audio_format [
+ # Pin 0: 48 kHz microphones from dmic01
+ {
+ input_pin_index 0
+ in_rate 48000
+ in_channels 4
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $ECNS48_PIN0_IBS
+ }
+ # Pin 0: params from the echo reference walk
+ {
+ input_pin_index 0
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $ECNS48_PIN0_2CH_IBS
+ }
+ # Pin 1: 48 kHz stereo echo reference
+ {
+ input_pin_index 1
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $ECNS48_REF_IBS
+ }
+ ]
+ }
+ }
+
+ # Output: s32 with the DMIC0 channel count to the host
+ # copier, the firmware follows the sink format channels
+ # and bit depth
+ Object.Base.output_audio_format [
+ {
+ output_pin_index 0
+ out_rate 48000
+ out_channels $ECNS48_CHANNELS
+ out_ch_cfg $ECNS48_CH_CFG
+ out_ch_map $ECNS48_CH_MAP
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ obs $ECNS48_OBS
+ }
+ ]
+
+ Object.Base.output_pin_binding.1 {
+ output_pin_binding_name "host-copier.$DMIC0_ECNS_PCM_ID.capture"
+ }
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 1
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Pipeline 123 — Host Copier 15 (Core 0, LL 1ms)
+# ECNS.122.1 (48k 2/4ch s32) -> host-copier PCM 15 (S16_LE or S32_LE)
+# The host copier has its own pipeline as PCM 11, see pipeline 121.
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-capture" [
+ {
+ index $DMIC0_ECNS_HOST_PIPELINE_ID
+ format "s32le"
+ rate 48000
+
+ Object.Widget.host-copier.1 {
+ stream_name $DMIC0_ECNS_PCM_CAPS
+ pcm_id $DMIC0_ECNS_PCM_ID
+ node_type $HDA_HOST_INPUT_CLASS
+ direction "capture"
+ type "aif_out"
+ num_input_pins 1
+
+ num_input_audio_formats 1
+ Object.Base.input_audio_format [
+ {
+ in_rate 48000
+ in_channels $ECNS48_CHANNELS
+ in_ch_cfg $ECNS48_CH_CFG
+ in_ch_map $ECNS48_CH_MAP
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+
+ num_output_audio_formats 2
+ Object.Base.output_audio_format [
+ {
+ out_rate 48000
+ out_channels $ECNS48_CHANNELS
+ out_ch_cfg $ECNS48_CH_CFG
+ out_ch_map $ECNS48_CH_MAP
+ out_bit_depth 16
+ out_valid_bit_depth 16
+ }
+ {
+ out_rate 48000
+ out_channels $ECNS48_CHANNELS
+ out_ch_cfg $ECNS48_CH_CFG
+ out_ch_map $ECNS48_CH_MAP
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 0
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Pipeline 117 — ECNS output fanout (Core 0, LL 1ms)
+# ECNS.115.1 (16k mono) -> module-copier.117.1
+# Pin 0 -> KPB.116.1 (cross-pipeline, WoV detection path)
+# Pin 1 -> host-copier.11 (pipeline 121, processed microphone capture)
+# The copier is in its own pipeline instead of KPB's so that PCM 11 can run
+# without setting up the KPB, and so that its LL walk starts from it: a second
+# source widget in pipeline 116 would never be copied.
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-capture" [
+ {
+ index $WOV_ECNS_OUT_PIPELINE_ID
+ format $DMIC_WOV_FORMAT
+ rate 16000
+
+ Object.Widget.module-copier.1 {
+ num_input_pins 1
+ num_output_pins 2
+ num_input_audio_formats 1
+ num_output_audio_formats 2
+
+ Object.Base.input_audio_format [
+ {
+ in_rate 16000
+ in_channels 1
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ in_bit_depth 16
+ in_valid_bit_depth 16
+ }
+ ]
+ Object.Base.output_audio_format [
+ # Pin 0: to the KPB
+ {
+ output_pin_index 0
+ out_rate 16000
+ out_channels 1
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ out_bit_depth 16
+ out_valid_bit_depth 16
+ }
+ # Pin 1: to the PCM 11 host copier
+ {
+ output_pin_index 1
+ out_rate 16000
+ out_channels 1
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ out_bit_depth 16
+ out_valid_bit_depth 16
+ }
+ ]
+
+ Object.Base.output_pin_binding.1 {
+ output_pin_binding_name "kpb.$WOV_KPB_PIPELINE_ID.1"
+ }
+ Object.Base.output_pin_binding.2 {
+ output_pin_binding_name "host-copier.$DMIC_ECNS_PCM_ID.capture"
+ }
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 0
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Pipeline 121 — Host Copier 13 (Core 0, LL 1ms)
+# module-copier.117.1 Pin 1 -> host-copier PCM 11
+# The host copier must not be in a pipeline shared with the WoV PCM 12. When
+# PCM 11 is started while PCM 12 runs, the kernel does not trigger the already
+# running pipelines, so a host copier added into one of them would never be
+# started and stopping PCM 11 would fail in firmware.
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-capture" [
+ {
+ index $WOV_ECNS_HOST_PIPELINE_ID
+ format $DMIC_WOV_FORMAT
+ rate 16000
+
+ Object.Widget.host-copier.1 {
+ stream_name $DMIC_ECNS_PCM_CAPS
+ pcm_id $DMIC_ECNS_PCM_ID
+ node_type $HDA_HOST_INPUT_CLASS
+ direction "capture"
+ type "aif_out"
+ num_input_pins 1
+
+ num_input_audio_formats 1
+ Object.Base.input_audio_format [
+ {
+ in_rate 16000
+ in_channels 1
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ in_bit_depth 16
+ in_valid_bit_depth 16
+ }
+ ]
+
+ num_output_audio_formats 1
+ Object.Base.output_audio_format [
+ {
+ out_rate 16000
+ out_channels 1
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ out_bit_depth 16
+ out_valid_bit_depth 16
+ }
+ ]
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 0
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
# ---------------------------------------------------------------------------
# Pipeline 116 — KPB (Core 0, LL 1ms)
-# ECNS.115.1 Pin 0 (1ch mono clean) -> KPB.116.1 (2000ms). KPB sel_sink feeds
+# module-copier.117.1 Pin 0 (1ch mono clean) -> KPB.116.1 (2000ms). KPB sel_sink feeds
# module-copier.118.1 and host_sink feed wov-arbiter.114.1, both cross-pipeline.
# ---------------------------------------------------------------------------
Object.Pipeline."custom-capture" [
@@ -1085,13 +1514,16 @@ Object.Pipeline."custom-capture" [
# ---------------------------------------------------------------------------
Object.Base.route [
# Speaker echo reference (16k stereo) to ECNS Pin 1
- { source "src.$WOV_ECHO_REF_PIPELINE_ID.1" sink "ecns.115.1" }
+ { source "module-copier.$WOV_ECHO_REF_PIPELINE_ID.2" sink "src.$WOV_ECHO_REF_SRC_PIPELINE_ID.1" }
+ { source "src.$WOV_ECHO_REF_SRC_PIPELINE_ID.1" sink "ecns.115.1" }
# DMIC 16k (dmic16k) capture to ECNS Pin 0 (16k)
{ source "dai-copier.DMIC.$DMIC16K_DAI_NAME.capture" sink "ecns.115.1" }
- # ECNS Output Pin 0 (16k mono) direct to KPB
- { source "ecns.115.1" sink "kpb.116.1" }
+ # ECNS Output Pin 0 (16k mono) to the fanout copier, then to KPB and PCM 11
+ { source "ecns.115.1" sink "module-copier.$WOV_ECNS_OUT_PIPELINE_ID.1" }
+ { source "module-copier.$WOV_ECNS_OUT_PIPELINE_ID.1" sink "kpb.116.1" }
+ { source "module-copier.$WOV_ECNS_OUT_PIPELINE_ID.1" sink "host-copier.$DMIC_ECNS_PCM_ID.capture" }
{ source "kpb.116.1" sink "module-copier.118.1" }
# Audio path from KPB host_sink (pin 1) to WOV Arbiter audio input (pin 0)
@@ -1105,6 +1537,12 @@ Object.Base.route [
# WOV Arbiter output to Host Copier 12
{ source "wov-arbiter.114.1" sink "host-copier.$DMIC_WOV_PCM_ID.capture" }
+
+ # 48 kHz ECNS: DMIC0 microphones to Pin 0, echo reference to Pin 1,
+ # output to Host Copier 15
+ { source $DMIC0_DAI_PIPELINE_SRC sink "ecns.$DMIC0_ECNS_PIPELINE_ID.1" }
+ { source "module-copier.$WOV_ECHO_REF_PIPELINE_ID.2" sink "ecns.$DMIC0_ECNS_PIPELINE_ID.1" }
+ { source "ecns.$DMIC0_ECNS_PIPELINE_ID.1" sink "host-copier.$DMIC0_ECNS_PCM_ID.capture" }
]
IncludeByKey.WOV_SLOT_COUNT {
@@ -1129,10 +1567,46 @@ IncludeByKey.WOV_SLOT_COUNT {
# ---------------------------------------------------------------------------
# PCM Definitions:
# PCM 12: WOV Arbiter Mono Capture (16 kHz)
+# PCM 11: ECNS processed microphone Mono Capture (16 kHz)
+# PCM 15: 48 kHz ECNS processed microphone 2/4ch Capture for VoIP
# ---------------------------------------------------------------------------
Object.PCM.pcm [
{
- name "DMIC Multi-WOV"
+ name "$DMIC0_ECNS_PCM_NAME"
+ id $DMIC0_ECNS_PCM_ID
+ direction "capture"
+
+ Object.Base.fe_dai.1 {
+ name "$DMIC0_ECNS_PCM_CAPS"
+ }
+
+ Object.PCM.pcm_caps.1 {
+ name "$DMIC0_ECNS_PCM_CAPS"
+ formats "S16_LE,S32_LE"
+ rates "48000"
+ channels_min $ECNS48_CHANNELS
+ channels_max $ECNS48_CHANNELS
+ }
+ }
+ {
+ name "$DMIC_ECNS_PCM_NAME"
+ id $DMIC_ECNS_PCM_ID
+ direction "capture"
+
+ Object.Base.fe_dai.1 {
+ name "$DMIC_ECNS_PCM_CAPS"
+ }
+
+ Object.PCM.pcm_caps.1 {
+ name "$DMIC_ECNS_PCM_CAPS"
+ formats "S16_LE"
+ rates "16000"
+ channels_min 1
+ channels_max 1
+ }
+ }
+ {
+ name "DMIC WOV"
id $DMIC_WOV_PCM_ID
direction "capture"
capture_compatible_d0i3 true
@@ -1151,8 +1625,15 @@ Object.PCM.pcm [
}
]
-# Optional second WoV instance on the SoundWire headset mic (PCMs 13/14).
+# Optional second WoV instance on the SoundWire headset mic (PCM 14).
# Included here because it reuses the pipeline classes and UUIDs above.
IncludeByKey.INCLUDE_SDW_JACK_WOV {
"true" "platform/intel/sdw-jack-wov-multi.conf"
}
+
+# Optional 48 kHz ECNS on the SoundWire headset mic with the jack echo
+# reference (PCM 13). Included here because it reuses the pipeline classes and
+# UUIDs above.
+IncludeByKey.INCLUDE_SDW_JACK_ECNS {
+ "true" "platform/intel/sdw-jack-ecns.conf"
+}
diff --git a/tools/topology/topology2/platform/intel/dmic0-dai-copier-widgets.conf b/tools/topology/topology2/platform/intel/dmic0-dai-copier-widgets.conf
new file mode 100644
index 000000000000..76b6d669b072
--- /dev/null
+++ b/tools/topology/topology2/platform/intel/dmic0-dai-copier-widgets.conf
@@ -0,0 +1,187 @@
+# Included by platform/intel/dmic-generic.conf in the DMIC0 DAI capture
+# pipeline object. DAI copier and module-copier widgets.
+Object.Widget.dai-copier.1 {
+ dai_index 0
+ dai_type "DMIC"
+ copier_type "DMIC"
+ type dai_out
+ stream_name $DMIC0_NAME
+ node_type $DMIC_LINK_INPUT_CLASS
+ num_input_audio_formats 3
+ num_output_audio_formats 1
+ IncludeByKey.NUM_DMICS {
+ "1" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 1
+ in_bit_depth 16
+ in_valid_bit_depth 16
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ }
+ {
+ in_rate $DMIC0_RATE
+ in_channels 1
+ in_bit_depth 32
+ in_valid_bit_depth 24
+ in_sample_type $SAMPLE_TYPE_MSB_INTEGER
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ }
+ {
+ in_rate $DMIC0_RATE
+ in_channels 1
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 1
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ }
+ "2" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_bit_depth 16
+ in_valid_bit_depth 16
+ }
+ {
+ in_rate $DMIC0_RATE
+ in_bit_depth 32
+ in_valid_bit_depth 24
+ in_sample_type $SAMPLE_TYPE_MSB_INTEGER
+ }
+ {
+ in_rate $DMIC0_RATE
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+ "4" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 4
+ in_bit_depth 16
+ in_valid_bit_depth 16
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ {
+ in_rate $DMIC0_RATE
+ in_channels 4
+ in_bit_depth 32
+ in_valid_bit_depth 24
+ in_sample_type $SAMPLE_TYPE_MSB_INTEGER
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ {
+ in_rate $DMIC0_RATE
+ in_channels 4
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 4
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ out_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ }
+ }
+}
+
+Object.Widget.module-copier."2" {
+ stream_name $DMIC0_NAME
+ num_input_audio_formats 1
+ num_output_audio_formats 1
+ IncludeByKey.NUM_DMICS {
+ "1" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 1
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 1
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ }
+ "2" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+ "4" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 4
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 4
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ out_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ }
+ }
+}
diff --git a/tools/topology/topology2/platform/intel/dmic0-eqiir-widget.conf b/tools/topology/topology2/platform/intel/dmic0-eqiir-widget.conf
new file mode 100644
index 000000000000..213def9f7a8e
--- /dev/null
+++ b/tools/topology/topology2/platform/intel/dmic0-eqiir-widget.conf
@@ -0,0 +1,75 @@
+# Included by platform/intel/dmic-generic.conf as the content of the DMIC0
+# IIR widget. The widget is in the DMIC0 DAI capture pipeline, or with
+# INCLUDE_WOV=multi in the DMIC0 host pipeline.
+Object.Control.bytes."1" {
+ name 'DMIC0 Capture IIR Eq'
+ IncludeByKey.DMIC0_DAI_EQIIR {
+ "passthrough" "include/components/eqiir/passthrough.conf"
+ "highpass_40hz_0db" "include/components/eqiir/highpass_40hz_0db_48khz.conf"
+ "highpass_40hz_20db" "include/components/eqiir/highpass_40hz_20db_48khz.conf"
+ }
+}
+num_input_audio_formats 1
+num_output_audio_formats 1
+IncludeByKey.NUM_DMICS {
+ "1" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 1
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 1
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ }
+ "2" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+ "4" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 4
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 4
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ out_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ }
+}
diff --git a/tools/topology/topology2/platform/intel/dmic0-gain-widget.conf b/tools/topology/topology2/platform/intel/dmic0-gain-widget.conf
new file mode 100644
index 000000000000..fde44f2f61a4
--- /dev/null
+++ b/tools/topology/topology2/platform/intel/dmic0-gain-widget.conf
@@ -0,0 +1,80 @@
+# Included by platform/intel/dmic-generic.conf in the DMIC0 DAI capture
+# pipeline object. Gain widget with the Dmic0 volume and switch controls.
+Object.Widget.gain.1 {
+ curve_duration 500000
+ num_input_audio_formats 2
+ num_output_audio_formats 2
+ num_input_audio_formats 1
+ num_output_audio_formats 1
+ IncludeByKey.NUM_DMICS {
+ "1" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 1
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_MONO
+ in_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 1
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_MONO
+ out_ch_map $CHANNEL_MAP_MONO
+ }
+ ]
+ }
+ "2" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+ "4" {
+ Object.Base.input_audio_format [
+ {
+ in_rate $DMIC0_RATE
+ in_channels 4
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ in_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_rate $DMIC0_RATE
+ out_channels 4
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
+ out_ch_map $CHANNEL_MAP_3_POINT_1
+ }
+ ]
+ }
+ }
+ Object.Control.mixer.1 {
+ name 'Dmic0 Capture Volume'
+ }
+ Object.Control.mixer.2 {
+ name 'Dmic0 Capture Switch'
+
+ mute_led_use 1
+ mute_led_direction 1
+ }
+}
diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf
index 02d187bfd9a7..199c7470ee70 100644
--- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf
+++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf
@@ -784,16 +784,70 @@ IncludeByKey.PASSTHROUGH {
}
}
"false" {
- Object.Base.route [
- {
- source "gain.21.1"
- sink "module-copier.21.22"
+ # Optional IIR, e.g. a high-pass to protect the speaker,
+ # without the FIR and DRC of the enhanced playback. The
+ # coefficients and the control name are the same as with
+ # the enhanced playback. The instance is "2" because a
+ # top-level eqiir."1" object, e.g. the DMIC0 host IIR,
+ # would be merged with it.
+ IncludeByKey.SDW_SPK_BASIC_PLAYBACK_IIR {
+ "true" {
+ Object.Widget.eqiir."2" {
+ index 21
+ num_input_audio_formats 1
+ num_output_audio_formats 1
+ Object.Base.input_audio_format [
+ {
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ Object.Base.output_audio_format [
+ {
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ Object.Control.bytes."1" {
+ name 'Post Mixer $AMP_PLAYBACK_NAME IIR Eq bytes'
+ IncludeByKey.EFX_SPK_IIR_PARAMS {
+ "passthrough" "include/components/eqiir/passthrough.conf"
+ "highpass_20hz_0db_48khz" "include/components/eqiir/highpass_20hz_0db_48khz.conf"
+ "highpass_30hz_0db_48khz" "include/components/eqiir/highpass_30hz_0db_48khz.conf"
+ "highpass_40hz_0db_48khz" "include/components/eqiir/highpass_40hz_0db_48khz.conf"
+ "highpass_50hz_0db_48khz" "include/components/eqiir/highpass_50hz_0db_48khz.conf"
+ "highpass_100hz_0db_48khz" "include/components/eqiir/highpass_100hz_0db_48khz.conf"
+ }
+ }
+ }
+ Object.Base.route [
+ {
+ source "gain.21.1"
+ sink "eqiir.21.2"
+ }
+ {
+ source "eqiir.21.2"
+ sink "module-copier.21.22"
+ }
+ {
+ source "module-copier.21.22"
+ sink "alh-copier.$SDW_SPK_STREAM.0"
+ }
+ ]
}
- {
- source "module-copier.21.22"
- sink "alh-copier.$SDW_SPK_STREAM.0"
+ "false" {
+ Object.Base.route [
+ {
+ source "gain.21.1"
+ sink "module-copier.21.22"
+ }
+ {
+ source "module-copier.21.22"
+ sink "alh-copier.$SDW_SPK_STREAM.0"
+ }
+ ]
}
- ]
+ }
}
}
Object.Base.route [
diff --git a/tools/topology/topology2/platform/intel/sdw-jack-ecns.conf b/tools/topology/topology2/platform/intel/sdw-jack-ecns.conf
new file mode 100644
index 000000000000..a719189c426b
--- /dev/null
+++ b/tools/topology/topology2/platform/intel/sdw-jack-ecns.conf
@@ -0,0 +1,258 @@
+#
+# 48 kHz ECNS for the SoundWire headset microphone.
+#
+# module-copier.11.0 (Jack In, 48 kHz 2ch 32-bit) -> ecns.151.1 Pin 0
+# module-copier.1.12 (Jack Out) -> siggen.150.1 (48 kHz stereo, silence
+# when the jack playback is not running) -> ecns.151.1 Pin 1
+# ecns.151.1 (48 kHz 2ch s32) -> host-copier PCM 13 "Jack In ECNS"
+#
+# There is only one Loopback_Virtual DAI, alh-copier.Loopback_Virtual.25 of
+# cavs-sdw.conf. It is routed also to siggen.150.1 so that it is the dai_out
+# widget that starts the setup of the jack echo reference pipeline with the
+# PCM 13 capture, as it does for the speaker echo reference pipeline of
+# dmic-wov-multi.conf.
+#
+# Included from dmic-wov-multi.conf because it reuses the pipeline classes and
+# UUIDs defined there. Enabled with INCLUDE_WOV=multi and
+# INCLUDE_SDW_JACK_ECNS=true. Requires SDW_ECHO_REF_DAI=true, JACK_RATE 48000
+# and SDW_JACK_CAPTURE_CH 2.
+#
+
+Define {
+ SDW_JACK_ECNS_PCM_ID 13
+ SDW_JACK_ECNS_PCM_CAPS "ECNS Capture 13"
+ SDW_JACK_ECNS_PCM_NAME "Jack In ECNS"
+
+ SDW_JACK_ECNS_REF_PIPELINE_ID 150
+ SDW_JACK_ECNS_PIPELINE_ID 151
+ SDW_JACK_ECNS_HOST_PIPELINE_ID 152
+
+ # 20 ms of 48 kHz stereo s32 for the microphones, the echo reference
+ # and the output
+ SDW_JACK_ECNS_IBS 7680
+ SDW_JACK_ECNS_OBS 7680
+}
+
+# ---------------------------------------------------------------------------
+# Pipeline 150 — Jack echo reference (Core 0, LL 1ms)
+# module-copier.1.12 (Jack Out 48k stereo) and Loopback_Virtual.25 ->
+# siggen.150.1 (48k stereo s32) -> ECNS.151.1 Pin 1
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-capture" [
+ {
+ index $SDW_JACK_ECNS_REF_PIPELINE_ID
+ format "s32le"
+ rate 48000
+
+ # the 48 kHz stereo 32-bit output format is the siggen class default
+ Object.Widget.siggen.1 {
+ num_input_pins 1
+ num_output_pins 1
+ num_input_audio_formats 1
+ num_output_audio_formats 1
+ Object.Base.input_audio_format [
+ {
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 0
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Pipeline 151 — 48 kHz Jack ECNS DP Pipeline (Core 0, 20ms DP, lp_mode 1)
+# module-copier.11.0 (Jack In 48k 2ch) -> ECNS.151.1 Pin 0
+# siggen.150.1 (48k stereo) -> ECNS.151.1 Pin 1
+# Pin 0 out: 48k 2ch s32 -> host-copier PCM 13 (pipeline 152)
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-dp-capture" [
+ {
+ index $SDW_JACK_ECNS_PIPELINE_ID
+ format "s32le"
+ rate 48000
+
+ Object.Widget.ecns.1 {
+ uuid $ECNS_UUID
+ num_input_pins 2
+ num_output_pins 1
+ num_input_audio_formats 2
+ num_output_audio_formats 1
+
+ Object.Control.mixer."1" {
+ name "Jack ECNS boost"
+ }
+ Object.Control.mixer."2" {
+ name "Jack ECNS AEC switch"
+ }
+ Object.Control.mixer."3" {
+ name "Jack ECNS NS switch"
+ }
+ Object.Control.enum."1" {
+ name "Jack ECNS mic channel"
+
+ }
+
+ Object.Base.input_pin_binding.1 {
+ input_pin_binding_name "module-copier.11.0"
+ }
+ Object.Base.input_pin_binding.2 {
+ input_pin_binding_name "siggen.$SDW_JACK_ECNS_REF_PIPELINE_ID.1"
+ }
+
+ Object.Base.input_audio_format [
+ # Pin 0: 48 kHz headset microphone
+ {
+ input_pin_index 0
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $SDW_JACK_ECNS_IBS
+ }
+ # Pin 1: 48 kHz stereo jack echo reference
+ {
+ input_pin_index 1
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ ibs $SDW_JACK_ECNS_IBS
+ }
+ ]
+
+ # Output: stereo s32 to the host copier, the firmware follows
+ # the sink format channels and bit depth
+ Object.Base.output_audio_format [
+ {
+ output_pin_index 0
+ out_rate 48000
+ out_channels 2
+ out_ch_cfg $CHANNEL_CONFIG_STEREO
+ out_ch_map $CHANNEL_MAP_STEREO
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ obs $SDW_JACK_ECNS_OBS
+ }
+ ]
+
+ Object.Base.output_pin_binding.1 {
+ output_pin_binding_name "host-copier.$SDW_JACK_ECNS_PCM_ID.capture"
+ }
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 1
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Pipeline 152 — Host Copier 13 (Core 0, LL 1ms)
+# ECNS.151.1 (48k 2ch s32) -> host-copier PCM 13 (S16_LE or S32_LE)
+# ---------------------------------------------------------------------------
+Object.Pipeline."custom-capture" [
+ {
+ index $SDW_JACK_ECNS_HOST_PIPELINE_ID
+ format "s32le"
+ rate 48000
+
+ Object.Widget.host-copier.1 {
+ stream_name $SDW_JACK_ECNS_PCM_CAPS
+ pcm_id $SDW_JACK_ECNS_PCM_ID
+ node_type $HDA_HOST_INPUT_CLASS
+ direction "capture"
+ type "aif_out"
+ num_input_pins 1
+
+ num_input_audio_formats 1
+ Object.Base.input_audio_format [
+ {
+ in_rate 48000
+ in_channels 2
+ in_ch_cfg $CHANNEL_CONFIG_STEREO
+ in_ch_map $CHANNEL_MAP_STEREO
+ in_bit_depth 32
+ in_valid_bit_depth 32
+ }
+ ]
+
+ num_output_audio_formats 2
+ Object.Base.output_audio_format [
+ {
+ out_rate 48000
+ out_channels 2
+ out_ch_cfg $CHANNEL_CONFIG_STEREO
+ out_ch_map $CHANNEL_MAP_STEREO
+ out_bit_depth 16
+ out_valid_bit_depth 16
+ }
+ {
+ out_rate 48000
+ out_channels 2
+ out_ch_cfg $CHANNEL_CONFIG_STEREO
+ out_ch_map $CHANNEL_MAP_STEREO
+ out_bit_depth 32
+ out_valid_bit_depth 32
+ }
+ ]
+ }
+
+ Object.Widget.pipeline.1 {
+ priority 0
+ lp_mode 0
+ core_id $WOV_CORE_ID
+ }
+ }
+]
+
+# ---------------------------------------------------------------------------
+# Routes
+# ---------------------------------------------------------------------------
+Object.Base.route [
+ # Jack echo reference into the siggen, the Loopback_Virtual DAI starts
+ # the setup of the pipeline
+ { source "alh-copier.Loopback_Virtual.25" sink "siggen.$SDW_JACK_ECNS_REF_PIPELINE_ID.1" }
+ { source "module-copier.1.12" sink "siggen.$SDW_JACK_ECNS_REF_PIPELINE_ID.1" }
+
+ # Headset microphone to Pin 0, jack echo reference to Pin 1, output to
+ # Host Copier 13
+ { source "module-copier.11.0" sink "ecns.$SDW_JACK_ECNS_PIPELINE_ID.1" }
+ { source "siggen.$SDW_JACK_ECNS_REF_PIPELINE_ID.1" sink "ecns.$SDW_JACK_ECNS_PIPELINE_ID.1" }
+ { source "ecns.$SDW_JACK_ECNS_PIPELINE_ID.1" sink "host-copier.$SDW_JACK_ECNS_PCM_ID.capture" }
+]
+
+# ---------------------------------------------------------------------------
+# PCM 13: 48 kHz ECNS processed headset microphone stereo capture
+# ---------------------------------------------------------------------------
+Object.PCM.pcm [
+ {
+ name "$SDW_JACK_ECNS_PCM_NAME"
+ id $SDW_JACK_ECNS_PCM_ID
+ direction "capture"
+
+ Object.Base.fe_dai.1 {
+ name "$SDW_JACK_ECNS_PCM_CAPS"
+ }
+
+ Object.PCM.pcm_caps.1 {
+ name "$SDW_JACK_ECNS_PCM_CAPS"
+ formats "S16_LE,S32_LE"
+ rates "48000"
+ channels_min 2
+ channels_max 2
+ }
+ }
+]
diff --git a/tools/topology/topology2/platform/intel/sdw-jack-wov-multi.conf b/tools/topology/topology2/platform/intel/sdw-jack-wov-multi.conf
index 79711edd7b65..475d570ca286 100644
--- a/tools/topology/topology2/platform/intel/sdw-jack-wov-multi.conf
+++ b/tools/topology/topology2/platform/intel/sdw-jack-wov-multi.conf
@@ -9,7 +9,7 @@
# -> host-copier.1 (PCM 1 "Jack In", raw, unchanged)
# -> micsel (L+R)/2 mono -> SRC 48k->16k -> module-copier (16-bit)
# module-copier (16 kHz mono) -> KPB -> copier fanout -> 3 x (MFCC + MWW) ->
-# WoV arbiter -> host PCM 14 "Headset Multi-WOV"
+# WoV arbiter -> host PCM 14 "Headset WOV"
#
# Enabled with INCLUDE_WOV=multi and INCLUDE_SDW_JACK_WOV=true.
#
@@ -17,7 +17,7 @@
Define {
HS_WOV_PCM_ID 14
HS_WOV_PCM_CAPS "Gain Capture 14"
- HS_WOV_PCM_NAME "Headset Multi-WOV"
+ HS_WOV_PCM_NAME "Headset WOV"
HS_WOV_SOURCE "module-copier.11.0"
SDW_JACK_WOV_D0I3_COMPATIBLE "true"
diff --git a/tools/topology/topology2/production/tplg-targets-ace3.cmake b/tools/topology/topology2/production/tplg-targets-ace3.cmake
index 6419d376bbef..eb806ae75d04 100644
--- a/tools/topology/topology2/production/tplg-targets-ace3.cmake
+++ b/tools/topology/topology2/production/tplg-targets-ace3.cmake
@@ -345,7 +345,9 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,DMIC_WOV_DAI_CHANNELS=4,WOV_SLOT_COUNT=3,\
SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true,SDW_SPK_ECHO_REF_ECNS=true,\
-SDW_SPK_ENHANCED_PLAYBACK=false,SDW_DMIC_ENHANCED_CAPTURE=false"
+INCLUDE_SDW_JACK_ECNS=true,\
+SDW_SPK_ENHANCED_PLAYBACK=false,SDW_SPK_BASIC_PLAYBACK_IIR=true,\
+SDW_DMIC_ENHANCED_CAPTURE=false"
"cavs-sdw\;sof-ptl-rt722-4ch-wov-multi\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,\
PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=5,DMIC1_ID=6,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9,\
@@ -354,7 +356,9 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
DMIC_WOV_DAI_CHANNELS=4,INCLUDE_SDW_JACK_WOV=true,WOV_SLOT_COUNT=3,\
SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true,SDW_SPK_ECHO_REF_ECNS=true,\
-SDW_SPK_ENHANCED_PLAYBACK=false,SDW_DMIC_ENHANCED_CAPTURE=false"
+INCLUDE_SDW_JACK_ECNS=true,\
+SDW_SPK_ENHANCED_PLAYBACK=false,SDW_SPK_BASIC_PLAYBACK_IIR=true,\
+SDW_DMIC_ENHANCED_CAPTURE=false"
# Same wov-multi as above but 2ch, and also have NHLT embedded for all
# cavs-sdw enables PDM1 by default, so 2ch needs explicit
@@ -367,7 +371,9 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,WOV_SLOT_COUNT=3,\
SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true,SDW_SPK_ECHO_REF_ECNS=true,\
-SDW_SPK_ENHANCED_PLAYBACK=false,SDW_DMIC_ENHANCED_CAPTURE=false"
+INCLUDE_SDW_JACK_ECNS=true,\
+SDW_SPK_ENHANCED_PLAYBACK=false,SDW_SPK_BASIC_PLAYBACK_IIR=true,\
+SDW_DMIC_ENHANCED_CAPTURE=false"
"cavs-sdw\;sof-ptl-rt722-2ch-wov-multi\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=2,\
PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,DMIC_WOV_DAI_CHANNELS=2,\
@@ -377,7 +383,9 @@ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
INCLUDE_SDW_JACK_WOV=true,WOV_SLOT_COUNT=3,\
SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true,SDW_SPK_ECHO_REF_ECNS=true,\
-SDW_SPK_ENHANCED_PLAYBACK=false,SDW_DMIC_ENHANCED_CAPTURE=false"
+INCLUDE_SDW_JACK_ECNS=true,\
+SDW_SPK_ENHANCED_PLAYBACK=false,SDW_SPK_BASIC_PLAYBACK_IIR=true,\
+SDW_DMIC_ENHANCED_CAPTURE=false"
)
list(APPEND SYMLINKS
diff --git a/tools/topology/topology2/sof-hda-generic.conf b/tools/topology/topology2/sof-hda-generic.conf
index ac788272371a..48dfdfdf14b0 100644
--- a/tools/topology/topology2/sof-hda-generic.conf
+++ b/tools/topology/topology2/sof-hda-generic.conf
@@ -24,6 +24,7 @@
+
@@ -58,7 +59,7 @@
-
+
diff --git a/tools/topology/topology2/ssp0-wov-multi-manifest.conf b/tools/topology/topology2/ssp0-wov-multi-manifest.conf
index 02945acdbdec..af49dd45bd0e 100644
--- a/tools/topology/topology2/ssp0-wov-multi-manifest.conf
+++ b/tools/topology/topology2/ssp0-wov-multi-manifest.conf
@@ -706,7 +706,7 @@ Object.Base.route [
# PCM (ALSA card definition for the single WOV capture stream)
# ---------------------------------------------------------------------------
Object.PCM.pcm."$DMIC_PCM_ID" {
- name "DMIC Multi-WOV"
+ name "DMIC WOV"
id $DMIC_PCM_ID
direction "capture"
capture_compatible_d0i3 true
diff --git a/tools/topology/topology2/ssp1-wov-multi-manifest.conf b/tools/topology/topology2/ssp1-wov-multi-manifest.conf
index 63b4a70053f8..59c07dea50a1 100644
--- a/tools/topology/topology2/ssp1-wov-multi-manifest.conf
+++ b/tools/topology/topology2/ssp1-wov-multi-manifest.conf
@@ -706,7 +706,7 @@ Object.Base.route [
# PCM (ALSA card definition for the single WOV capture stream)
# ---------------------------------------------------------------------------
Object.PCM.pcm."$DMIC_PCM_ID" {
- name "DMIC Multi-WOV"
+ name "DMIC WOV"
id $DMIC_PCM_ID
direction "capture"
capture_compatible_d0i3 true
diff --git a/tools/topology/topology2/ssp2-wov-multi-manifest.conf b/tools/topology/topology2/ssp2-wov-multi-manifest.conf
index 64ceda83bc2b..95df965904be 100644
--- a/tools/topology/topology2/ssp2-wov-multi-manifest.conf
+++ b/tools/topology/topology2/ssp2-wov-multi-manifest.conf
@@ -706,7 +706,7 @@ Object.Base.route [
# PCM (ALSA card definition for the single WOV capture stream)
# ---------------------------------------------------------------------------
Object.PCM.pcm."$DMIC_PCM_ID" {
- name "DMIC Multi-WOV"
+ name "DMIC WOV"
id $DMIC_PCM_ID
direction "capture"
capture_compatible_d0i3 true
diff --git a/tools/wov_capture/run_wov_10x.py b/tools/wov_capture/run_wov_10x.py
index 62eb0a727706..31b1331f500c 100755
--- a/tools/wov_capture/run_wov_10x.py
+++ b/tools/wov_capture/run_wov_10x.py
@@ -11,11 +11,11 @@
import time
def find_wov_pcm(card=0):
- """Auto-detect DMIC Multi-WOV capture PCM device index."""
+ """Auto-detect DMIC WOV capture PCM device index."""
try:
with open("/proc/asound/pcm") as f:
for line in f:
- if "DMIC Multi-WOV" in line:
+ if "DMIC WOV" in line:
m = re.match(r"^(\d+)-(\d+):", line)
if m and int(m.group(1)) == card:
return int(m.group(2))