From 7b7090616214a7797e2db375f2f439c770cad37a Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Wed, 9 Jul 2025 12:51:29 -0400 Subject: [PATCH] spa: aec: webrtc: Expose echo canceller mobile_mode Significantly better CPU performance in lieu of canceller quality. Not implemented for 0.x series, as there's a lot more to enable there (such as routing modes), and I am hoping to drop support for those versions before too long. --- spa/plugins/aec/aec-webrtc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spa/plugins/aec/aec-webrtc.cpp b/spa/plugins/aec/aec-webrtc.cpp index 6ad3a92e0..7b8cafcde 100644 --- a/spa/plugins/aec/aec-webrtc.cpp +++ b/spa/plugins/aec/aec-webrtc.cpp @@ -119,6 +119,9 @@ static int webrtc_init2(void *object, const struct spa_dict *args, #elif defined(HAVE_WEBRTC1) bool voice_detection = webrtc_get_spa_bool(args, "webrtc.voice_detection", true); bool transient_suppression = webrtc_get_spa_bool(args, "webrtc.transient_suppression", true); + bool mobile_mode = webrtc_get_spa_bool(args, "webrtc.mobile_mode", false); +#elif defined(HAVE_WEBRTC2) + bool mobile_mode = webrtc_get_spa_bool(args, "webrtc.mobile_mode", false); #endif // Note: AGC seems to mess up with Agnostic Delay Detection, especially with speech, // result in very poor performance, disable by default @@ -171,6 +174,7 @@ static int webrtc_init2(void *object, const struct spa_dict *args, #elif defined(HAVE_WEBRTC1) webrtc::AudioProcessing::Config config; config.echo_canceller.enabled = true; + config.echo_canceller.mobile_mode = mobile_mode; config.pipeline.multi_channel_capture = rec_info->channels > 1; config.pipeline.multi_channel_render = play_info->channels > 1; // FIXME: Example code enables both gain controllers, but that seems sus @@ -188,6 +192,7 @@ static int webrtc_init2(void *object, const struct spa_dict *args, #elif defined(HAVE_WEBRTC2) webrtc::AudioProcessing::Config config; config.echo_canceller.enabled = true; + config.echo_canceller.mobile_mode = mobile_mode; config.pipeline.multi_channel_capture = rec_info->channels > 1; config.pipeline.multi_channel_render = play_info->channels > 1; // FIXME: Example code enables both gain controllers, but that seems sus