Issue Description
Users utilizing Bluetooth-connected wearables, such as smart glasses, may experience persistent audio echo and unstable sound capture during sessions on iOS devices. This phenomenon primarily occurs in applications implementing custom audio self-capture mode. The instability is characterized by ineffective echo cancellation and irregular audio data transmission, resulting in a degraded communication experience for both local and remote participants.
Platform/SDK
Operating System: iOS
SDK: Agora RTC SDK v4.5.3.x
Root Cause
The audio degradation originates from two distinct technical factors:
1. Temporal Irregularities in Self-Capture Transmission
In custom audio capture implementations, audio frames must be pushed to the SDK at precise intervals. If the transmission timing is uneven or jittered, the internal audio processing pipeline cannot maintain a stable buffer, leading to capture instability and artifacts.
2. Acoustic Latency Mismatch within the A2DP Audio Route
When iOS identifies an active audio route as A2DP, which is standard for most Bluetooth wearables, the system enforces a fixed 16-millisecond delay for the audio subsystem. However, the actual latency for these devices often reaches approximately 600 milliseconds.
The Agora Acoustic Echo Cancellation, or AEC, algorithm requires an accurate delay estimation to align the reference signal with the captured microphone signal. This significant temporal mismatch prevents the SDK’s linear filter from converging properly, resulting in significant echo leakage where the speaker output is recaptured by the microphone and transmitted back to the channel.
Resolution
- Upgrade to Agora RTC SDK version 4.5.3.122 or later. Internal testing confirmed that the issue could not be reproduced in this version.
- If the issue persists, developers can contact Agora support to request a private parameter to manually set the audio route to “speaker” for the Audio Processing Module (APM). This avoids the A2DP delay limitation on iOS.
- Ensure that self-captured audio data is pushed evenly at consistent frame intervals.
Best Practice
Following the implementation of these adjustments, the synchronization between the playback and capture paths will be restored. Developers can expect the AEC linear filter to converge successfully, effectively eliminating echo and ensuring stable audio capture across Bluetooth-connected wearable devices.
- After applying these changes or upgrading to version 4.5.3.122, the echo and irregular audio push issues should be resolved.