|
| 1 | +# SPDX-License-Identifier: BSD-3-Clause |
| 2 | + |
| 3 | +config COMP_WEBRTC_NS |
| 4 | + tristate "WebRTC Noise Suppression (classic spectral Wiener filter)" |
| 5 | + help |
| 6 | + Select to include the WebRTC Noise Suppression module. It wraps |
| 7 | + the classic WebRTC NS algorithm — a frequency-domain spectral |
| 8 | + subtraction / Wiener filter — as a single-input, single-output |
| 9 | + PCM effect module. |
| 10 | + |
| 11 | + The NS module reduces stationary and slowly-varying background |
| 12 | + noise (HVAC hum, fan noise, electrical hiss). It is independent |
| 13 | + of the ffmpeg afftdn filter already available through ffmpeg_dec, |
| 14 | + providing users a build-time choice between the two. |
| 15 | + |
| 16 | + The real backend uses the pure-C noise_suppression module |
| 17 | + extracted from webrtc-audio-processing 0.3.x (no abseil, no C++, |
| 18 | + BSD-3-Clause). Source is fetched via west (west update). |
| 19 | + |
| 20 | + Without the source, or for CI/testing, select COMP_WEBRTC_NS_STUB. |
| 21 | + |
| 22 | +if COMP_WEBRTC_NS |
| 23 | + |
| 24 | +config COMP_WEBRTC_NS_STUB |
| 25 | + bool "WebRTC NS stub backend (no WebRTC source dependency)" |
| 26 | + default y if COMP_STUBS |
| 27 | + help |
| 28 | + Build the webrtc_ns module against a dependency-free stub backend |
| 29 | + that passes audio through unmodified. Useful for CI validation of |
| 30 | + the SOF module glue, LLEXT packaging, and topology wiring without |
| 31 | + needing the cross-built libwebrtc_ns archive. |
| 32 | + |
| 33 | +config WEBRTC_NS_LEVEL |
| 34 | + int "Noise suppression level (0=mild, 1=moderate, 2=aggressive, 3=very_aggressive)" |
| 35 | + range 0 3 |
| 36 | + default 1 |
| 37 | + help |
| 38 | + Controls the aggressiveness of the noise suppressor: |
| 39 | + 0 - Mild (minimal suppression, lowest distortion) |
| 40 | + 1 - Moderate (recommended for most use cases) |
| 41 | + 2 - Aggressive |
| 42 | + 3 - Very aggressive (maximum suppression, most distortion) |
| 43 | + |
| 44 | +config WEBRTC_NS_SAMPLE_RATE_HZ |
| 45 | + int "NS processing sample rate in Hz" |
| 46 | + default 16000 |
| 47 | + help |
| 48 | + The internal processing sample rate. The WebRTC NS algorithm works |
| 49 | + best at 16000 Hz. When the pipeline runs at 48000 Hz the module |
| 50 | + can downsample to 16 kHz for NS processing and upsample back to |
| 51 | + 48 kHz, saving significant CPU. Set to 48000 to process at full |
| 52 | + rate (higher quality, higher CPU cost). |
| 53 | + Valid values: 8000, 16000, 32000, 48000. |
| 54 | + |
| 55 | +endif # COMP_WEBRTC_NS |
0 commit comments