From 61ff15e022c19d5cb161335d553810ea64ee0a4e Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 20 Nov 2026 16:06:31 +0200 Subject: [PATCH 1/7] topology2: wov: remove DMIC-only multi-slot WoV topologies with ECNS The ECNS module is changed to take a speaker echo reference into its second input pin. The DMIC-only multi-slot WoV topologies have no speaker playback to provide the reference, so they are removed. Removed are the standalone manifests dmic-wov-multi-ptl-4ch-manifest.conf and dmic-wov-multi-4ch-manifest.conf with their targets sof-ptl-dmic-wov-multi-4ch and sof-tgl-dmic-wov-multi-4ch, the dmic-wov-feature.conf targets sof-dmic-4ch-wov-multi and sof-ptl-dmic-4ch-wov-multi, the WCL symlinks to them and the prebuilt binaries in build/. The dmic-wov-feature.conf no longer supports INCLUDE_WOV=multi, so the classes used only by the multi-slot WoV are not included anymore. The legacy single detector topology sof-dmic-4ch-wov and the sof-ptl-dmic-wov-multi without ECNS are kept. The documentation is updated to not refer to the removed topologies. Signed-off-by: Seppo Ingalsuo --- build/sof-ptl-dmic-wov-multi-4ch.tplg | Bin 43111 -> 0 bytes build/sof-tgl-dmic-wov-multi-4ch.tplg | Bin 37808 -> 0 bytes build/sof-wcl-dmic-wov-multi-4ch.tplg | Bin 43111 -> 0 bytes .../wov_ecns_integration_guide.md | 26 +- src/audio/microwakeword/README.md | 11 +- src/audio/wov_arbiter/README.md | 18 +- tools/topology/topology2/README.md | 164 +-- .../topology/topology2/dmic-wov-feature.conf | 9 +- .../dmic-wov-multi-4ch-manifest.conf | 1107 --------------- .../dmic-wov-multi-ptl-4ch-manifest.conf | 1208 ----------------- .../production/tplg-targets-ace3.cmake | 7 - .../production/tplg-targets-cavs25.cmake | 3 - 12 files changed, 45 insertions(+), 2508 deletions(-) delete mode 100644 build/sof-ptl-dmic-wov-multi-4ch.tplg delete mode 100644 build/sof-tgl-dmic-wov-multi-4ch.tplg delete mode 100644 build/sof-wcl-dmic-wov-multi-4ch.tplg delete mode 100644 tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf delete mode 100644 tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf diff --git a/build/sof-ptl-dmic-wov-multi-4ch.tplg b/build/sof-ptl-dmic-wov-multi-4ch.tplg deleted file mode 100644 index 550a0a376ac4bd672c453e7ad3f51b6d43b1a29a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43111 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 T2Tw)t^?zs{A+VD9soVbmh^9C! diff --git a/build/sof-wcl-dmic-wov-multi-4ch.tplg b/build/sof-wcl-dmic-wov-multi-4ch.tplg deleted file mode 100644 index 550a0a376ac4bd672c453e7ad3f51b6d43b1a29a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43111 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 [!NOTE] +> The snippets below were taken from the standalone DMIC-only +> `dmic-wov-multi-ptl-4ch-manifest.conf`, which has been removed because ECNS +> requires a speaker echo reference input that a DMIC-only topology cannot +> provide. They are kept as an illustration of the pipeline structure. #### 1. ECNS Pipeline (Pipeline 105) ```conf @@ -585,18 +591,16 @@ Follow this step-by-step checklist to integrate your own algorithms: ### Step 3: Define Topology Components 1. Create Topology2 component definitions in `tools/topology/topology2/include/components/.conf`. 2. Reference the scoring enum in `score_enum.conf` (ensuring no `volatile` access flag). -3. Connect widgets in the platform manifest files: - - Panther Lake: `tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf` - - Tiger Lake: `tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf` - - Wildcat Lake: symlink to the Panther Lake topology, no separate manifest +3. Connect widgets in the shared multi-slot WoV topology + `tools/topology/topology2/platform/intel/dmic-wov-multi.conf`, used e.g. by the + `cavs-sdw` `*-wov-multi` targets in `production/tplg-targets-ace3.cmake`. + Wildcat Lake topologies are symlinks to the Panther Lake ones. ### Step 4: Compile Topology & Firmware -1. Build topologies with `alsatplg -p`: +1. Build the topology via its CMake target (see `tools/topology/topology2/README.md` + for the direct `alsatplg -p` invocation): ```bash - alsatplg \ - -I tools/topology/topology2 \ - -p -c tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf \ - -o /tmp/sof-ptl-dmic-wov-multi-4ch.tplg + make -C build-tools topology2_prod_sof-ptl-rt721-4ch-wov-multi ``` 2. Build firmware with Zephyr SDK GCC: ```bash @@ -608,7 +612,7 @@ Follow this step-by-step checklist to integrate your own algorithms: 1. Copy firmware and topology to DUT: ```bash scp build-sof-staging/sof/intel/sof-ipc4/ptl/community/sof-ptl.ri root@:/lib/firmware/intel/sof-ipc4/ptl/community/ - scp /tmp/sof-ptl-dmic-wov-multi-4ch.tplg root@:/lib/firmware/intel/sof-ipc4-tplg/ + scp build-tools/topology/topology2/production/sof-ptl-rt721-4ch-wov-multi.tplg root@:/lib/firmware/intel/sof-ipc4-tplg/ ``` 2. Reload driver: ```bash diff --git a/src/audio/microwakeword/README.md b/src/audio/microwakeword/README.md index 68b4bd9ee640..ae67ae72a5ba 100644 --- a/src/audio/microwakeword/README.md +++ b/src/audio/microwakeword/README.md @@ -110,11 +110,12 @@ graph TD ## Cross-Platform Manifest Targets -| Target Platform | Manifest File | Output Topology Binary | DMIC Driver Version | -|---|---|---|---| -| **Panther Lake (PTL / ACE 3.0)** | [`dmic-wov-multi-ptl-4ch-manifest.conf`](file:///home/lrg/work/sof-tgl/sof-wov/tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf) | `sof-ptl-dmic-wov-multi-4ch.tplg` | 5 | -| **Tiger Lake (TGL / CAVS 2.5)** | [`dmic-wov-multi-4ch-manifest.conf`](file:///home/lrg/work/sof-tgl/sof-wov/tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf) | `sof-tgl-dmic-wov-multi-4ch.tplg` | 1 | -| **Wildcat Lake (WCL / ACE 3.0)** | symlink to the PTL topology | `sof-wcl-dmic-wov-multi-4ch.tplg` | 5 | +The standalone DMIC-only 4-channel manifests (`dmic-wov-multi-ptl-4ch-manifest.conf`, +`dmic-wov-multi-4ch-manifest.conf`) and their `sof-*-dmic-wov-multi-4ch.tplg` targets +have been removed, because ECNS requires a speaker echo reference input that a +DMIC-only topology cannot provide. See +[`tools/topology/topology2/README.md`](../../../tools/topology/topology2/README.md) +for the remaining multi-slot WoV topology targets. --- diff --git a/src/audio/wov_arbiter/README.md b/src/audio/wov_arbiter/README.md index cefa8a66c95c..4f592b4380c7 100644 --- a/src/audio/wov_arbiter/README.md +++ b/src/audio/wov_arbiter/README.md @@ -926,14 +926,12 @@ ALSA_CONFIG_DIR=$ALSA_TMP ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/alsa-topology alsatp -I $TPLG2 -p \ -c tools/topology/topology2/dmic-wov-multi-manifest.conf \ -o /tmp/sof-tgl-dmic-wov-multi.tplg - -# 2. Native 16 kHz 4-Channel Multi-WOV Topology (No SRC, with embedded NHLT) -ALSA_CONFIG_DIR=$ALSA_TMP ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/alsa-topology alsatplg \ - -I $TPLG2 -p \ - -c tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf \ - -o /tmp/sof-tgl-dmic-wov-multi-4ch.tplg ``` +The standalone native 16 kHz 4-channel DMIC-only manifest +(`dmic-wov-multi-4ch-manifest.conf`) has been removed, because ECNS requires a +speaker echo reference input that a DMIC-only topology cannot provide. + `ALSA_CONFIG_DIR` must point to a directory that contains `alsa.conf` plus `include/` and `platform/` symlinks into `topology2/`. `ALSA_TOPOLOGY_PLUGIN_DIR` points to the directory containing `libalsatplg_module_nhlt.so` so the NHLT preprocessor plugin can @@ -942,8 +940,8 @@ generate and embed the hardware ACPI NHLT table into the manifest binary. Copy the compiled topology to the DUT: ```bash -scp /tmp/sof-tgl-dmic-wov-multi-4ch.tplg \ - root@:/lib/firmware/intel/sof-ipc4-tplg/sof-tgl-dmic-wov-multi-4ch.tplg +scp /tmp/sof-tgl-dmic-wov-multi.tplg \ + root@:/lib/firmware/intel/sof-ipc4-tplg/sof-tgl-dmic-wov-multi.tplg ``` ### BIOS NHLT Table Override (`sof_use_tplg_nhlt=1`) @@ -956,7 +954,7 @@ The SOF Linux kernel driver supports **overriding the BIOS NHLT table** using th table embedded in the topology manifest binary. #### 1. How Topology NHLT is Embedded -In the topology manifest (`dmic-wov-multi-4ch-manifest.conf`): +In a topology manifest that embeds its own NHLT table: - `Define { PREPROCESS_PLUGINS "nhlt" }` enables the NHLT compiler plugin. - `Object.Dai.DMIC` defines the DAI parameters (`sample_rate 16000`, `num_pdm_active 2`, 4 active mics). - `Object.Base.manifest.1 { nhlt "true" }` packages the NHLT table into a `SOF_MANIFEST_DATA_TYPE_NHLT` (1) TLV data block inside the compiled `.tplg` binary. @@ -968,7 +966,7 @@ Edit `/etc/modprobe.d/sof.conf` on the DUT: ```ini # /etc/modprobe.d/sof.conf -options snd_sof tplg_path=intel/sof-ipc4-tplg tplg_filename=sof-tgl-dmic-wov-multi-4ch.tplg +options snd_sof tplg_path=intel/sof-ipc4-tplg tplg_filename=.tplg options snd_sof_intel_hda_common sof_use_tplg_nhlt=1 ``` diff --git a/tools/topology/topology2/README.md b/tools/topology/topology2/README.md index 10d587d8e35d..aca8088f4c95 100644 --- a/tools/topology/topology2/README.md +++ b/tools/topology/topology2/README.md @@ -419,7 +419,7 @@ When targeting hardware configurations not defined in the motherboard's BIOS ACP ### 1. Enabling NHLT Generation in Manifest -In your top-level topology manifest (e.g. `dmic-wov-multi-4ch-manifest.conf`): +In your top-level topology manifest (e.g. `my-platform-manifest.conf`): ```conf Define { @@ -468,8 +468,8 @@ Set `ALSA_TOPOLOGY_PLUGIN_DIR` to the directory containing `libalsatplg_module_n ALSA_CONFIG_DIR=$PWD/tools/topology/topology2 \ ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/x86_64-linux-gnu/alsa-topology \ alsatplg -I $PWD/tools/topology/topology2 -p \ - -c tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf \ - -o build/sof-tgl-dmic-wov-multi-4ch.tplg + -c tools/topology/topology2/my-platform-manifest.conf \ + -o build/sof-my-platform.tplg ``` ### 3. Kernel Driver NHLT Override (`sof_use_tplg_nhlt=1`) @@ -478,142 +478,25 @@ To instruct the Linux SOF driver to use the topology-embedded NHLT table instead ```ini # /etc/modprobe.d/sof.conf -options snd_sof tplg_path=intel/sof-ipc4-tplg tplg_filename=sof-tgl-dmic-wov-multi-4ch.tplg +options snd_sof tplg_path=intel/sof-ipc4-tplg tplg_filename=sof-my-platform.tplg options snd_sof_intel_hda_common sof_use_tplg_nhlt=1 ``` --- -## Multi-Slot microWakeWord (MWW) 4-Channel Architecture +## Multi-Slot microWakeWord (MWW) Production Topologies > [!NOTE] -> This section describes the standalone test manifests (`dmic-wov-multi-*-4ch-manifest.conf`). For the full production SoundWire + DMIC architecture featuring dual PDM interfaces (`dmic01` @ 48 kHz stereo on PDM0 and `dmic16k` @ 16 kHz stereo on PDM1) with 20ms DP ECNS, see [Full Production Platform Topology](#full-production-platform-topology-wildcat-lake-soundwire-rt721--multi-slot-wov-sof-wcl-rt721-4ch-wov-multi-tplg). - -The 4-channel native 16 kHz DMIC architecture integrates Echo Cancellation & Noise Suppression (ECNS), Key Phrase Buffer (KPB), 3 concurrent microWakeWord (MWW) detector instances, and the WOV Arbiter. The identical pipeline topology structure is shared across **Panther Lake (PTL)**, **Tiger Lake (TGL)**, and **Wildcat Lake (WCL)**. - -### Pipeline Topology Diagram - -```mermaid -graph TD - subgraph P100["Pipeline 100 — 4ch DMIC Capture (Core 0, LL 1ms)"] - DAI["DAI Copier (dmic01 / dmic16k)\n4ch · 16 kHz · S16_LE\nCh 0,1: Mics | Ch 2,3: Echo Ref"] - MIX100["mixin 100.1\n(4ch pass-through)"] - DAI --> MIX100 - end - - subgraph P105["Pipeline 105 — ECNS DP Processing (Core 0, DP 20ms)"] - MO105["mixout 105.1\n(4ch input)"] - ECNS["ecns.105.1\n(ECNS DP Module, 20ms = 320 frames)\nCh 0,1: Mic | Ch 2,3: Echo Ref"] - MO105 --> ECNS - end - - subgraph P106["Pipeline 106 — KPB History Buffer (Core 0, DP 20ms)"] - KPB["kpb.106.1\n(2.0s mono history = 64 KB)\n16 kHz · 1ch · S16_LE\nPin 0: sel_sink | Pin 1: host_sink"] - MIX106["mixin 106.1\n(3-way fanout mixin)"] - KPB -- "Pin 0 (sel_sink)" --> MIX106 - end - - subgraph P101["Pipeline 101 — Slot 0: 'strawberry' (Core 0, DP 10ms)"] - MO101["mixout 101.1"] - MFCC0["mfcc.101.1\n(Mel-40 10ms Compress)\nIBS: 320B | OBS: 184B"] - MWW0["mww.101.1\n(microWakeWord)\nModel: 'strawberry'"] - MO101 --> MFCC0 --> MWW0 - end - - subgraph P102["Pipeline 102 — Slot 1: 'hi intel' (Core 0, DP 10ms)"] - MO102["mixout 102.1"] - MFCC1["mfcc.102.1\n(Mel-40 10ms Compress)\nIBS: 320B | OBS: 184B"] - MWW1["mww.102.1\n(microWakeWord)\nModel: 'hi intel'"] - MO102 --> MFCC1 --> MWW1 - end - - subgraph P103["Pipeline 103 — Slot 2: 'orange' (Core 0, DP 10ms)"] - MO103["mixout 103.1"] - MFCC2["mfcc.103.1\n(Mel-40 10ms Compress)\nIBS: 320B | OBS: 184B"] - MWW2["mww.103.1\n(microWakeWord)\nModel: 'orange'"] - MO103 --> MFCC2 --> MWW2 - end - - subgraph P104["Pipeline 104 — WOV Host PCM Capture (Core 0, LL 1ms)"] - ARB["wov-arbiter.104.1\n(4 input pins, 1 output pin\nPin 0: Audio | Pins 1-3: Features\n1ch mono 16 kHz S16_LE)"] - HC11["host-copier.11\n(hw:0,11 · PCM 11 · d0i3=1)\n1ch · 16 kHz · S16_LE"] - ARB --> HC11 - end - - subgraph P107["Pipeline 107 — ECNS Host PCM Capture (Core 0, LL 1ms)"] - HC10["host-copier.10\n(hw:0,10 · PCM 10)\n2ch · 16 kHz · S16_LE / S32_LE"] - end - - MIX100 --> MO105 - ECNS -- "Pin 0 (Mono Clean direct)" --> KPB - ECNS -- "Pin 1 (Stereo Clean direct)" --> HC10 - MIX106 --> MO101 - MIX106 --> MO102 - MIX106 --> MO103 - - KPB -- "Pin 1 (host_sink / drain audio)" --> ARB - MWW0 -- "Pin 1 (Features)" --> ARB - MWW1 -- "Pin 2 (Features)" --> ARB - MWW2 -- "Pin 3 (Features)" --> ARB - - MWW0 -. "Notifier WOV_DETECT (slot=0)" .-> ARB - MWW1 -. "Notifier WOV_DETECT (slot=1)" .-> ARB - MWW2 -. "Notifier WOV_DETECT (slot=2)" .-> ARB - MWW0 -. "Notifier KPB_CLIENT_EVT (DRAIN 2s)" .-> KPB - MWW1 -. "Notifier KPB_CLIENT_EVT (DRAIN 2s)" .-> KPB - MWW2 -. "Notifier KPB_CLIENT_EVT (DRAIN 2s)" .-> KPB - ARB -. "Notifier WOV_CTRL (PAUSE/RESUME)" .-> MWW0 - ARB -. "Notifier WOV_CTRL (PAUSE/RESUME)" .-> MWW1 - ARB -. "Notifier WOV_CTRL (PAUSE/RESUME)" .-> MWW2 - - style ECNS fill:#1b4f72,stroke:#555,color:#fff - style KPB fill:#1c4966,stroke:#555,color:#fff - style MFCC0 fill:#7d6608,stroke:#555,color:#fff - style MFCC1 fill:#7d6608,stroke:#555,color:#fff - style MFCC2 fill:#7d6608,stroke:#555,color:#fff - style MWW0 fill:#922b21,stroke:#555,color:#fff - style MWW1 fill:#b7950b,stroke:#555,color:#fff - style MWW2 fill:#d35400,stroke:#555,color:#fff - style ARB fill:#4a235a,stroke:#555,color:#fff - style HC11 fill:#2d5a27,stroke:#555,color:#fff - style HC10 fill:#1e8449,stroke:#555,color:#fff -``` - -### Supported Manifests & Compilation Commands - -| Platform | Manifest File | Target Binary | DMIC Driver Version | -|---|---|---|---| -| **Panther Lake (PTL)** | [`dmic-wov-multi-ptl-4ch-manifest.conf`](file:///home/lrg/work/sof-tgl/sof-wov/tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf) | `sof-ptl-dmic-wov-multi-4ch.tplg` | 5 | -| **Tiger Lake (TGL)** | [`dmic-wov-multi-4ch-manifest.conf`](file:///home/lrg/work/sof-tgl/sof-wov/tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf) | `sof-tgl-dmic-wov-multi-4ch.tplg` | 1 | -| **Wildcat Lake (WCL)** | symlink to the PTL topology | `sof-wcl-dmic-wov-multi-4ch.tplg` | 5 | - -Compile the PTL and TGL targets; WCL is ACE3 like PTL and the compiled -topology is byte-for-byte identical, so it is only a symlink to the PTL -binary (the CMake build does the same via the `SYMLINKS` list in -`production/tplg-targets-ace3.cmake`): - -```bash -# 1. Panther Lake (PTL) -ALSA_CONFIG_DIR=$PWD/tools/topology/topology2 \ -ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/x86_64-linux-gnu/alsa-topology \ -alsatplg -I $PWD/tools/topology/topology2 -p \ - -c tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf \ - -o build/sof-ptl-dmic-wov-multi-4ch.tplg - -# 2. Wildcat Lake (WCL): symlink to the PTL topology -ln -sf sof-ptl-dmic-wov-multi-4ch.tplg build/sof-wcl-dmic-wov-multi-4ch.tplg - -# 3. Tiger Lake (TGL) -ALSA_CONFIG_DIR=$PWD/tools/topology/topology2 \ -ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/x86_64-linux-gnu/alsa-topology \ -alsatplg -I $PWD/tools/topology/topology2 -p \ - -c tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf \ - -o build/sof-tgl-dmic-wov-multi-4ch.tplg -``` +> The standalone DMIC-only 4-channel multi-slot WoV manifests +> (`dmic-wov-multi-ptl-4ch-manifest.conf`, `dmic-wov-multi-4ch-manifest.conf`) +> and their targets (`sof-ptl-dmic-wov-multi-4ch`, `sof-tgl-dmic-wov-multi-4ch`, +> `sof-wcl-dmic-wov-multi-4ch`, `sof-dmic-4ch-wov-multi`, `sof-ptl-dmic-4ch-wov-multi`, +> `sof-wcl-dmic-4ch-wov-multi`) have been removed. ECNS requires a speaker echo +> reference input, which a DMIC-only topology cannot provide. ### Full Production Platform Topology: Wildcat Lake SoundWire RT721 + Multi-Slot WoV (`sof-wcl-rt721-4ch-wov-multi.tplg`) -While standalone manifests isolate the DMIC and WoV pipelines for component-level verification, production hardware integrates the full multi-slot WoV subsystem alongside the platform's SoundWire codecs and Intel Display Audio interfaces. +Production hardware integrates the full multi-slot WoV subsystem alongside the platform's SoundWire codecs and Intel Display Audio interfaces. 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`. @@ -979,13 +862,6 @@ make -C build-tools \ # Build HDA Generic Multi-WoV (ACE3: PTL and WCL) make -C build-tools \ topology2_prod_sof-hda-generic-ace3-4ch-wov-multi - -# Build Standalone 4-Channel DMIC Multi-WoV (PTL, WCL, and generic) -make -C build-tools \ - topology2_prod_sof-ptl-dmic-4ch-wov-multi \ - topology2_prod_sof-wcl-dmic-4ch-wov-multi \ - topology2_prod_sof-dmic-4ch-wov-multi \ - topology2_prod_sof-ptl-dmic-wov-multi-4ch ``` ##### Configurable Detector Count With Dummy ECNS @@ -1144,17 +1020,7 @@ build-rimage/rimage -k sof/keys/otc_private_key_3k.pem \ #### Step 2: Compile the Multi-Slot Topology -##### Option A: Standalone 4-Channel DMIC WoV Topology (`sof-ptl-dmic-wov-multi-4ch.tplg`) - -```bash -ALSA_CONFIG_DIR=$PWD/tools/topology/topology2 \ -ALSA_TOPOLOGY_PLUGIN_DIR=/usr/lib/alsa-topology \ -alsatplg -I $PWD/tools/topology/topology2 -p \ - -c tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf \ - -o build/sof-ptl-dmic-wov-multi-4ch.tplg -``` - -##### Option B: Production SoundWire RT721 Multi-WoV Topology (`sof-ptl-rt721-4ch-wov-multi.tplg`) +##### Production SoundWire RT721 Multi-WoV Topology (`sof-ptl-rt721-4ch-wov-multi.tplg`) ```bash # 1. Assemble config template with ABI header @@ -1186,7 +1052,7 @@ Deploy the built binary and topology to the Panther Lake target (e.g. `root@aphi scp build-ptl/zephyr/zephyr.ri root@aphid:/lib/firmware/intel/sof-ipc4/ptl/community/sof-ptl.ri # 2. Copy topology binary -scp build/sof-ptl-dmic-wov-multi-4ch.tplg root@aphid:/lib/firmware/intel/sof-ipc4-tplg/sof-ptl-dmic-wov-multi-4ch.tplg +scp build/sof-ptl-rt721-4ch-wov-multi.tplg root@aphid:/lib/firmware/intel/sof-ipc4-tplg/sof-ptl-rt721-4ch-wov-multi.tplg # 3. Reload audio driver on target DUT ssh root@aphid ' @@ -1200,7 +1066,7 @@ ssh root@aphid ' Verify in target `dmesg`: ```text sof-audio-pci-intel-ptl ...: Booted firmware version: 2.14.99.1 -sof-audio-pci-intel-ptl ...: loading topology: intel/sof-ipc4-tplg/sof-ptl-dmic-wov-multi-4ch.tplg +sof-audio-pci-intel-ptl ...: loading topology: intel/sof-ipc4-tplg/sof-ptl-rt721-4ch-wov-multi.tplg sof-audio-pci-intel-ptl ...: WOVDEBUG pcm11 dir 1 d0i3=1 ``` diff --git a/tools/topology/topology2/dmic-wov-feature.conf b/tools/topology/topology2/dmic-wov-feature.conf index 98597314c8cc..b49d1cce9f2f 100644 --- a/tools/topology/topology2/dmic-wov-feature.conf +++ b/tools/topology/topology2/dmic-wov-feature.conf @@ -27,12 +27,6 @@ - - - - - - @@ -176,8 +170,7 @@ Object.Widget.virtual [ { name "Alt Analog CPU Capture" type input index 8 } ] -# Dispatch based on INCLUDE_WOV: "true" for legacy single detector, "multi" for multi-slot WoV +# Legacy single detector WoV IncludeByKey.INCLUDE_WOV { "true" "platform/intel/dmic-wov.conf" - "multi" "platform/intel/dmic-wov-multi.conf" } diff --git a/tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf b/tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf deleted file mode 100644 index 5a0f7f6afff4..000000000000 --- a/tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# --------------------------------------------------------------------------- -# Custom dynamic pipeline classes -# --------------------------------------------------------------------------- -Class.Pipeline."custom-capture" { - - - attributes { - !constructor [ - "index" - ] - unique "instance" - } - - Object.Widget.pipeline."1" { - priority 0 - lp_mode 0 - } - - direction "capture" - time_domain "timer" - dynamic_pipeline 1 -} - -Class.Pipeline."custom-dp-capture" { - - - attributes { - !constructor [ - "index" - ] - unique "instance" - } - - Object.Widget.pipeline."1" { - priority 0 - lp_mode 1 - } - - direction "capture" - time_domain "timer" - dynamic_pipeline 1 -} - -# --------------------------------------------------------------------------- -# Constants -# --------------------------------------------------------------------------- -Define { - PLATFORM "tgl" - PREPROCESS_PLUGINS "nhlt" - KWD_TEST_UUID "1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67" - WOV_UUID "1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67" - WOV_ARBITER_UUID "7d:6c:5b:4a:9f:8e:1b:4a:2c:3d:4e:5f:60:71:82:93" - ECNS_UUID "6c:8a:4f:21:3a:49:1e:4b:8b:1e:0d:3b:6f:8a:2c:15" - - DMIC_DAI_INDEX 1 - ECNS_PCM_ID 10 - DMIC_PCM_ID 11 - DMIC_NAME "dmic16k" - ECNS_PCM_CAPS "Gain Capture 10" - DMIC_PCM_CAPS "Gain Capture 11" - FORMAT "s16le" - - KWD_CPC 100000 - KPB_BUFF_TIME_MS "2000" - DMIC_DRIVER_VERSION 1 - MWW_FEATURES "pcan" -} - -IncludeByKey.MWW_FEATURES { - "pcan" { - Define { - MFCC_FRAME_BYTES 64 - MWW_INPUT_BYTES 64 - } - } - "agc8" { - Define { - MFCC_FRAME_BYTES 64 - MWW_INPUT_BYTES 64 - } - } -} - -# Override defaults with platform-specific definitions -IncludeByKey.PLATFORM { - "tgl" "platform/intel/tgl.conf" - "ptl" "platform/intel/ptl.conf" -} - -# --------------------------------------------------------------------------- -# Pipeline 100 — DAI Capture (Core 0, LL 1ms) -# DMIC DAI copier (16k 4ch in -> 16k 4ch out) -> Mixin.100.1 -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 100 - format $FORMAT - rate 16000 - - Object.Widget.dai-copier.1 { - dai_index $DMIC_DAI_INDEX - type "dai_out" - dai_type "DMIC" - copier_type "DMIC" - stream_name $DMIC_NAME - direction "capture" - node_type $DMIC_LINK_INPUT_CLASS - - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Base.input_audio_format [ - { - in_rate 16000 - 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 16000 - out_channels 4 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - out_bit_depth 16 - out_valid_bit_depth 16 - } - ] - } - - Object.Widget.mixin.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_rate 16000 - in_channels 4 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - in_bit_depth 16 - in_valid_bit_depth 16 - } - ] - Object.Base.output_audio_format [ - { - out_rate 16000 - out_channels 4 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - out_bit_depth 16 - out_valid_bit_depth 16 - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 105 — ECNS DP Pipeline (Core 0, 20ms DP, Static) -# Mixout.105.1 -> ECNS.105.1 -# Output Pin 0: Ch 0 mono (16k) -> KPB.106.1 -# Output Pin 1: Ch 0,1 stereo (16k) -> Host-Copier.10 (ALSA PCM 10) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-dp-capture" [ - { - index 105 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_rate 16000 - in_channels 4 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - in_bit_depth 16 - in_valid_bit_depth 16 - } - ] - Object.Base.output_audio_format [ - { - out_rate 16000 - out_channels 4 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - out_bit_depth 16 - out_valid_bit_depth 16 - } - ] - } - - Object.Widget.ecns.1 { - uuid $ECNS_UUID - 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 4 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - in_bit_depth 16 - in_valid_bit_depth 16 - ibs 2560 - } - ] - Object.Base.output_audio_format [ - # Pin 0: Ch 0 mono clean to KPB mixin - { - 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 - obs 640 - } - # Pin 1: Ch 0,1 stereo clean to Host mixin - { - output_pin_index 1 - out_rate 16000 - out_channels 2 - out_ch_cfg $CHANNEL_CONFIG_STEREO - out_ch_map $CHANNEL_MAP_STEREO - out_bit_depth 16 - out_valid_bit_depth 16 - obs 1280 - } - ] - - Object.Base.output_pin_binding.1 { - output_pin_binding_name "kpb.106.1" - } - Object.Base.output_pin_binding.2 { - output_pin_binding_name "host-copier.$ECNS_PCM_ID.capture" - } - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 1 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 107 — ECNS Host Capture Pipeline (Core 0, LL 1ms) -# ECNS.105.1 Pin 1 (2ch stereo clean) -> Host-Copier.10 (ALSA PCM 10) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 107 - format $FORMAT - rate 16000 - - Object.Widget.host-copier.1 { - stream_name $ECNS_PCM_CAPS - pcm_id $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 2 - in_ch_cfg $CHANNEL_CONFIG_STEREO - in_ch_map $CHANNEL_MAP_STEREO - in_bit_depth 16 - in_valid_bit_depth 16 - } - ] - - num_output_audio_formats 2 - 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 16 - out_valid_bit_depth 16 - } - { - 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 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 106 — KPB & WOV Fanout (Core 0, LL 1ms) -# ECNS.105.1 Pin 0 (1ch mono clean) -> KPB.106.1 (2000ms) -> Mixin.106.1 (fanout 1 -> 3) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 106 - format $FORMAT - rate 16000 - - Object.Widget.kpb.1 { - history_depth_ms 2000 - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_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 - ibs 32 - } - ] - 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 - obs 32 - } - ] - } - - Object.Widget.mixin.1 { - num_input_pins 1 - num_output_pins 3 - num_input_audio_formats 1 - num_output_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 - } - ] - 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 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 101 — WOV slot 0 (Core 0, 1ch mono) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 101 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_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 [ - { - 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.mfcc.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MFCC 101 bytes" - IncludeByKey.MWW_FEATURES { - "pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" - "agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" - } - } - mixer."1" { - name "MFCC 101 VAD" - } - } - - 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 - ibs 320 - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MFCC_FRAME_BYTES - } - ] - } - - Object.Widget.mww.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MWW 101 bytes" - max 65536 - } - enum."1" { - name "MWW 101 Score" - - } - mixer."1" { - name "wovdebug_$index" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 102 — WOV slot 1 (Core 0, 1ch mono) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 102 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_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 [ - { - 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.mfcc.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MFCC 102 bytes" - IncludeByKey.MWW_FEATURES { - "pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" - "agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" - } - } - mixer."1" { - name "MFCC 102 VAD" - } - } - - 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 - ibs 320 - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MFCC_FRAME_BYTES - } - ] - } - - Object.Widget.mww.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MWW 102 bytes" - max 65536 - } - enum."1" { - name "MWW 102 Score" - - } - mixer."1" { - name "wovdebug_$index" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 103 — WOV slot 2 (Core 0, 1ch mono) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 103 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_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 [ - { - 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.mfcc.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MFCC 103 bytes" - IncludeByKey.MWW_FEATURES { - "pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" - "agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" - } - } - mixer."1" { - name "MFCC 103 VAD" - } - } - - 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 - ibs 320 - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MFCC_FRAME_BYTES - } - ] - } - - Object.Widget.mww.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MWW 103 bytes" - max 65536 - } - enum."1" { - name "MWW 103 Score" - - } - mixer."1" { - name "wovdebug_$index" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 104 — WOV Arbiter & Host Copier 11 (Core 0, Mono Output) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 104 - format $FORMAT - rate 16000 - - Object.Widget.wov-arbiter.1 { - uuid $WOV_ARBITER_UUID - num_input_pins 3 - num_output_pins 1 - num_input_audio_formats 1 - num_output_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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.host-copier.1 { - stream_name $DMIC_PCM_CAPS - pcm_id $DMIC_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 32 - in_valid_bit_depth 32 - } - ] - - num_output_audio_formats 2 - 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 - } - { - out_rate 16000 - out_channels 1 - out_ch_cfg $CHANNEL_CONFIG_MONO - out_ch_map $CHANNEL_MAP_MONO - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - - -# --------------------------------------------------------------------------- -# Virtual Widgets -# --------------------------------------------------------------------------- -Object.Widget.virtual [ - { name "codec0_in" type input index 1 } - { name "codec1_in" type input index 2 } - { name "codec0_out" type output index 3 } - { name "codec1_out" type output index 4 } - { name "codec2_in" type input index 5 } - { name "codec2_out" type output index 6 } - { name "iDisp1_out" type output index 7 } - { name "iDisp2_out" type output index 8 } - { name "iDisp3_out" type output index 9 } - { name "iDisp3 Tx" type out_drv index 0 } - { name "iDisp2 Tx" type out_drv index 1 } - { name "iDisp1 Tx" type out_drv index 2 } - { name "Analog CPU Playback" type out_drv index 3 } - { name "Digital CPU Playback" type out_drv index 4 } - { name "Alt Analog CPU Playback" type out_drv index 5 } - { name "Analog CPU Capture" type input index 6 } - { name "Digital CPU Capture" type input index 7 } - { name "Alt Analog CPU Capture" type input index 8 } -] - -# --------------------------------------------------------------------------- -# Routes -# --------------------------------------------------------------------------- -Object.Base.route [ - # DMIC 4ch capture to ECNS - { source "dai-copier.DMIC.$DMIC_NAME.capture" sink "mixin.100.1" } - { source "mixin.100.1" sink "mixout.105.1" } - { source "mixout.105.1" sink "ecns.105.1" } - - # ECNS Output Pin 0 (mono) direct to KPB - { source "ecns.105.1" sink "kpb.106.1" } - { source "kpb.106.1" sink "mixin.106.1" } - - # ECNS Output Pin 1 (stereo) direct to Host Copier 10 - { source "ecns.105.1" sink "host-copier.$ECNS_PCM_ID.capture" } - - # KPB mixin fanning out to 3 WOV detector slots (MFCC + MWW -> WOV Arbiter) - { source "mixin.106.1" sink "mixout.101.1" } - { source "mixout.101.1" sink "mfcc.101.1" } - { source "mfcc.101.1" sink "mww.101.1" } - { source "mww.101.1" sink "wov-arbiter.104.1" } - - { source "mixin.106.1" sink "mixout.102.1" } - { source "mixout.102.1" sink "mfcc.102.1" } - { source "mfcc.102.1" sink "mww.102.1" } - { source "mww.102.1" sink "wov-arbiter.104.1" } - - { source "mixin.106.1" sink "mixout.103.1" } - { source "mixout.103.1" sink "mfcc.103.1" } - { source "mfcc.103.1" sink "mww.103.1" } - { source "mww.103.1" sink "wov-arbiter.104.1" } - - # WOV Arbiter output to Host Copier 11 - { source "wov-arbiter.104.1" sink "host-copier.$DMIC_PCM_ID.capture" } -] - -# --------------------------------------------------------------------------- -# DMIC DAI (Two Endpoints: Endpoint 0 @ 48kHz, Endpoint 1 @ 16kHz) -# --------------------------------------------------------------------------- -Object.Dai.DMIC [ - { - name "dmic01" - dai_index 0 - id 6 - driver_version $DMIC_DRIVER_VERSION - io_clk 38400000 - sample_rate 48000 - clk_min 500000 - clk_max 4800000 - unmute_ramp_time_ms 200 - num_pdm_active 2 - - Object.Base.hw_config.1 { - id 0 - name "DMIC0" - } - - Object.Base.pdm_config.1 { - ctrl_id 0 - mic_a_enable 1 - mic_b_enable 1 - } - Object.Base.pdm_config.2 { - ctrl_id 1 - mic_a_enable 1 - mic_b_enable 1 - } - } - { - name "dmic16k" - dai_index 1 - id 7 - driver_version $DMIC_DRIVER_VERSION - io_clk 38400000 - sample_rate 16000 - clk_min 500000 - clk_max 4800000 - unmute_ramp_time_ms 200 - num_pdm_active 2 - - Object.Base.hw_config.1 { - id 0 - name "DMIC1" - } - - Object.Base.pdm_config.1 { - ctrl_id 0 - mic_a_enable 1 - mic_b_enable 1 - } - Object.Base.pdm_config.2 { - ctrl_id 1 - mic_a_enable 1 - mic_b_enable 1 - } - } -] - -# --------------------------------------------------------------------------- -# PCM 10 (ECNS Stereo Capture PCM) -# --------------------------------------------------------------------------- -Object.PCM.pcm."$ECNS_PCM_ID" { - name "DMIC ECNS Capture" - id $ECNS_PCM_ID - direction "capture" - capture_compatible_d0i3 true - - Object.Base.fe_dai."$ECNS_PCM_CAPS" {} - - Object.PCM.pcm_caps."capture" { - name $ECNS_PCM_CAPS - formats "S16_LE,S32_LE" - rates "16000" - channels_min 2 - channels_max 2 - } -} - -# --------------------------------------------------------------------------- -# PCM 11 (WOV Arbiter Mono Capture PCM) -# --------------------------------------------------------------------------- -Object.PCM.pcm."$DMIC_PCM_ID" { - name "DMIC Multi-WOV" - id $DMIC_PCM_ID - direction "capture" - capture_compatible_d0i3 true - - Object.Base.fe_dai."$DMIC_PCM_CAPS" {} - - Object.PCM.pcm_caps."capture" { - name $DMIC_PCM_CAPS - formats "S16_LE,S32_LE" - rates "16000" - channels_min 1 - channels_max 1 - } -} - -# --------------------------------------------------------------------------- -# Manifest -# --------------------------------------------------------------------------- -Object.Base.manifest.1 { - name "sof_manifest" - nhlt "true" - Object.Base.data.1 { - name "SOF ABI" - bytes "0x03,0x00,0x1d,0x00,0x01,0x00" - } -} diff --git a/tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf b/tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf deleted file mode 100644 index 3122f34f0139..000000000000 --- a/tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf +++ /dev/null @@ -1,1208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# --------------------------------------------------------------------------- -# Custom dynamic pipeline classes -# --------------------------------------------------------------------------- -Class.Pipeline."custom-capture" { - - - attributes { - !constructor [ - "index" - ] - unique "instance" - } - - Object.Widget.pipeline."1" { - priority 0 - lp_mode 0 - } - - # Without this no scheduler period token reaches the firmware at all. - # Every stock SOF capture class sets it (see volume-capture.conf). - period 1000 - direction "capture" - time_domain "timer" - dynamic_pipeline 1 -} - -Class.Pipeline."custom-dp-capture" { - - - attributes { - !constructor [ - "index" - ] - unique "instance" - } - - Object.Widget.pipeline."1" { - priority 0 - lp_mode 1 - } - - # Without this no scheduler period token reaches the firmware at all. - # Every stock SOF capture class sets it (see volume-capture.conf). - period 1000 - direction "capture" - time_domain "timer" - dynamic_pipeline 1 -} - -# --------------------------------------------------------------------------- -# Constants -# --------------------------------------------------------------------------- -Define { - PLATFORM "ptl" - PREPROCESS_PLUGINS "nhlt" - KWD_TEST_UUID "1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67" - WOV_UUID "1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67" - WOV_ARBITER_UUID "7d:6c:5b:4a:9f:8e:1b:4a:2c:3d:4e:5f:60:71:82:93" - ECNS_UUID "6c:8a:4f:21:3a:49:1e:4b:8b:1e:0d:3b:6f:8a:2c:15" - - DMIC_DAI_INDEX 1 - ECNS_PCM_ID 10 - DMIC_PCM_ID 11 - DMIC_NAME "dmic16k" - ECNS_PCM_CAPS "Gain Capture 10" - DMIC_PCM_CAPS "Gain Capture 11" - FORMAT "s32le" - - KWD_CPC 100000 - KPB_BUFF_TIME_MS "2000" - MWW_FEATURES "pcan" -} - -IncludeByKey.MWW_FEATURES { - "pcan" { - Define { - MFCC_FRAME_BYTES 64 - MWW_INPUT_BYTES 64 - } - } - "agc8" { - Define { - MFCC_FRAME_BYTES 64 - MWW_INPUT_BYTES 64 - } - } -} - -# Override defaults with platform-specific definitions -IncludeByKey.PLATFORM { - "tgl" "platform/intel/tgl.conf" - "ptl" "platform/intel/ptl.conf" -} - -# --------------------------------------------------------------------------- -# Pipeline 100 — DAI Capture (Core 0, LL 1ms) -# DMIC DAI copier (16k 4ch in -> 16k 4ch out) -> Mixin.100.1 -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 100 - format $FORMAT - rate 16000 - - Object.Widget.dai-copier.1 { - dai_index $DMIC_DAI_INDEX - type "dai_out" - dai_type "DMIC" - copier_type "DMIC" - stream_name $DMIC_NAME - direction "capture" - node_type $DMIC_LINK_INPUT_CLASS - - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Base.input_audio_format [ - { - in_rate 16000 - 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 16000 - out_channels 4 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.mixin.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_rate 16000 - 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 - } - ] - Object.Base.output_audio_format [ - { - out_rate 16000 - out_channels 4 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 105 — ECNS DP Pipeline (Core 0, 20ms DP, Static) -# Mixout.105.1 -> ECNS.105.1 -# Output Pin 0: Ch 0 mono (16k) -> KPB.106.1 -# Output Pin 1: Ch 0,1 stereo (16k) -> Host-Copier.10 (ALSA PCM 10) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-dp-capture" [ - { - index 105 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_rate 16000 - 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 - } - ] - Object.Base.output_audio_format [ - { - out_rate 16000 - out_channels 4 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.ecns.1 { - uuid $ECNS_UUID - 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 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 5120 - } - ] - Object.Base.output_audio_format [ - # Pin 0: Ch 0 mono clean to KPB mixin - { - 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 32 - out_valid_bit_depth 32 - obs 1280 - } - # Pin 1: Ch 0,1 stereo clean to Host mixin - { - output_pin_index 1 - 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 - obs 2560 - } - ] - - Object.Base.output_pin_binding.1 { - output_pin_binding_name "kpb.106.1" - } - Object.Base.output_pin_binding.2 { - output_pin_binding_name "host-copier.$ECNS_PCM_ID.capture" - } - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 1 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 107 — ECNS Host Capture Pipeline (Core 0, LL 1ms) -# ECNS.105.1 Pin 1 (2ch stereo clean) -> Host-Copier.10 (ALSA PCM 10) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 107 - format $FORMAT - rate 16000 - - Object.Widget.host-copier.1 { - stream_name $ECNS_PCM_CAPS - pcm_id $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 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 3 - 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 16 - out_valid_bit_depth 16 - } - { - 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 24 - } - { - 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 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 106 — KPB & WOV Fanout (Core 0, LL 1ms) -# ECNS.105.1 Pin 0 (1ch mono clean) -> KPB.106.1 (2000ms) -> Mixin.106.1 (fanout 1 -> 3) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 106 - format $FORMAT - rate 16000 - - Object.Widget.kpb.1 { - history_depth_ms 2000 - num_input_pins 1 - # KPB has two sinks by design (kpb.c): buf_id 0 is sel_sink, the - # constant-rate feed to the detectors, and buf_id 1 is host_sink, - # the variable-rate drain that bursts pre-roll to the host after - # a wake word. - 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 32 - in_valid_bit_depth 32 - ibs 64 - } - ] - Object.Base.output_audio_format [ - # Pin 0: real-time feed to the detector slots - { - 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 32 - out_valid_bit_depth 32 - obs 64 - } - # Pin 1: drain path to the WOV arbiter and the host PCM - { - 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 32 - out_valid_bit_depth 32 - obs 64 - } - ] - - Object.Base.output_pin_binding.1 { - output_pin_binding_name "mixin.106.1" - } - Object.Base.output_pin_binding.2 { - output_pin_binding_name "wov-arbiter.104.1" - } - } - - Object.Widget.mixin.1 { - num_input_pins 1 - num_output_pins 3 - num_input_audio_formats 1 - num_output_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 32 - in_valid_bit_depth 32 - } - ] - 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 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 101 — WOV slot 0 (Core 0, 1ch mono) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 101 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - } - ] - 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 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.mfcc.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MFCC 101 bytes" - IncludeByKey.MWW_FEATURES { - "pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" - "agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" - } - } - mixer."1" { - name "MFCC 101 VAD" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs 640 - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MFCC_FRAME_BYTES - } - ] - } - - Object.Widget.mww.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MWW 101 bytes" - max 65536 - } - enum."1" { - name "MWW 101 Score" - - } - mixer."1" { - name "wovdebug_$index" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 102 — WOV slot 1 (Core 0, 1ch mono) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 102 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - } - ] - 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 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.mfcc.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MFCC 102 bytes" - IncludeByKey.MWW_FEATURES { - "pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" - "agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" - } - } - mixer."1" { - name "MFCC 102 VAD" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs 640 - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MFCC_FRAME_BYTES - } - ] - } - - Object.Widget.mww.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MWW 102 bytes" - max 65536 - } - enum."1" { - name "MWW 102 Score" - - } - mixer."1" { - name "wovdebug_$index" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 103 — WOV slot 2 (Core 0, 1ch mono) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 103 - format $FORMAT - rate 16000 - - Object.Widget.mixout.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_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - } - ] - 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 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.mfcc.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MFCC 103 bytes" - IncludeByKey.MWW_FEATURES { - "pcan" "include/components/mfcc/mel40_10ms_pcan_compress.conf" - "agc8" "include/components/mfcc/mel40_10ms_agc8_compress.conf" - } - } - mixer."1" { - name "MFCC 103 VAD" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs 640 - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MFCC_FRAME_BYTES - } - ] - } - - Object.Widget.mww.1 { - num_input_pins 1 - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Control { - bytes."1" { - name "MWW 103 bytes" - max 65536 - } - enum."1" { - name "MWW 103 Score" - - } - mixer."1" { - name "wovdebug_$index" - } - } - - 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 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs $MWW_INPUT_BYTES - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - -# --------------------------------------------------------------------------- -# Pipeline 104 — WOV Arbiter & Host Copier 11 (Core 0, Mono Output) -# --------------------------------------------------------------------------- -Object.Pipeline."custom-capture" [ - { - index 104 - format $FORMAT - rate 16000 - - Object.Widget.wov-arbiter.1 { - uuid $WOV_ARBITER_UUID - num_input_pins 4 - num_output_pins 1 - num_input_audio_formats 4 - num_output_audio_formats 1 - - Object.Base.input_pin_binding.1 { - input_pin_binding_name "kpb.106.1" - } - Object.Base.input_pin_binding.2 { - input_pin_binding_name "mww.101.1" - } - Object.Base.input_pin_binding.3 { - input_pin_binding_name "mww.102.1" - } - Object.Base.input_pin_binding.4 { - input_pin_binding_name "mww.103.1" - } - - Object.Base.input_audio_format [ - # Pin 0: Audio from KPB host_sink (32-bit PCM, 16kHz mono) - { - input_pin_index 0 - in_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - ibs 64 - } - # Pin 1: Features from MWW slot 0 (8-bit PCAN, 16kHz mono) - { - input_pin_index 1 - in_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - # Pin 2: Features from MWW slot 1 (8-bit PCAN, 16kHz mono) - { - input_pin_index 2 - in_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - # Pin 3: Features from MWW slot 2 (8-bit PCAN, 16kHz mono) - { - input_pin_index 3 - in_rate 16000 - in_channels 1 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - in_bit_depth 32 - in_valid_bit_depth 32 - ibs $MWW_INPUT_BYTES - } - ] - 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 32 - out_valid_bit_depth 32 - obs 64 - } - ] - } - - Object.Widget.host-copier.1 { - stream_name $DMIC_PCM_CAPS - pcm_id $DMIC_PCM_ID - node_type $HDA_HOST_INPUT_CLASS - direction "capture" - type "aif_out" - num_input_pins 1 - - # IPC4 reads SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 from the - # host-copier widget tuples, not from the PCM object, so the - # WoV stream must carry it here to stay up across S0iX in D0i3. - capture_compatible_d0i3 true - - 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 32 - in_valid_bit_depth 32 - } - ] - - num_output_audio_formats 3 - 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 - } - { - out_rate 16000 - out_channels 1 - out_ch_cfg $CHANNEL_CONFIG_MONO - out_ch_map $CHANNEL_MAP_MONO - out_bit_depth 32 - out_valid_bit_depth 24 - } - { - out_rate 16000 - out_channels 1 - out_ch_cfg $CHANNEL_CONFIG_MONO - out_ch_map $CHANNEL_MAP_MONO - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - } - - Object.Widget.pipeline.1 { - priority 0 - lp_mode 0 - core_id 0 - } - } -] - - -# --------------------------------------------------------------------------- -# Virtual Widgets -# --------------------------------------------------------------------------- -Object.Widget.virtual [ - { name "codec0_in" type input index 1 } - { name "codec1_in" type input index 2 } - { name "codec0_out" type output index 3 } - { name "codec1_out" type output index 4 } - { name "codec2_in" type input index 5 } - { name "codec2_out" type output index 6 } - { name "iDisp1_out" type output index 7 } - { name "iDisp2_out" type output index 8 } - { name "iDisp3_out" type output index 9 } - { name "iDisp3 Tx" type out_drv index 0 } - { name "iDisp2 Tx" type out_drv index 1 } - { name "iDisp1 Tx" type out_drv index 2 } - { name "Analog CPU Playback" type out_drv index 3 } - { name "Digital CPU Playback" type out_drv index 4 } - { name "Alt Analog CPU Playback" type out_drv index 5 } - { name "Analog CPU Capture" type input index 6 } - { name "Digital CPU Capture" type input index 7 } - { name "Alt Analog CPU Capture" type input index 8 } -] - -# --------------------------------------------------------------------------- -# Routes -# --------------------------------------------------------------------------- -Object.Base.route [ - # DMIC 4ch capture to ECNS - { source "dai-copier.DMIC.$DMIC_NAME.capture" sink "mixin.100.1" } - { source "mixin.100.1" sink "mixout.105.1" } - { source "mixout.105.1" sink "ecns.105.1" } - - # ECNS Output Pin 0 (mono) direct to KPB - { source "ecns.105.1" sink "kpb.106.1" } - { source "kpb.106.1" sink "mixin.106.1" } - - # ECNS Output Pin 1 (stereo) direct to Host Copier 10 - { source "ecns.105.1" sink "host-copier.$ECNS_PCM_ID.capture" } - - # Audio path from KPB host_sink (pin 1) to WOV Arbiter audio input (pin 0) - { source "kpb.106.1" sink "wov-arbiter.104.1" } - - # KPB mixin fanning out to 3 WOV detector slots (MFCC + MWW -> WOV Arbiter pins 1, 2, 3) - { source "mixin.106.1" sink "mixout.101.1" } - { source "mixout.101.1" sink "mfcc.101.1" } - { source "mfcc.101.1" sink "mww.101.1" } - { source "mww.101.1" sink "wov-arbiter.104.1" } - - { source "mixin.106.1" sink "mixout.102.1" } - { source "mixout.102.1" sink "mfcc.102.1" } - { source "mfcc.102.1" sink "mww.102.1" } - { source "mww.102.1" sink "wov-arbiter.104.1" } - - { source "mixin.106.1" sink "mixout.103.1" } - { source "mixout.103.1" sink "mfcc.103.1" } - { source "mfcc.103.1" sink "mww.103.1" } - { source "mww.103.1" sink "wov-arbiter.104.1" } - - # WOV Arbiter output to Host Copier 11 - { source "wov-arbiter.104.1" sink "host-copier.$DMIC_PCM_ID.capture" } -] - -# --------------------------------------------------------------------------- -# DMIC DAI (Two Endpoints: Endpoint 0 @ 48kHz, Endpoint 1 @ 16kHz) -# --------------------------------------------------------------------------- -Object.Dai.DMIC [ - { - name "dmic01" - dai_index 0 - id 6 - driver_version $DMIC_DRIVER_VERSION - io_clk 38400000 - sample_rate 48000 - clk_min 500000 - clk_max 4800000 - unmute_ramp_time_ms 200 - num_pdm_active 2 - - Object.Base.hw_config.1 { - id 0 - name "DMIC0" - } - - Object.Base.pdm_config.1 { - ctrl_id 0 - mic_a_enable 1 - mic_b_enable 1 - } - Object.Base.pdm_config.2 { - ctrl_id 1 - mic_a_enable 1 - mic_b_enable 1 - } - } - { - name "dmic16k" - dai_index 1 - id 7 - driver_version $DMIC_DRIVER_VERSION - io_clk 38400000 - sample_rate 16000 - clk_min 500000 - clk_max 4800000 - unmute_ramp_time_ms 200 - num_pdm_active 2 - - Object.Base.hw_config.1 { - id 0 - name "DMIC1" - } - - Object.Base.pdm_config.1 { - ctrl_id 0 - mic_a_enable 1 - mic_b_enable 1 - } - Object.Base.pdm_config.2 { - ctrl_id 1 - mic_a_enable 1 - mic_b_enable 1 - } - } -] - -# --------------------------------------------------------------------------- -# PCM 10 (ECNS Stereo Capture PCM) -# --------------------------------------------------------------------------- -Object.PCM.pcm."$ECNS_PCM_ID" { - name "DMIC ECNS Capture" - id $ECNS_PCM_ID - direction "capture" - capture_compatible_d0i3 true - - Object.Base.fe_dai."$ECNS_PCM_CAPS" {} - - Object.PCM.pcm_caps."capture" { - name $ECNS_PCM_CAPS - formats "S16_LE,S24_LE,S32_LE" - rates "16000" - channels_min 2 - channels_max 2 - } -} - -# --------------------------------------------------------------------------- -# PCM 11 (WOV Arbiter Mono Capture PCM) -# --------------------------------------------------------------------------- -Object.PCM.pcm."$DMIC_PCM_ID" { - name "DMIC Multi-WOV" - id $DMIC_PCM_ID - direction "capture" - capture_compatible_d0i3 true - - Object.Base.fe_dai."$DMIC_PCM_CAPS" {} - - Object.PCM.pcm_caps."capture" { - name $DMIC_PCM_CAPS - formats "S16_LE,S24_LE,S32_LE" - rates "16000" - channels_min 1 - channels_max 1 - } -} - -# --------------------------------------------------------------------------- -# Manifest -# --------------------------------------------------------------------------- -Object.Base.manifest.1 { - name "sof_manifest" - nhlt "true" - Object.Base.data.1 { - name "SOF ABI" - bytes "0x03,0x00,0x1d,0x00,0x01,0x00" - } -} diff --git a/tools/topology/topology2/production/tplg-targets-ace3.cmake b/tools/topology/topology2/production/tplg-targets-ace3.cmake index cb7c541d5297..1ff5c577ecb0 100644 --- a/tools/topology/topology2/production/tplg-targets-ace3.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace3.cmake @@ -337,11 +337,6 @@ BT_CP_HOST_PIPELINE_ID=201,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-ssp2-bt # Multi-slot WOV topologies for PTL and WCL "dmic-wov-multi-ptl-manifest\;sof-ptl-dmic-wov-multi\;" -"dmic-wov-multi-ptl-4ch-manifest\;sof-ptl-dmic-wov-multi-4ch\;" - -# DMIC multi-slot WoV feature topologies (always uses PDM DMICs for input) -"dmic-wov-feature\;sof-dmic-4ch-wov-multi\;PLATFORM=none,NUM_DMICS=4,DMIC0_ID=5,DMIC1_ID=6,DMIC1_ENABLE=false,DMIC1_RATE=16000,DMIC_WOV_DAI_CHANNELS=4,WOV_SLOT_COUNT=3" -"dmic-wov-feature\;sof-ptl-dmic-4ch-wov-multi\;PLATFORM=ptl,NUM_DMICS=4,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-dmic-4ch-wov-multi.bin,DMIC_WOV_DAI_CHANNELS=4,WOV_SLOT_COUNT=3" # Functional SoundWire topologies with integrated multi-slot WoV feature "cavs-sdw\;sof-ptl-rt721-4ch-wov-multi\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,\ @@ -388,8 +383,6 @@ list(APPEND SYMLINKS "sof-wcl-dmic-4ch-id4\;sof-ptl-dmic-4ch-id4" "sof-wcl-dmic-4ch-id5\;sof-ptl-dmic-4ch-id5" "sof-wcl-dmic-wov-multi\;sof-ptl-dmic-wov-multi" -"sof-wcl-dmic-wov-multi-4ch\;sof-ptl-dmic-wov-multi-4ch" -"sof-wcl-dmic-4ch-wov-multi\;sof-ptl-dmic-4ch-wov-multi" "sof-wcl-rt721-4ch-wov-multi\;sof-ptl-rt721-4ch-wov-multi" "sof-wcl-rt721-2ch-wov-multi\;sof-ptl-rt721-2ch-wov-multi" "sof-wcl-rt722-4ch-wov-multi\;sof-ptl-rt722-4ch-wov-multi" diff --git a/tools/topology/topology2/production/tplg-targets-cavs25.cmake b/tools/topology/topology2/production/tplg-targets-cavs25.cmake index 1a37af1d77b8..977cc29846f1 100644 --- a/tools/topology/topology2/production/tplg-targets-cavs25.cmake +++ b/tools/topology/topology2/production/tplg-targets-cavs25.cmake @@ -53,7 +53,4 @@ NUM_SDW_AMP_LINKS=1,SDW_AMP_FEEDBACK=false,SDW_DMIC=1,SDW_DMIC_STREAM=Capture-Sm PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-adl-rt711-4ch.bin,\ HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" - -# 4-Channel 16kHz Multi-slot WOV topology for TGL -"dmic-wov-multi-4ch-manifest\;sof-tgl-dmic-wov-multi-4ch\;" ) From 85a14a80beb6d0411bf387c3a31fa5449e24931e Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 20 Nov 2026 16:42:21 +0200 Subject: [PATCH 2/7] audio: ecns: take the speaker echo reference into the second input Change the ECNS input pin 1 from the 48 kHz DMIC stream to a 16 kHz speaker echo reference. Input pin 0 stays the 16 kHz DMIC stream and there is now a single output pin with 16 kHz mono to the KPB. The 48 kHz host output pin and its high-pass filter are removed, the topology captures the 48 kHz DMIC with the regular DMIC pipelines. The 100 Hz high-pass filter and the capture boost switch of the output are kept. The microphone downmix channel selection is changed from the CONFIG_ECNS_KPB_MONO_AVG_* Kconfig choice to a new enum control. The default value averages all microphone channels, the other values select a single channel Mic1 to Mic4. A channel beyond the input channel count falls back to the average. The new AEC switch control subtracts the average of the echo reference channels from the filtered output. The new NS switch control has no function yet. Both are off by default. The echo reference is always consumed, missing frames are processed as zero. The test signal switch is removed. The output sample format is not in the IPC4 base config of ECNS, so it is taken from the input format bit depth of the consumer, s16 or s32. Signed-off-by: Seppo Ingalsuo --- app/boards/intel_adsp_ace30_ptl.conf | 1 - app/boards/intel_adsp_ace30_wcl.conf | 1 - app/boards/intel_adsp_ace40_nvl.conf | 1 - app/boards/intel_adsp_cavs25.conf | 1 - src/audio/Kconfig | 62 +- src/audio/ecns/README.md | 207 ++--- src/audio/ecns/ecns.c | 1144 ++++++++------------------ src/audio/ecns/ecns.toml | 1 + src/include/sof/audio/ecns.h | 33 +- 9 files changed, 432 insertions(+), 1019 deletions(-) diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index ca6e3130289a..8ed644019a34 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -23,7 +23,6 @@ CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_KPB_MAX_BUFF_TIME=2000 CONFIG_COMP_ECNS=y -CONFIG_ECNS_TEST_SIGNAL=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/app/boards/intel_adsp_ace30_wcl.conf b/app/boards/intel_adsp_ace30_wcl.conf index 89805dc7dc74..5ba0ec43d7c7 100644 --- a/app/boards/intel_adsp_ace30_wcl.conf +++ b/app/boards/intel_adsp_ace30_wcl.conf @@ -24,7 +24,6 @@ CONFIG_COMP_MIXIN_MIXOUT=y CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_COMP_ECNS=y -CONFIG_ECNS_TEST_SIGNAL=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/app/boards/intel_adsp_ace40_nvl.conf b/app/boards/intel_adsp_ace40_nvl.conf index e12395f53385..e39b817e90fe 100644 --- a/app/boards/intel_adsp_ace40_nvl.conf +++ b/app/boards/intel_adsp_ace40_nvl.conf @@ -23,7 +23,6 @@ CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_KPB_MAX_BUFF_TIME=2000 CONFIG_COMP_ECNS=y -CONFIG_ECNS_TEST_SIGNAL=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/app/boards/intel_adsp_cavs25.conf b/app/boards/intel_adsp_cavs25.conf index bd653610bbac..c6b72a40aa9f 100644 --- a/app/boards/intel_adsp_cavs25.conf +++ b/app/boards/intel_adsp_cavs25.conf @@ -13,7 +13,6 @@ CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_KPB_MAX_BUFF_TIME=2000 CONFIG_COMP_ECNS=y -CONFIG_ECNS_KPB_MONO_AVG_ALL=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 766a19e4f5ce..145662429f5a 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -121,62 +121,24 @@ config COMP_ECNS select MATH_IIR_DF1 help Select to build the ECNS (Echo Cancellation and Noise Suppression) - Data Processing (DP) component. Operates with a 20ms period to process - 4 DMIC channels (2 mics + 2 echo references) and outputs clean mono - to KPB and clean stereo to host capture. + 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 + subtracts the echo reference from the output. The NS switch + control has no function yet. if COMP_ECNS -choice - prompt "ECNS mono downmix source channels for KPB output" - default ECNS_KPB_MONO_AVG_ALL - help - Selects which pin0 input channels ECNS averages into the mono - detection output sent to KPB. Channel indices out of range for the - current input stream are skipped, falling back to all channels. - -config ECNS_KPB_MONO_AVG_ALL - bool "Average all available input channels" - help - Average every available pin0 input channel into the mono output. - -config ECNS_KPB_MONO_AVG_CH_1_2 - bool "Average input channels 1 and 2" - help - Average the first two input channels (indices 0 and 1). - -config ECNS_KPB_MONO_AVG_CH_3_4 - bool "Average input channels 3 and 4" - help - Average the third and fourth input channels (indices 2 and 3). - Useful when the first mic pair is poor quality. - -endchoice - config ECNS_KPB_HPF - bool "ECNS 100 Hz high-pass filter on KPB output" + bool "ECNS 100 Hz high-pass filter on output" default y help - Filter the ECNS mono KPB output (Pin 0) with a built-in 100 Hz - second-order high-pass IIR with +20 dB gain. When disabled, the - mono downmix is passed through with only s16/s32 format conversion. - -config ECNS_HOST_HPF - bool "ECNS 40 Hz high-pass filter on host output" - default y - help - Filter each channel of the ECNS host output (Pin 1) with a built-in - 40 Hz second-order high-pass IIR with +20 dB gain. When disabled, - the Pin 1 data is passed through with only s16/s32 format conversion. - -config ECNS_TEST_SIGNAL - bool "ECNS test signal generator support" - default n - help - Enable support for the test signal generator on the ECNS clean mono - output pin (Pin 0 to KPB). When enabled, a monotonic incrementing - counter can be selected via ALSA control instead of microphone audio - to verify data continuity through the detection path. + Filter the ECNS mono output with a built-in 100 Hz second-order + high-pass IIR with +30 dB gain, or 0 dB gain when the capture boost + control is off. When disabled, the mono signal is passed through + with only s16/s32 format conversion. endif # COMP_ECNS diff --git a/src/audio/ecns/README.md b/src/audio/ecns/README.md index 48e6ca59b9c7..d2e3a74c36e7 100644 --- a/src/audio/ecns/README.md +++ b/src/audio/ecns/README.md @@ -2,150 +2,97 @@ ## Overview -The `ecns` component is an IPC4 Data Processing (DP) module operating at a 20 ms period. It supports dual-stream, dual-rate microphone capture and preprocessing, connecting directly to physical PDM digital microphone interfaces: -- **Input Pin 0 (`dmic16k` on PDM1)**: 16 kHz stereo (2-channel, 16-bit `S16_LE`) dedicated speech capture stream. -- **Input Pin 1 (`dmic01` on PDM0)**: 48 kHz stereo (2-channel, 16-bit `S16_LE`) high-resolution capture stream. - -The module performs echo cancellation, noise suppression, and channel routing, delivering two distinct output streams via separate output pins: -1. **Output Pin 0 (Mono Clean Speech / Keyword Stream)**: Operates at 16 kHz. Extracts the Left channel from Input Pin 0 and delivers a single-channel mono clean stream to the Key Phrase Buffer (`kpb.116.1`) and downstream microWakeWord (`mww`) keyword detection slots. Triggers deliver pre-roll and live speech to the host via the WOV Arbiter (`PCM 12`, `hw:0,12`). -2. **Output Pin 1 (Stereo Clean Speech Stream)**: Operates at 48 kHz. Filters each channel of Input Pin 1 with a built-in 40 Hz second-order high-pass IIR (DF1, +20 dB gain, `CONFIG_ECNS_HOST_HPF`, default `y`; when disabled the data is passed through with only s16/s32 conversion) and delivers the stereo or 4-channel clean stream to host capture (`host-copier.11.capture`, `PCM 11`, `hw:0,11`). - -Both capture endpoints support low-power D0i3 listening and wake (`capture_compatible_d0i3: true`). - -The `ECNS capture boost` switch control selects between the boosted high-pass responses (+30 dB 100 Hz on Pin 0 with `CONFIG_ECNS_KPB_HPF`, +20 dB 40 Hz on Pin 1) and the same filters with 0 dB gain. The firmware keeps duplicate coefficient sets and only moves the IIR coefficient pointers, so the filter state is kept. The firmware starts boosted, but the kernel sends the switch value (default off, 0 dB) when the widget is set up. The `ecns_kpb_test_signal` switch replaces Pin 0 output with a test ramp (`CONFIG_ECNS_TEST_SIGNAL`). - ---- - -## Topology Architecture +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: + +- **Input Pin 0**: 16 kHz microphone stream from the `dmic16k` DMIC DAI copier, + 2 or 4 channels, 16 or 32 bit. +- **Input Pin 1**: 16 kHz stereo speaker echo reference, 16 or 32 bit. The + 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. + +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. +2. Filter with the built-in 100 Hz second-order high-pass IIR + (`CONFIG_ECNS_KPB_HPF`, default `y`). +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. + +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 +frames are processed as zero. When the output is not active or is full, both +inputs are drained to prevent upstream overruns. + +## Controls + +The switch controls are identified by their order in the widget class +`tools/topology/topology2/include/components/ecns.conf`: + +| Index | Topology name (DMIC WoV) | Function | Default | +|---|---|---|---| +| 0 | `DMIC ECNS boost` | 100 Hz high-pass with +30 dB gain when on, 0 dB when off | off | +| 1 | `DMIC ECNS AEC switch` | Subtract the echo reference from the output | off | +| 2 | `DMIC ECNS NS switch` | Noise suppression, no function yet | off | + +The microphone channel enum control is the only enum control, index 0. It is +added in the widget instance with +`tools/topology/topology2/include/components/ecns/mic_sel_2ch.conf` or +`mic_sel_4ch.conf` to match the pin 0 channel count: + +| 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 | | + +A channel beyond the input channel count falls back to the 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 +boosted, but the kernel sends the switch value when the widget is set up. + +## Topology ```mermaid flowchart TD - %% Hardware PDM Interfaces - subgraph PDM_INTERFACES ["Digital Microphone Interfaces (2 Separate PDM DAIs)"] - direction LR - PDM_48K["PDM Interface: dmic01
DAI Index: 0 (PDM0)
Rate: 48 kHz · 2ch Stereo · 16-bit"] - PDM_16K["PDM Interface: dmic16k
DAI Index: 1 (PDM1)
Rate: 16 kHz · 2ch Stereo · 16-bit"] - end - - %% Pipeline 110: 48 kHz DAI Capture - subgraph P110 ["Pipeline 110: 48 kHz DAI Capture (Core 0, LL 1ms)"] - DAI_48K["dai-copier.DMIC.dmic01.capture
(48 kHz · 2ch · S16_LE)"] - MIXIN_110["mixin.110.1
(48 kHz · 2ch)"] - DAI_48K --> MIXIN_110 - end - - %% Pipeline 119: 16 kHz DAI Capture - subgraph P119 ["Pipeline 119: 16 kHz DAI Capture (Core 0, LL 1ms)"] - DAI_16K["dai-copier.DMIC.dmic16k.capture
(16 kHz · 2ch · S16_LE)"] - MIXIN_119["mixin.119.1
(16 kHz · 2ch)"] - DAI_16K --> MIXIN_119 - end - - PDM_48K --> DAI_48K - PDM_16K --> DAI_16K - - %% Pipeline 115: Dual-Rate ECNS DP Pipeline - subgraph P115 ["Pipeline 115: ECNS Engine (Core 0, DP 20ms, lp_mode 1)"] - direction TB - - MIXOUT_115_2["mixout.115.2
(Pin 0 In: 16 kHz · 2ch stereo)"] - MIXOUT_115_1["mixout.115.1
(Pin 1 In: 48 kHz · 2ch stereo)"] - - ECNS["ecns.115.1 (DP Component · 20ms Period)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Pin 0 In: 16 kHz, 2ch (IBS 1280 bytes)
Pin 1 In: 48 kHz, 2ch (IBS 3840 bytes)
─────────────────────────────
Processing:
• Pin 0: Extract Left Ch → 16k Mono Clean
• Pin 1: 40 Hz HPF +20 dB → 48k Stereo Clean
─────────────────────────────
Pin 0 Out: 16 kHz, 1ch mono (OBS 640 bytes)
Pin 1 Out: 48 kHz, 2ch stereo (OBS 3840 bytes)"] - - MIXOUT_115_2 -->|"Pin 0 In (16k)"| ECNS - MIXOUT_115_1 -->|"Pin 1 In (48k)"| ECNS - end - - MIXIN_119 --> MIXOUT_115_2 - MIXIN_110 --> MIXOUT_115_1 - - %% Pipeline 117: Host Capture PCM 11 - subgraph P117 ["Pipeline 117: ECNS Clean Host Capture (Core 0, LL 1ms)"] - HOST_11["host-copier.11.capture
(PCM 11: 'DMIC ECNS Capture'
hw:0,11 · d0i3_compatible=true)"] - end - - %% Pipeline 116: KPB History Buffer - subgraph P116 ["Pipeline 116: Key Phrase Buffer (Core 0, DP 20ms)"] - KPB["kpb.116.1
(2000 ms mono history = 64 KB)"] - MIXIN_116["mixin.116.1
(3-way detector fanout)"] - KPB -->|"Pin 0 (Live Feed)"| MIXIN_116 - end - - ECNS -->|"Pin 1 Out (Stereo 48k clean direct)"| HOST_11 - ECNS -->|"Pin 0 Out (Mono 16k clean direct)"| KPB - - %% WoV 3-Slot Detector Subgraph - subgraph SLOTS ["Wake-on-Voice Keyword Detector Slots (16 kHz mono)"] - subgraph S1 ["Slot 0 (Pipeline 111)"] - M1["mixout.111.1"] --> MF1["mfcc.111.1"] --> MW1["mww.111.1"] - end - subgraph S2 ["Slot 1 (Pipeline 112)"] - M2["mixout.112.1"] --> MF2["mfcc.112.1"] --> MW2["mww.112.1"] - end - subgraph S3 ["Slot 2 (Pipeline 113)"] - M3["mixout.113.1"] --> MF3["mfcc.113.1"] --> MW3["mww.113.1"] - end - end - - MIXIN_116 --> M1 - MIXIN_116 --> M2 - MIXIN_116 --> M3 - - %% 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)"] - ARB --> HOST_12 - end - - KPB -->|"Pin 1 (Host Sink Drain)"| ARB - MW1 -->|"Pin 1 (Trigger 0)"| ARB - MW2 -->|"Pin 2 (Trigger 1)"| ARB - MW3 -->|"Pin 3 (Trigger 2)"| ARB - - style ECNS fill:#1b4f72,stroke:#555,color:#fff - style KPB fill:#1c4966,stroke:#555,color:#fff - style ARB fill:#4a235a,stroke:#555,color:#fff - style HOST_11 fill:#1e8449,stroke:#555,color:#fff - style HOST_12 fill:#2d5a27,stroke:#555,color:#fff + DMIC16K["dai-copier.DMIC.dmic16k.capture
16 kHz · 2/4ch · s32"] + 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"] + 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 + 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 +`tools/topology/topology2/platform/intel/dmic-generic.conf`, without the +TDFB and DRC enhancements. ## Specifications | Parameter | Specification | |---|---| | Module UUID | `6c:8a:4f:21:3a:49:1e:4b:8b:1e:0d:3b:6f:8a:2c:15` | -| Processing Domain | DP (Data Processing) thread (`lp_mode 1`) | -| Execution Period | 20 ms (320 frames at 16 kHz / 960 frames at 48 kHz) | -| Input Pin 0 | 16 kHz · 2 channels (Stereo from `dmic16k`) · `S16_LE` · IBS = 1280 bytes (20ms) | -| Input Pin 1 | 48 kHz · 2 channels (Stereo from `dmic01`) · `S16_LE` · IBS = 3840 bytes (20ms) | -| Output Pin 0 | 16 kHz · 1 channel (Mono left channel clean) · `S16_LE` · OBS = 640 bytes (20ms) | -| Output Pin 1 | 48 kHz · 2 channels (Stereo clean, 40 Hz HPF +20 dB) · `S16_LE` · OBS = 3840 bytes (20ms) | -| Sinks Acceptance | Independent sink buffer limit checks (`kpb_frames` vs `host_frames`) | +| 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 | | Dynamic Pipeline | Compatible (`dynamic_pipeline 1`) | | Power States | S0 active streaming and D0i3 low-power listening supported | ---- - -## Verification & Usage - -### 1. Recording Clean Stereo Audio (Output Pin 1 / PCM 11) -Capture the continuous 48 kHz clean stereo microphone stream: -```bash -arecord -D hw:0,11 -c 2 -r 48000 -f S16_LE -d 3 /tmp/ecns_stereo_48k.wav -``` - -### 2. Recording Keyword Detection & History Buffer Audio (Output Pin 0 / PCM 12) -Capture the gated 16 kHz mono speech stream delivered by the WOV Arbiter upon keyword trigger: -```bash -arecord -D hw:0,12 -c 1 -r 16000 -f S16_LE -d 3 /tmp/wov_mono_16k.wav -``` - ---- - ## Further Reading - [Topology2 Architecture & Verification Runbook](../../../tools/topology/topology2/README.md) - [WOV Arbiter Architecture & State Machine](../wov_arbiter/README.md) diff --git a/src/audio/ecns/ecns.c b/src/audio/ecns/ecns.c index bc61d4c17f27..c2fd2250a61f 100644 --- a/src/audio/ecns/ecns.c +++ b/src/audio/ecns/ecns.c @@ -3,6 +3,19 @@ * Copyright(c) 2026 Intel Corporation. All rights reserved. */ +/** + * \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. + */ + #include #include #include @@ -30,54 +43,63 @@ LOG_MODULE_REGISTER(ecns, CONFIG_SOF_LOG_LEVEL); SOF_DEFINE_REG_UUID(ecns); DECLARE_TR_CTX(ecns_tr, SOF_UUID(ecns_uuid), LOG_LEVEL_INFO); -/* Determine the source-channel averaging window [start, start+cnt) used to - * downmix the pin0 input to the mono KPB detection output. Selection is a - * Kconfig choice; out-of-range channels fall back to all available channels. +/** + * \brief Get the microphone channels used for the mono 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. + * + * \param[in] mic_sel Microphone channel enum control value + * \param[in] ch Number of microphone input channels + * \param[out] start First channel index to average + * \param[out] cnt Number of channels to average */ -static inline void ecns_mono_window(uint32_t ch, uint32_t *start, uint32_t *cnt) +static inline void ecns_mono_window(uint32_t mic_sel, uint32_t ch, uint32_t *start, + uint32_t *cnt) { -#if CONFIG_ECNS_KPB_MONO_AVG_CH_1_2 - *start = 0; - *cnt = MIN(2, ch); -#elif CONFIG_ECNS_KPB_MONO_AVG_CH_3_4 - if (ch > 2) { - *start = 2; - *cnt = MIN(2, ch - 2); + if (mic_sel != ECNS_MIC_SEL_AVERAGE && mic_sel <= ch) { + *start = mic_sel - 1; + *cnt = 1; } else { *start = 0; - *cnt = ch; + *cnt = ch ? ch : 1; } -#else /* CONFIG_ECNS_KPB_MONO_AVG_ALL */ - *start = 0; - *cnt = ch; -#endif - if (*cnt == 0) - *cnt = 1; } -static inline int32_t ecns_mono_s32(const int32_t *frame, uint32_t start, uint32_t cnt) +/** + * \brief Average channels of one interleaved frame into 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] start First channel index to average + * \param[in] cnt Number of channels to average, must be non-zero + * \return Average of the channels as Q1.31 + */ +static inline int32_t ecns_frame_avg(const void *frame, bool s32, uint32_t start, uint32_t cnt) { int64_t acc = 0; + uint32_t c; - for (uint32_t c = 0; c < cnt; c++) - acc += frame[start + c]; - return (int32_t)(acc / (int32_t)cnt); -} + if (s32) { + const int32_t *x = (const int32_t *)frame + start; -static inline int16_t ecns_mono_s16(const int16_t *frame, uint32_t start, uint32_t cnt) -{ - int32_t acc = 0; + for (c = 0; c < cnt; c++) + acc += x[c]; + } else { + const int16_t *x = (const int16_t *)frame + start; + + for (c = 0; c < cnt; c++) + acc += (int32_t)x[c] << 16; + } - for (uint32_t c = 0; c < cnt; c++) - acc += frame[start + c]; - return (int16_t)(acc / (int32_t)cnt); + return (int32_t)(acc / (int32_t)cnt); } #if CONFIG_ECNS_KPB_HPF /** * \brief 100 Hz second-order high-pass filter with +30 dB gain at 16 kHz. * - * Built-in coefficient set for the KPB detection path (Pin 0 mono mix). * Converted from tools/topology/topology2/include/components/eqiir/highpass_100hz_30db_16khz.conf * consisting of struct sof_eq_iir_header (6 words) followed by one * struct sof_eq_iir_biquad (7 words): @@ -100,102 +122,39 @@ static const uint32_t hp_100hz_0db_16k[13] = { }; #endif -#if CONFIG_ECNS_HOST_HPF -/** - * \brief 40 Hz second-order high-pass filters with +20 dB gain for Pin 1. - * - * Converted from highpass_40hz_20db_48khz.conf and highpass_40hz_20db_16khz.conf - * in tools/topology/topology2/include/components/eqiir/ with the same layout - * as hp_100hz_30db_16k. - */ -static const uint32_t hp_40hz_20db_48k[13] = { - 0x00000001, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0xc078df4c, 0x7f86ae23, - 0x1ff51b12, 0xc015c9db, 0x1ff51b12, 0xfffffffc, - 0x00004fd0 -}; - -static const uint32_t hp_40hz_20db_16k[13] = { - 0x00000001, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0xc167f2ba, 0x7e940dc3, - 0x1fb8bfff, 0xc08e8003, 0x1fb8bfff, 0xfffffffc, - 0x00004fd0 -}; - -/** - * \brief 40 Hz high-pass filters with 0 dB gain for Pin 1. - * - * From highpass_40hz_0db_48khz.conf and highpass_40hz_0db_16khz.conf. - */ -static const uint32_t hp_40hz_0db_48k[13] = { - 0x00000001, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0xc078df4c, 0x7f86ae23, - 0x1ff51b12, 0xc015c9db, 0x1ff51b12, 0x00000000, - 0x00007fb2 -}; - -static const uint32_t hp_40hz_0db_16k[13] = { - 0x00000001, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0xc167f2ba, 0x7e940dc3, - 0x1fb8bfff, 0xc08e8003, 0x1fb8bfff, 0x00000000, - 0x00007fb2 -}; - -#define ECNS_HOST_MAX_CHANNELS 4 -#endif - -/* Switch control indexes, mixer."1" and mixer."2" in ecns.conf */ +/** \brief Switch control indexes, mixer."1" to mixer."3" in ecns.conf */ #define ECNS_CTRL_INDEX_CAPTURE_BOOST 0 -#define ECNS_CTRL_INDEX_TEST_SIGNAL 1 +#define ECNS_CTRL_INDEX_AEC 1 +#define ECNS_CTRL_INDEX_NS 2 + +/** \brief Enum control indexes, enum."1" in the ECNS widget instance */ +#define ECNS_CTRL_INDEX_MIC_SEL 0 +/** \brief ECNS component private data */ struct ecns_comp_data { - struct ipc4_base_module_cfg base_cfg; - uint32_t sample_rate; - uint32_t channels; - uint32_t sample_width; - uint32_t test_signal_enabled; - bool capture_boost; - bool capture_boost_req; - uint16_t test_signal_val; - struct iir_state_df1 hp_iir; - int32_t *hp_delay; -#if CONFIG_ECNS_HOST_HPF - struct iir_state_df1 host_iir[ECNS_HOST_MAX_CHANNELS]; - int32_t *host_delay; - int host_delay_size; - uint32_t host_rate; -#endif + struct ipc4_base_module_cfg base_cfg; /**< IPC4 base config, pin 0 input format */ + 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 */ }; #if CONFIG_ECNS_KPB_HPF -static struct sof_eq_iir_header *ecns_kpb_iir_coef(struct ecns_comp_data *cd) +static struct sof_eq_iir_header *ecns_iir_coef(struct ecns_comp_data *cd) { return (struct sof_eq_iir_header *) (cd->capture_boost ? hp_100hz_30db_16k : hp_100hz_0db_16k); } #endif -#if CONFIG_ECNS_HOST_HPF -static struct sof_eq_iir_header *ecns_host_iir_coef(struct ecns_comp_data *cd) -{ - if (cd->host_rate == 16000) - return (struct sof_eq_iir_header *) - (cd->capture_boost ? hp_40hz_20db_16k : hp_40hz_0db_16k); - - return (struct sof_eq_iir_header *) - (cd->capture_boost ? hp_40hz_20db_48k : hp_40hz_0db_48k); -} -#endif - -/* Only the coefficient pointers move, the filter delay lines are kept. */ +/* Only the coefficient pointers move, the filter delay line is kept. */ static void ecns_update_iir_coef(struct ecns_comp_data *cd) { #if CONFIG_ECNS_KPB_HPF - iir_init_coef_df1(&cd->hp_iir, ecns_kpb_iir_coef(cd)); -#endif -#if CONFIG_ECNS_HOST_HPF - for (int c = 0; c < ECNS_HOST_MAX_CHANNELS; c++) - iir_init_coef_df1(&cd->host_iir[c], ecns_host_iir_coef(cd)); + iir_init_coef_df1(&cd->hp_iir, ecns_iir_coef(cd)); #endif } @@ -203,11 +162,17 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv, const struct comp_ipc_config *config, const void *spec) { - struct comp_dev *dev; + const struct ipc4_base_module_cfg *base_cfg = spec; struct ecns_comp_data *cd; + struct comp_dev *dev; comp_cl_info(drv, "ecns_new"); + if (!base_cfg) { + comp_cl_err(drv, "ecns_new: no base config"); + return NULL; + } + dev = comp_alloc(drv, sizeof(*dev)); if (!dev) return NULL; @@ -220,17 +185,7 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv, return NULL; } - const struct ipc4_base_module_cfg *base_cfg = spec; - if (base_cfg) { - memcpy_s(&cd->base_cfg, sizeof(cd->base_cfg), base_cfg, sizeof(*base_cfg)); - cd->sample_rate = base_cfg->audio_fmt.sampling_frequency; - cd->channels = base_cfg->audio_fmt.channels_count; - cd->sample_width = base_cfg->audio_fmt.valid_bit_depth; - } else { - cd->sample_rate = 48000; - cd->channels = ECNS_IN_CHANNELS; - cd->sample_width = 16; - } + memcpy_s(&cd->base_cfg, sizeof(cd->base_cfg), base_cfg, sizeof(*base_cfg)); comp_set_drvdata(dev, cd); dev->direction = SOF_IPC_STREAM_CAPTURE; @@ -242,7 +197,7 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv, cd->capture_boost_req = true; #if CONFIG_ECNS_KPB_HPF - struct sof_eq_iir_header *hp_hdr = ecns_kpb_iir_coef(cd); + struct sof_eq_iir_header *hp_hdr = ecns_iir_coef(cd); int hp_size = iir_delay_size_df1(hp_hdr); int32_t *delay; @@ -264,29 +219,10 @@ static struct comp_dev *ecns_new(const struct comp_driver *drv, iir_init_delay_df1(&cd->hp_iir, &delay); #endif -#if CONFIG_ECNS_HOST_HPF - /* The 48 kHz and 16 kHz Pin 1 filters have the same section count */ - int host_size = iir_delay_size_df1((struct sof_eq_iir_header *)hp_40hz_20db_48k); - - if (host_size < 0) { - rfree(cd->hp_delay); - rfree(cd); - comp_free_device(dev); - return NULL; - } - - cd->host_delay_size = host_size * ECNS_HOST_MAX_CHANNELS; - cd->host_delay = rzalloc(SOF_MEM_FLAG_USER, cd->host_delay_size); - if (!cd->host_delay) { - rfree(cd->hp_delay); - rfree(cd); - comp_free_device(dev); - return NULL; - } -#endif - - comp_info(dev, "ecns_new: rate=%u in_ch=%u sample_width=%u", - cd->sample_rate, cd->channels, cd->sample_width); + comp_info(dev, "ecns_new: rate=%u in_ch=%u valid_bits=%u", + base_cfg->audio_fmt.sampling_frequency, + base_cfg->audio_fmt.channels_count, + base_cfg->audio_fmt.valid_bit_depth); return dev; } @@ -296,9 +232,6 @@ static void ecns_free(struct comp_dev *dev) struct ecns_comp_data *cd = comp_get_drvdata(dev); comp_info(dev, "ecns_free"); -#if CONFIG_ECNS_HOST_HPF - rfree(cd->host_delay); -#endif rfree(cd->hp_delay); rfree(cd); comp_free_device(dev); @@ -316,99 +249,59 @@ static int ecns_params(struct comp_dev *dev, struct sof_ipc_stream_params *param return 0; } -#if CONFIG_ECNS_HOST_HPF -static void ecns_host_iir_init(struct ecns_comp_data *cd, uint32_t rate) +/** + * \brief Get the output sample container depth. + * + * 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. + * + * \param[in] dev ECNS component device + * \param[in] sink Output buffer + * \return 16 or 32 + */ +static uint32_t ecns_out_depth(struct comp_dev *dev, struct comp_buffer *sink) { - struct sof_eq_iir_header *hdr; - int32_t *delay = cd->host_delay; - - cd->host_rate = rate; - hdr = ecns_host_iir_coef(cd); - memset_s(cd->host_delay, cd->host_delay_size, 0, cd->host_delay_size); - for (int c = 0; c < ECNS_HOST_MAX_CHANNELS; c++) { - iir_init_coef_df1(&cd->host_iir[c], hdr); - iir_init_delay_df1(&cd->host_iir[c], &delay); - } -} + struct comp_dev *consumer = comp_buffer_get_sink_component(sink); + struct ipc4_base_module_cfg cfg; -static inline int32_t ecns_host_filter(struct ecns_comp_data *cd, uint32_t c, int32_t x) -{ - return c < ECNS_HOST_MAX_CHANNELS ? iir_df1(&cd->host_iir[c], x) : x; -} -#else -static void ecns_host_iir_init(struct ecns_comp_data *cd, uint32_t rate) -{ -} + if (consumer && !comp_get_attribute(consumer, COMP_ATTR_BASE_CONFIG, &cfg) && + cfg.audio_fmt.depth == 16) + return 16; -static inline int32_t ecns_host_filter(struct ecns_comp_data *cd, uint32_t c, int32_t x) -{ - return x; + return 32; } -#endif static int ecns_prepare(struct comp_dev *dev) { struct ecns_comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer *src0 = NULL; - struct comp_buffer *src1 = NULL; - struct comp_buffer *source; struct comp_buffer *sink; comp_info(dev, "ecns_prepare"); - /* Output buffer formats must match the topology-declared pins: - * pin0 -> KPB mono 16 kHz, pin1 -> host. - * When src1 (48 kHz producer) is present, use dual-rate 16-bit formats. - * When src1 is absent (single 16 kHz DMIC input), use 32-bit formats matching the manifest. - */ - comp_dev_for_each_producer(dev, source) { - uint32_t pin = IPC4_SINK_QUEUE_ID(buf_get_id(source)); - - if (pin == ECNS_PIN_16K_IN && !src0) - src0 = source; - else if (pin == ECNS_PIN_48K_IN && !src1) - src1 = source; - } - - /* Pin 1 output follows the dmic01 input channel count (2 or 4) */ - uint32_t pin1_ch = 2; - - if (src1) - pin1_ch = audio_stream_get_channels(&src1->stream) == 2 ? 2 : 4; - - struct ipc4_audio_format pin0_fmt = { - .sampling_frequency = 16000, - .channels_count = 1, - .depth = src1 ? 16 : 32, - .valid_bit_depth = src1 ? 16 : 32, - .s_type = src1 ? 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 pin1_fmt = { - .sampling_frequency = src1 ? 48000 : 16000, - .channels_count = pin1_ch, - .depth = src1 ? 16 : 32, - .valid_bit_depth = src1 ? 16 : 32, - .s_type = src1 ? IPC4_TYPE_SIGNED_INTEGER : IPC4_TYPE_MSB_INTEGER, - .interleaving_style = IPC4_CHANNELS_INTERLEAVED, - .ch_map = pin1_ch == 4 ? ECNS_CH_MAP_4CH : ECNS_CH_MAP_STEREO, - .ch_cfg = pin1_ch == 4 ? IPC4_CHANNEL_CONFIG_3_POINT_1 : IPC4_CHANNEL_CONFIG_STEREO, - }; - comp_dev_for_each_consumer(dev, sink) { - uint32_t pin = IPC4_SRC_QUEUE_ID(buf_get_id(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, + }; - if (pin == ECNS_PIN_16K_OUT) - ipc4_update_buffer_format(sink, &pin0_fmt); - else if (pin == ECNS_PIN_48K_OUT) - ipc4_update_buffer_format(sink, &pin1_fmt); + ipc4_update_buffer_format(sink, &fmt); + comp_info(dev, "ecns_prepare: output s%u", depth); } cd->capture_boost = cd->capture_boost_req; ecns_update_iir_coef(cd); - ecns_host_iir_init(cd, pin1_fmt.sampling_frequency); return comp_set_state(dev, COMP_TRIGGER_PREPARE); } @@ -418,19 +311,13 @@ static int ecns_reset(struct comp_dev *dev) struct ecns_comp_data *cd = comp_get_drvdata(dev); comp_info(dev, "ecns_reset"); - cd->test_signal_val = 0; #if CONFIG_ECNS_KPB_HPF if (cd->hp_delay) { - struct sof_eq_iir_header *hp_hdr = ecns_kpb_iir_coef(cd); - int hp_size = iir_delay_size_df1(hp_hdr); + 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 -#if CONFIG_ECNS_HOST_HPF - if (cd->host_delay) - memset_s(cd->host_delay, cd->host_delay_size, 0, cd->host_delay_size); #endif return comp_set_state(dev, COMP_TRIGGER_RESET); } @@ -441,61 +328,7 @@ static int ecns_trigger(struct comp_dev *dev, int cmd) return comp_set_state(dev, cmd); } -#if CONFIG_ECNS_TEST_SIGNAL -/** - * \brief Generate 32-bit test signal on Pin 0 (KPB) - */ -static void ecns_kpb_test_signal_s32(struct ecns_comp_data *cd, - struct comp_buffer *snk0, - uint32_t snk0_ch, - uint32_t frames) -{ - int32_t *snk_ptr = audio_stream_get_wptr(&snk0->stream); - uint32_t remaining = frames; - - while (remaining > 0) { - uint32_t f_snk = audio_stream_frames_without_wrap(&snk0->stream, snk_ptr); - uint32_t n = MIN(remaining, f_snk); - - for (uint32_t i = 0; i < n; i++) { - *snk_ptr++ = ((int32_t)cd->test_signal_val++) << 16; - for (uint32_t c = 1; c < snk0_ch; c++) - *snk_ptr++ = 0; - } - - remaining -= n; - snk_ptr = audio_stream_wrap(&snk0->stream, snk_ptr); - } -} - -/** - * \brief Generate 16-bit test signal on Pin 0 (KPB) - */ -static void ecns_kpb_test_signal_s16(struct ecns_comp_data *cd, - struct comp_buffer *snk0, - uint32_t snk0_ch, - uint32_t frames) -{ - int16_t *snk_ptr = audio_stream_get_wptr(&snk0->stream); - uint32_t remaining = frames; - - while (remaining > 0) { - uint32_t f_snk = audio_stream_frames_without_wrap(&snk0->stream, snk_ptr); - uint32_t n = MIN(remaining, f_snk); - - for (uint32_t i = 0; i < n; i++) { - *snk_ptr++ = (int16_t)cd->test_signal_val++; - for (uint32_t c = 1; c < snk0_ch; c++) - *snk_ptr++ = 0; - } - - remaining -= n; - snk_ptr = audio_stream_wrap(&snk0->stream, snk_ptr); - } -} -#endif - -static inline int32_t ecns_kpb_filter(struct ecns_comp_data *cd, int32_t x) +static inline int32_t ecns_filter(struct ecns_comp_data *cd, int32_t x) { #if CONFIG_ECNS_KPB_HPF return iir_df1(&cd->hp_iir, x); @@ -504,529 +337,135 @@ static inline int32_t ecns_kpb_filter(struct ecns_comp_data *cd, int32_t x) #endif } -/** - * \brief Process 32-bit DMIC input to 32-bit KPB mono output - */ -static void ecns_kpb_s32_to_s32(struct ecns_comp_data *cd, - struct comp_buffer *src0, - uint32_t src0_ch, - struct comp_buffer *snk0, - uint32_t snk0_ch, - uint32_t frames, - uint32_t avg_start, - uint32_t avg_cnt) -{ - int32_t *src_ptr = audio_stream_get_rptr(&src0->stream); - int32_t *snk_ptr = audio_stream_get_wptr(&snk0->stream); - uint32_t remaining = frames; - - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&src0->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk0->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - int32_t mono = ecns_mono_s32(src_ptr, avg_start, avg_cnt); - - mono = ecns_kpb_filter(cd, mono); - *snk_ptr++ = mono; - for (uint32_t c = 1; c < snk0_ch; c++) - *snk_ptr++ = 0; - src_ptr += src0_ch; - } - - remaining -= n; - src_ptr = audio_stream_wrap(&src0->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk0->stream, snk_ptr); - } -} +/** \brief Stream properties used by the processing loop */ +struct ecns_stream { + struct comp_buffer *buf; /**< Buffer, NULL if the pin is not connected */ + uint32_t ch; /**< Number of channels */ + uint32_t frame_bytes; /**< Bytes per frame */ + bool s32; /**< True for 32-bit, false for 16-bit samples */ +}; -/** - * \brief Process 16-bit DMIC input to 32-bit KPB mono output - */ -static void ecns_kpb_s16_to_s32(struct ecns_comp_data *cd, - struct comp_buffer *src0, - uint32_t src0_ch, - struct comp_buffer *snk0, - uint32_t snk0_ch, - uint32_t frames, - uint32_t avg_start, - uint32_t avg_cnt) +static void ecns_stream_init(struct ecns_stream *s, struct comp_buffer *buf) { - int16_t *src_ptr = audio_stream_get_rptr(&src0->stream); - int32_t *snk_ptr = audio_stream_get_wptr(&snk0->stream); - uint32_t remaining = frames; - - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&src0->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk0->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - int32_t mono = ((int32_t)ecns_mono_s16(src_ptr, avg_start, avg_cnt)) << 16; - - mono = ecns_kpb_filter(cd, mono); - *snk_ptr++ = mono; - for (uint32_t c = 1; c < snk0_ch; c++) - *snk_ptr++ = 0; - src_ptr += src0_ch; - } - - remaining -= n; - src_ptr = audio_stream_wrap(&src0->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk0->stream, snk_ptr); - } -} + uint32_t sample_bytes; -/** - * \brief Process 32-bit DMIC input to 16-bit KPB mono output - */ -static void ecns_kpb_s32_to_s16(struct ecns_comp_data *cd, - struct comp_buffer *src0, - uint32_t src0_ch, - struct comp_buffer *snk0, - uint32_t snk0_ch, - uint32_t frames, - uint32_t avg_start, - uint32_t avg_cnt) -{ - int32_t *src_ptr = audio_stream_get_rptr(&src0->stream); - int16_t *snk_ptr = audio_stream_get_wptr(&snk0->stream); - uint32_t remaining = frames; + s->buf = buf; + if (!buf) + return; - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&src0->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk0->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - int32_t mono = ecns_mono_s32(src_ptr, avg_start, avg_cnt); - - mono = ecns_kpb_filter(cd, mono); - *snk_ptr++ = sat_int16(Q_SHIFT_RND(mono, 31, 15)); - for (uint32_t c = 1; c < snk0_ch; c++) - *snk_ptr++ = 0; - src_ptr += src0_ch; - } + s->ch = audio_stream_get_channels(&buf->stream); + if (!s->ch) + s->ch = 1; - remaining -= n; - src_ptr = audio_stream_wrap(&src0->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk0->stream, snk_ptr); - } + sample_bytes = audio_stream_sample_bytes(&buf->stream); + s->s32 = sample_bytes != sizeof(int16_t); + s->frame_bytes = s->ch * (s->s32 ? sizeof(int32_t) : sizeof(int16_t)); } -/** - * \brief Process 16-bit DMIC input to 16-bit KPB mono output - */ -static void ecns_kpb_s16_to_s16(struct ecns_comp_data *cd, - struct comp_buffer *src0, - uint32_t src0_ch, - struct comp_buffer *snk0, - uint32_t snk0_ch, - uint32_t frames, - uint32_t avg_start, - uint32_t avg_cnt) +static uint32_t ecns_avail_frames(const struct ecns_stream *s) { - int16_t *src_ptr = audio_stream_get_rptr(&src0->stream); - int16_t *snk_ptr = audio_stream_get_wptr(&snk0->stream); - uint32_t remaining = frames; - - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&src0->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk0->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - int32_t mono = ((int32_t)ecns_mono_s16(src_ptr, avg_start, avg_cnt)) << 16; - - mono = ecns_kpb_filter(cd, mono); - *snk_ptr++ = sat_int16(Q_SHIFT_RND(mono, 31, 15)); - for (uint32_t c = 1; c < snk0_ch; c++) - *snk_ptr++ = 0; - src_ptr += src0_ch; - } - - remaining -= n; - src_ptr = audio_stream_wrap(&src0->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk0->stream, snk_ptr); - } + return s->buf ? audio_stream_get_avail_bytes(&s->buf->stream) / s->frame_bytes : 0; } /** - * \brief Process Pin 0: 16 kHz detection stream -> Mono clean to KPB - * - * Averages selected source channels into a mono stream, filters with the - * built-in 100 Hz HPF (+30 dB gain, CONFIG_ECNS_KPB_HPF), and writes to the sink buffer (either - * 16-bit or 32-bit container). Supports test signal generation when enabled. + * \brief Process microphone and echo reference frames to the output. * - * \param[in,out] cd ECNS component data - * \param[in] src0 Input buffer from 16 kHz DMIC - * \param[in,out] snk0 Output buffer to KPB - * \return Number of frames produced to snk0 + * \param[in,out] cd ECNS component data + * \param[in] mic Microphone input stream + * \param[in] ref Echo reference input stream, buffer may be NULL + * \param[in,out] out Output stream + * \param[in] frames Number of frames to process + * \param[in] ref_frames Number of available echo reference frames. The + * frames after these are processed as if the + * reference was zero. */ -static uint32_t ecns_process_kpb(struct ecns_comp_data *cd, - struct comp_buffer *src0, - struct comp_buffer *snk0) -{ - uint32_t src0_ch = audio_stream_get_channels(&src0->stream); - if (!src0_ch) - src0_ch = 4; - uint32_t src_sample_bytes = audio_stream_sample_bytes(&src0->stream); - if (!src_sample_bytes) - src_sample_bytes = sizeof(int32_t); - uint32_t src0_frame_bytes = src0_ch * src_sample_bytes; - uint32_t avail0_bytes = audio_stream_get_avail_bytes(&src0->stream); - uint32_t avail0_frames = avail0_bytes / src0_frame_bytes; - - uint32_t snk0_ch = audio_stream_get_channels(&snk0->stream); - if (!snk0_ch) - snk0_ch = 1; - uint32_t snk_sample_bytes0 = audio_stream_sample_bytes(&snk0->stream); - if (!snk_sample_bytes0) - snk_sample_bytes0 = sizeof(int32_t); - uint32_t snk0_frame_bytes = snk0_ch * snk_sample_bytes0; - uint32_t free0_bytes = audio_stream_get_free_bytes(&snk0->stream); - uint32_t free0_frames = free0_bytes / snk0_frame_bytes; - - /* Drain all available input bounded by sink space; a one-period cap - * would let the source ring overflow under DMIC vs DSP clock drift. - */ - uint32_t frames0 = MIN(avail0_frames, free0_frames); - if (!frames0) - return 0; - - uint32_t src_bytes = frames0 * src0_frame_bytes; - uint32_t snk_bytes = frames0 * snk0_frame_bytes; - - buffer_stream_invalidate(src0, src_bytes); - +static void ecns_process(struct ecns_comp_data *cd, const struct ecns_stream *mic, + const struct ecns_stream *ref, const struct ecns_stream *out, + uint32_t frames, uint32_t ref_frames) +{ + uint8_t *mic_ptr = audio_stream_get_rptr(&mic->buf->stream); + uint8_t *out_ptr = audio_stream_get_wptr(&out->buf->stream); + uint8_t *ref_ptr = ref_frames ? audio_stream_get_rptr(&ref->buf->stream) : NULL; + uint32_t mic_sample_bytes = mic->s32 ? sizeof(int32_t) : sizeof(int16_t); uint32_t avg_start, avg_cnt; - - ecns_mono_window(src0_ch, &avg_start, &avg_cnt); - -#if CONFIG_ECNS_TEST_SIGNAL - if (cd->test_signal_enabled) { - if (snk_sample_bytes0 == sizeof(int32_t)) - ecns_kpb_test_signal_s32(cd, snk0, snk0_ch, frames0); - else - ecns_kpb_test_signal_s16(cd, snk0, snk0_ch, frames0); - } else -#endif - if (snk_sample_bytes0 == sizeof(int32_t)) { - if (src_sample_bytes == sizeof(int32_t)) - ecns_kpb_s32_to_s32(cd, src0, src0_ch, snk0, snk0_ch, frames0, - avg_start, avg_cnt); - else - ecns_kpb_s16_to_s32(cd, src0, src0_ch, snk0, snk0_ch, frames0, - avg_start, avg_cnt); - } else { - if (src_sample_bytes == sizeof(int32_t)) - ecns_kpb_s32_to_s16(cd, src0, src0_ch, snk0, snk0_ch, frames0, - avg_start, avg_cnt); - else - ecns_kpb_s16_to_s16(cd, src0, src0_ch, snk0, snk0_ch, frames0, - avg_start, avg_cnt); - } - - buffer_stream_writeback(snk0, snk_bytes); - comp_update_buffer_produce(snk0, snk_bytes); - - return frames0; -} - -/** - * \brief Filter 32-bit input to 32-bit host capture sink - */ -static void ecns_host_s32_to_s32(struct ecns_comp_data *cd, - struct comp_buffer *in1, - uint32_t in1_ch, - struct comp_buffer *snk1, - uint32_t snk1_ch, - uint32_t frames) -{ - int32_t *src_ptr = audio_stream_get_rptr(&in1->stream); - int32_t *snk_ptr = audio_stream_get_wptr(&snk1->stream); uint32_t remaining = frames; + uint32_t i, n; + int32_t y; - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&in1->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk1->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - for (uint32_t c = 0; c < snk1_ch; c++) - snk_ptr[c] = (c < in1_ch) ? ecns_host_filter(cd, c, src_ptr[c]) : 0; - snk_ptr += snk1_ch; - src_ptr += in1_ch; - } - - remaining -= n; - src_ptr = audio_stream_wrap(&in1->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk1->stream, snk_ptr); - } -} - -/** - * \brief Filter 16-bit input to 32-bit host capture sink - */ -static void ecns_host_s16_to_s32(struct ecns_comp_data *cd, - struct comp_buffer *in1, - uint32_t in1_ch, - struct comp_buffer *snk1, - uint32_t snk1_ch, - uint32_t frames) -{ - int16_t *src_ptr = audio_stream_get_rptr(&in1->stream); - int32_t *snk_ptr = audio_stream_get_wptr(&snk1->stream); - uint32_t remaining = frames; + ecns_mono_window(cd->mic_sel, mic->ch, &avg_start, &avg_cnt); while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&in1->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk1->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - for (uint32_t c = 0; c < snk1_ch; c++) - snk_ptr[c] = (c < in1_ch) ? - ecns_host_filter(cd, c, ((int32_t)src_ptr[c]) << 16) : 0; - snk_ptr += snk1_ch; - src_ptr += in1_ch; + n = MIN(remaining, audio_stream_frames_without_wrap(&mic->buf->stream, mic_ptr)); + n = MIN(n, audio_stream_frames_without_wrap(&out->buf->stream, out_ptr)); + if (ref_frames) { + n = MIN(n, ref_frames); + n = MIN(n, audio_stream_frames_without_wrap(&ref->buf->stream, ref_ptr)); } - remaining -= n; - src_ptr = audio_stream_wrap(&in1->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk1->stream, snk_ptr); - } -} + 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; -/** - * \brief Filter 32-bit input to 16-bit host capture sink - */ -static void ecns_host_s32_to_s16(struct ecns_comp_data *cd, - struct comp_buffer *in1, - uint32_t in1_ch, - struct comp_buffer *snk1, - uint32_t snk1_ch, - uint32_t frames) -{ - int32_t *src_ptr = audio_stream_get_rptr(&in1->stream); - int16_t *snk_ptr = audio_stream_get_wptr(&snk1->stream); - uint32_t remaining = frames; + if (ref_frames) { + if (cd->aec_enable) + y = sat_int32((int64_t)y - + ecns_frame_avg(ref_ptr, ref->s32, 0, ref->ch)); + ref_ptr += ref->frame_bytes; + } - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&in1->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk1->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - for (uint32_t c = 0; c < snk1_ch; c++) - snk_ptr[c] = (c < in1_ch) ? - sat_int16(Q_SHIFT_RND(ecns_host_filter(cd, c, src_ptr[c]), - 31, 15)) : 0; - snk_ptr += snk1_ch; - src_ptr += in1_ch; - } + if (out->s32) { + int32_t *o = (int32_t *)out_ptr; - remaining -= n; - src_ptr = audio_stream_wrap(&in1->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk1->stream, snk_ptr); - } -} - -/** - * \brief Filter 16-bit input to 16-bit host capture sink - */ -static void ecns_host_s16_to_s16(struct ecns_comp_data *cd, - struct comp_buffer *in1, - uint32_t in1_ch, - struct comp_buffer *snk1, - uint32_t snk1_ch, - uint32_t frames) -{ - int16_t *src_ptr = audio_stream_get_rptr(&in1->stream); - int16_t *snk_ptr = audio_stream_get_wptr(&snk1->stream); - uint32_t remaining = frames; + o[0] = y; + for (uint32_t c = 1; c < out->ch; c++) + o[c] = 0; + } else { + int16_t *o = (int16_t *)out_ptr; - while (remaining > 0) { - uint32_t f_src = audio_stream_frames_without_wrap(&in1->stream, src_ptr); - uint32_t f_snk = audio_stream_frames_without_wrap(&snk1->stream, snk_ptr); - uint32_t n = MIN(remaining, MIN(f_src, f_snk)); - - for (uint32_t i = 0; i < n; i++) { - for (uint32_t c = 0; c < snk1_ch; c++) - snk_ptr[c] = (c < in1_ch) ? - sat_int16(Q_SHIFT_RND(ecns_host_filter(cd, c, - ((int32_t)src_ptr[c]) << 16), - 31, 15)) : 0; - snk_ptr += snk1_ch; - src_ptr += in1_ch; + o[0] = sat_int16(Q_SHIFT_RND(y, 31, 15)); + for (uint32_t c = 1; c < out->ch; c++) + o[c] = 0; + } + out_ptr += out->frame_bytes; } remaining -= n; - src_ptr = audio_stream_wrap(&in1->stream, src_ptr); - snk_ptr = audio_stream_wrap(&snk1->stream, snk_ptr); - } -} - -/** - * \brief Process Pin 1: 48 kHz host capture stream - * - * Filters the audio from the input producer (48 kHz dmic01 or fallback - * src0) with the built-in 40 Hz HPF (+20 dB gain) per channel and writes - * it to the host sink buffer (supporting s16 or s32). - * - * \param[in,out] cd ECNS component data - * \param[in] in1 Input buffer - * \param[in,out] snk1 Output buffer to host - * \return Number of frames produced to snk1 - */ -static uint32_t ecns_process_host(struct ecns_comp_data *cd, - struct comp_buffer *in1, - struct comp_buffer *snk1) -{ - uint32_t in1_ch = audio_stream_get_channels(&in1->stream); - if (!in1_ch) - in1_ch = 2; - uint32_t in1_sample_bytes = audio_stream_sample_bytes(&in1->stream); - if (!in1_sample_bytes) - in1_sample_bytes = sizeof(int32_t); - uint32_t in1_frame_bytes = in1_ch * in1_sample_bytes; - uint32_t avail1_bytes = audio_stream_get_avail_bytes(&in1->stream); - uint32_t avail1_frames = avail1_bytes / in1_frame_bytes; - - uint32_t snk1_ch = audio_stream_get_channels(&snk1->stream); - if (!snk1_ch) - snk1_ch = 2; - uint32_t snk_sample_bytes1 = audio_stream_sample_bytes(&snk1->stream); - if (!snk_sample_bytes1) - snk_sample_bytes1 = sizeof(int32_t); - uint32_t snk1_frame_bytes = snk1_ch * snk_sample_bytes1; - uint32_t free1_bytes = audio_stream_get_free_bytes(&snk1->stream); - uint32_t free1_frames = free1_bytes / snk1_frame_bytes; - - /* Drain all available input bounded by sink space; a one-period cap - * would let the source ring overflow under DMIC vs DSP clock drift. - */ - uint32_t frames1 = MIN(avail1_frames, free1_frames); - if (!frames1) - return 0; - - uint32_t in1_bytes = frames1 * in1_frame_bytes; - uint32_t snk_bytes = frames1 * snk1_frame_bytes; - - buffer_stream_invalidate(in1, in1_bytes); - - if (snk_sample_bytes1 == sizeof(int32_t)) { - if (in1_sample_bytes == sizeof(int32_t)) - ecns_host_s32_to_s32(cd, in1, in1_ch, snk1, snk1_ch, frames1); - else - ecns_host_s16_to_s32(cd, in1, in1_ch, snk1, snk1_ch, frames1); - } else { - if (in1_sample_bytes == sizeof(int32_t)) - ecns_host_s32_to_s16(cd, in1, in1_ch, snk1, snk1_ch, frames1); - else - ecns_host_s16_to_s16(cd, in1, in1_ch, snk1, snk1_ch, frames1); + mic_ptr = audio_stream_wrap(&mic->buf->stream, mic_ptr); + out_ptr = audio_stream_wrap(&out->buf->stream, out_ptr); + if (ref_frames) { + ref_frames -= n; + ref_ptr = ref_frames ? audio_stream_wrap(&ref->buf->stream, ref_ptr) : NULL; + } } - - buffer_stream_writeback(snk1, snk_bytes); - comp_update_buffer_produce(snk1, snk_bytes); - - return frames1; } -/** - * \brief Consume from ECNS source buffers and drain inactive inputs - * - * Updates consumption for produced audio frames and drains unconsumed - * input data when downstream consumer sinks are inactive or full to - * prevent upstream DAI FIFO overruns. - * - * \param[in,out] src0 16 kHz input buffer - * \param[in,out] src1 48 kHz input buffer - * \param[in] snk0 Pin 0 (KPB) output buffer - * \param[in] snk1 Pin 1 (Host) output buffer - * \param[in] frames0_produced Frames produced to snk0 - * \param[in] frames1_produced Frames produced to snk1 - */ -static void ecns_consume_sources(struct comp_buffer *src0, - struct comp_buffer *src1, - struct comp_buffer *snk0, - struct comp_buffer *snk1, - uint32_t frames0_produced, - uint32_t frames1_produced) +/** \brief Drop all complete frames from an input stream. */ +static void ecns_drain(const struct ecns_stream *s) { - uint32_t snk0_free = snk0 ? audio_stream_get_free_bytes(&snk0->stream) : 0; - uint32_t snk1_free = snk1 ? audio_stream_get_free_bytes(&snk1->stream) : 0; - - if (src1) { - uint32_t src1_ch = audio_stream_get_channels(&src1->stream); - if (!src1_ch) - src1_ch = 4; - uint32_t src1_sb = audio_stream_sample_bytes(&src1->stream); - if (!src1_sb) - src1_sb = sizeof(int32_t); - uint32_t src1_fb = src1_ch * src1_sb; - - if (frames1_produced > 0) { - comp_update_buffer_consume(src1, frames1_produced * src1_fb); - } else if (!snk1 || comp_buffer_get_sink_state(snk1) != COMP_STATE_ACTIVE || !snk1_free) { - uint32_t avail = audio_stream_get_avail_bytes(&src1->stream); - - if (src1_fb && avail >= src1_fb) { - avail = ROUND_DOWN(avail, src1_fb); - comp_update_buffer_consume(src1, avail); - } - } - } + uint32_t frames = ecns_avail_frames(s); - if (src0) { - uint32_t src0_ch = audio_stream_get_channels(&src0->stream); - if (!src0_ch) - src0_ch = 4; - uint32_t src0_sb = audio_stream_sample_bytes(&src0->stream); - if (!src0_sb) - src0_sb = sizeof(int32_t); - uint32_t src0_fb = src0_ch * src0_sb; - - uint32_t consumed0 = frames0_produced; - if (!src1 && frames1_produced > consumed0) - consumed0 = frames1_produced; - - if (consumed0 > 0) { - comp_update_buffer_consume(src0, consumed0 * src0_fb); - } else if ((!snk0 || comp_buffer_get_sink_state(snk0) != COMP_STATE_ACTIVE || !snk0_free) && - (src1 || !snk1 || comp_buffer_get_sink_state(snk1) != COMP_STATE_ACTIVE || !snk1_free)) { - uint32_t avail = audio_stream_get_avail_bytes(&src0->stream); - - if (src0_fb && avail >= src0_fb) { - avail = ROUND_DOWN(avail, src0_fb); - comp_update_buffer_consume(src0, avail); - } - } - } + if (frames) + comp_update_buffer_consume(s->buf, frames * s->frame_bytes); } /* - * Main 20ms DP processing function: + * Main 20 ms DP processing function: * Consumes: - * - Pin 0 in: 16 kHz stream from dmic16k (2 or 4 channels, 16/32-bit) - * - Pin 1 in: 48 kHz stream from dmic01 (2 or 4 channels, 16/32-bit) + * - 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) * Produces: - * - Pin 0 out: 16 kHz mono clean stream to KPB (averaged mono per Kconfig, 320 frames per 20ms) - * - Pin 1 out: 48 kHz stereo/4ch clean stream to Host PCM 11 (40 Hz HPF +20 dB, 960 frames per 20ms) - * Sampling rates remain identical between input and output on each pin. + * - Pin 0 out: 16 kHz mono processed stream (16/32-bit) */ static int ecns_copy(struct comp_dev *dev) { struct ecns_comp_data *cd = comp_get_drvdata(dev); + struct comp_buffer *src_mic = NULL; + struct comp_buffer *src_ref = NULL; + struct comp_buffer *snk = NULL; struct comp_buffer *source; struct comp_buffer *sink; - struct comp_buffer *src0 = NULL; - struct comp_buffer *src1 = NULL; - struct comp_buffer *snk0 = NULL; - struct comp_buffer *snk1 = NULL; - uint32_t frames0_produced = 0; - uint32_t frames1_produced = 0; + struct ecns_stream mic, ref, out; + uint32_t frames, ref_frames; if (list_is_empty(&dev->bsource_list)) return 0; @@ -1039,38 +478,61 @@ static int ecns_copy(struct comp_dev *dev) cd->capture_boost ? "enabled" : "disabled"); } - /* Identify input pins (producers to ECNS) */ comp_dev_for_each_producer(dev, source) { uint32_t pin = IPC4_SINK_QUEUE_ID(buf_get_id(source)); - if (pin == ECNS_PIN_16K_IN && !src0) - src0 = source; - else if (pin == ECNS_PIN_48K_IN && !src1) - src1 = source; + if (pin == ECNS_PIN_MIC_IN && !src_mic) + src_mic = source; + else if (pin == ECNS_PIN_REF_IN && !src_ref) + src_ref = source; } - /* Identify output pins (consumers from ECNS) */ comp_dev_for_each_consumer(dev, sink) { - uint32_t pin = IPC4_SRC_QUEUE_ID(buf_get_id(sink)); + if (IPC4_SRC_QUEUE_ID(buf_get_id(sink)) == ECNS_PIN_OUT && !snk) + snk = sink; + } - if (pin == ECNS_PIN_16K_OUT && !snk0) - snk0 = sink; - else if (pin == ECNS_PIN_48K_OUT && !snk1) - snk1 = sink; + ecns_stream_init(&mic, src_mic); + ecns_stream_init(&ref, src_ref); + ecns_stream_init(&out, snk); + + /* Drain all available input bounded by sink space; a one-period cap + * would let the source ring overflow under DMIC vs DSP clock drift. + */ + frames = ecns_avail_frames(&mic); + if (snk && comp_buffer_get_sink_state(snk) == COMP_STATE_ACTIVE) + frames = MIN(frames, audio_stream_get_free_bytes(&snk->stream) / out.frame_bytes); + else + frames = 0; + + if (!frames) { + /* Drop the input when the output can't take it to prevent + * upstream DAI FIFO overruns. + */ + if (!snk || comp_buffer_get_sink_state(snk) != COMP_STATE_ACTIVE || + !audio_stream_get_free_bytes(&snk->stream)) { + if (src_mic) + ecns_drain(&mic); + if (src_ref) + ecns_drain(&ref); + } + return 0; } - /* Process Pin 0: 16 kHz stream -> Mono clean to KPB */ - if (src0 && snk0) - frames0_produced = ecns_process_kpb(cd, src0, snk0); + /* A missing echo reference is processed as zero */ + ref_frames = MIN(frames, ecns_avail_frames(&ref)); - /* Process Pin 1: 48 kHz stream -> Host capture */ - struct comp_buffer *in1 = src1 ? src1 : src0; + buffer_stream_invalidate(src_mic, frames * mic.frame_bytes); + if (ref_frames) + buffer_stream_invalidate(src_ref, ref_frames * ref.frame_bytes); - if (in1 && snk1) - frames1_produced = ecns_process_host(cd, in1, snk1); + ecns_process(cd, &mic, &ref, &out, frames, ref_frames); - /* Consume from source buffers */ - ecns_consume_sources(src0, src1, snk0, snk1, frames0_produced, frames1_produced); + buffer_stream_writeback(snk, frames * out.frame_bytes); + comp_update_buffer_produce(snk, frames * out.frame_bytes); + comp_update_buffer_consume(src_mic, frames * mic.frame_bytes); + if (ref_frames) + comp_update_buffer_consume(src_ref, ref_frames * ref.frame_bytes); return 0; } @@ -1099,32 +561,50 @@ static int ecns_set_large_config(struct comp_dev *dev, case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: { const struct sof_ipc4_control_msg_payload *cp = (const struct sof_ipc4_control_msg_payload *)data; + bool val; if (cp->num_elems < 1) return -EINVAL; + val = !!cp->chanv[0].value; switch (cp->id) { - case ECNS_CTRL_INDEX_TEST_SIGNAL: -#if CONFIG_ECNS_TEST_SIGNAL - cd->test_signal_enabled = cp->chanv[0].value ? 1 : 0; - if (cd->test_signal_enabled) - cd->test_signal_val = 0; - - comp_info(dev, "test signal %s (kpb mono output)", - cd->test_signal_enabled ? "enabled" : "disabled"); -#else - if (cp->chanv[0].value) - comp_warn(dev, "test signal not supported (CONFIG_ECNS_TEST_SIGNAL=n)"); -#endif - return 0; case ECNS_CTRL_INDEX_CAPTURE_BOOST: - cd->capture_boost_req = !!cp->chanv[0].value; + cd->capture_boost_req = val; + return 0; + case ECNS_CTRL_INDEX_AEC: + cd->aec_enable = val; + comp_info(dev, "AEC %s", val ? "enabled" : "disabled"); + return 0; + case ECNS_CTRL_INDEX_NS: + cd->ns_enable = val; + comp_info(dev, "NS %s", val ? "enabled" : "disabled"); return 0; default: comp_err(dev, "illegal switch control id %u", cp->id); return -EINVAL; } } + case SOF_IPC4_ENUM_CONTROL_PARAM_ID: { + const struct sof_ipc4_control_msg_payload *cp = + (const struct sof_ipc4_control_msg_payload *)data; + + if (cp->num_elems < 1) + return -EINVAL; + + if (cp->id != ECNS_CTRL_INDEX_MIC_SEL) { + comp_err(dev, "illegal enum control id %u", cp->id); + return -EINVAL; + } + + if (cp->chanv[0].value > ECNS_MIC_SEL_MAX) { + comp_err(dev, "illegal mic channel %u", cp->chanv[0].value); + return -EINVAL; + } + + cd->mic_sel = cp->chanv[0].value; + comp_info(dev, "mic channel %u", cd->mic_sel); + return 0; + } default: return -EINVAL; } @@ -1139,32 +619,54 @@ static int ecns_get_large_config(struct comp_dev *dev, { struct ecns_comp_data *cd = comp_get_drvdata(dev); + struct sof_ipc4_control_msg_payload *cp = (struct sof_ipc4_control_msg_payload *)data; + uint32_t resp_size = sizeof(struct sof_ipc4_control_msg_payload) + + sizeof(struct sof_ipc4_ctrl_value_chan); + uint16_t ctl_id; + uint32_t val; + switch (param_id) { - case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: { - struct sof_ipc4_control_msg_payload *cp = - (struct sof_ipc4_control_msg_payload *)data; - uint16_t ctl_id = cp->id; - uint32_t resp_size = sizeof(struct sof_ipc4_control_msg_payload) + - sizeof(struct sof_ipc4_ctrl_value_chan); - - if (resp_size > *data_offset) { - comp_err(dev, "wrong switch control response size %u vs %u", - resp_size, *data_offset); + case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: + ctl_id = cp->id; + switch (ctl_id) { + case ECNS_CTRL_INDEX_CAPTURE_BOOST: + val = cd->capture_boost_req; + break; + case ECNS_CTRL_INDEX_AEC: + val = cd->aec_enable; + break; + case ECNS_CTRL_INDEX_NS: + val = cd->ns_enable; + break; + default: + comp_err(dev, "illegal switch control id %u", ctl_id); return -EINVAL; } - - *data_offset = resp_size; - memset_s(cp, resp_size, 0, resp_size); - cp->id = ctl_id; - cp->num_elems = 1; - cp->chanv[0].channel = 0; - cp->chanv[0].value = ctl_id == ECNS_CTRL_INDEX_CAPTURE_BOOST ? - cd->capture_boost_req : cd->test_signal_enabled; - return 0; - } + break; + case SOF_IPC4_ENUM_CONTROL_PARAM_ID: + ctl_id = cp->id; + if (ctl_id != ECNS_CTRL_INDEX_MIC_SEL) { + comp_err(dev, "illegal enum control id %u", ctl_id); + return -EINVAL; + } + val = cd->mic_sel; + break; default: return -EINVAL; } + + if (resp_size > *data_offset) { + comp_err(dev, "wrong control response size %u vs %u", resp_size, *data_offset); + return -EINVAL; + } + + *data_offset = resp_size; + memset_s(cp, resp_size, 0, resp_size); + cp->id = ctl_id; + cp->num_elems = 1; + cp->chanv[0].channel = 0; + cp->chanv[0].value = val; + return 0; } static const struct comp_driver ecns_drv = { diff --git a/src/audio/ecns/ecns.toml b/src/audio/ecns/ecns.toml index 123c93505311..af68fad2fc2b 100644 --- a/src/audio/ecns/ecns.toml +++ b/src/audio/ecns/ecns.toml @@ -11,6 +11,7 @@ REM # pin = [dir, type, sample rate, size, container, channel-cfg] pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] REM # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] diff --git a/src/include/sof/audio/ecns.h b/src/include/sof/audio/ecns.h index 7bf2ab983dda..b39a91041ee5 100644 --- a/src/include/sof/audio/ecns.h +++ b/src/include/sof/audio/ecns.h @@ -3,31 +3,36 @@ * Copyright(c) 2026 Intel Corporation. All rights reserved. */ +/** + * \file + * \brief ECNS (Echo Cancellation & Noise Suppression) component definitions + */ + #ifndef __SOF_AUDIO_ECNS_H__ #define __SOF_AUDIO_ECNS_H__ #include #include -#define ECNS_IN_CHANNELS 2 -#define ECNS_PIN_KPB 0 /* Output Pin 0: Channel 0 mono to KPB */ -#define ECNS_PIN_HOST 1 /* Output Pin 1: Channels 0,1 stereo to Host Copier */ +/** \brief Input pin 0: 16 kHz 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 */ +#define ECNS_PIN_REF_IN 1 +/** \brief Output pin 0: 16 kHz mono processed stream, e.g. to KPB */ +#define ECNS_PIN_OUT 0 -#define ECNS_PIN_16K_IN 0 /* Input Pin 0: 16 kHz stream from dmic16k */ -#define ECNS_PIN_48K_IN 1 /* Input Pin 1: 48 kHz stream from dmic01 */ -#define ECNS_PIN_16K_OUT 0 /* Output Pin 0: 16 kHz mono clean to KPB */ -#define ECNS_PIN_48K_OUT 1 /* Output Pin 1: 48 kHz stereo clean to Host Copier */ +/** \brief Output sample rate in Hz */ +#define ECNS_RATE 16000 -#define ECNS_PERIOD_MS 20 -#define ECNS_FRAME_SAMPLES_16K 320 /* 20ms @ 16 kHz */ -#define ECNS_FRAME_SAMPLES_48K 960 /* 20ms @ 48 kHz */ -#define ECNS_FRAME_SAMPLES ECNS_FRAME_SAMPLES_16K +/** \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 -/* IPC4 channel maps, one nibble per channel index, 0xF marks unused */ +/** \brief IPC4 channel map for mono, one nibble per channel, 0xF marks unused */ #define ECNS_CH_MAP_MONO 0xFFFFFFF0 -#define ECNS_CH_MAP_STEREO 0xFFFFFF10 -#define ECNS_CH_MAP_4CH 0xFFFF3210 +/** \brief Register the ECNS component driver */ void sys_comp_ecns_init(void); #endif /* __SOF_AUDIO_ECNS_H__ */ From bd13560d2ec3612247e00d1b5e1602ae72da9e9f Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 20 Nov 2026 16:42:21 +0200 Subject: [PATCH 3/7] app: boards: enable tone for the ECNS echo reference The WoV topologies use the tone component as siggen in the ECNS echo reference pipeline. It passes through the speaker playback and produces silence when the speaker is not running. Enable it for the boards with ECNS and add the missing TGL manifest entry. Signed-off-by: Seppo Ingalsuo --- app/boards/intel_adsp_ace30_ptl.conf | 2 ++ app/boards/intel_adsp_ace30_wcl.conf | 2 ++ app/boards/intel_adsp_ace40_nvl.conf | 2 ++ app/boards/intel_adsp_cavs25.conf | 2 ++ tools/rimage/config/tgl.toml.h | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index 8ed644019a34..536972afd6e2 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -23,6 +23,8 @@ CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_KPB_MAX_BUFF_TIME=2000 CONFIG_COMP_ECNS=y +# Silent speaker echo reference for ECNS when playback is not running +CONFIG_COMP_TONE=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/app/boards/intel_adsp_ace30_wcl.conf b/app/boards/intel_adsp_ace30_wcl.conf index 5ba0ec43d7c7..3fa050817d3a 100644 --- a/app/boards/intel_adsp_ace30_wcl.conf +++ b/app/boards/intel_adsp_ace30_wcl.conf @@ -24,6 +24,8 @@ CONFIG_COMP_MIXIN_MIXOUT=y CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_COMP_ECNS=y +# Silent speaker echo reference for ECNS when playback is not running +CONFIG_COMP_TONE=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/app/boards/intel_adsp_ace40_nvl.conf b/app/boards/intel_adsp_ace40_nvl.conf index e39b817e90fe..336f19561acd 100644 --- a/app/boards/intel_adsp_ace40_nvl.conf +++ b/app/boards/intel_adsp_ace40_nvl.conf @@ -23,6 +23,8 @@ CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_KPB_MAX_BUFF_TIME=2000 CONFIG_COMP_ECNS=y +# Silent speaker echo reference for ECNS when playback is not running +CONFIG_COMP_TONE=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/app/boards/intel_adsp_cavs25.conf b/app/boards/intel_adsp_cavs25.conf index c6b72a40aa9f..000f512f7c44 100644 --- a/app/boards/intel_adsp_cavs25.conf +++ b/app/boards/intel_adsp_cavs25.conf @@ -13,6 +13,8 @@ CONFIG_COMP_WOV_ARBITER=y CONFIG_COMP_KPB=y CONFIG_KPB_MAX_BUFF_TIME=2000 CONFIG_COMP_ECNS=y +# Silent speaker echo reference for ECNS when playback is not running +CONFIG_COMP_TONE=y CONFIG_SOF_STAGING=y CONFIG_COMP_MFCC=y CONFIG_COMP_MFCC_PCAN=y diff --git a/tools/rimage/config/tgl.toml.h b/tools/rimage/config/tgl.toml.h index d85358fc3d1e..dd2ce3655697 100644 --- a/tools/rimage/config/tgl.toml.h +++ b/tools/rimage/config/tgl.toml.h @@ -144,5 +144,9 @@ #include