Issue Description
During live streaming sessions on iOS, users utilizing external sound cards may experience frequent audio lag, stuttering, or continuous sound interruptions. The issue occurs consistently during the session, whereas audio performance remains normal when tested on other platforms.
Platform and SDK Context
Operating System: iOS
SDK Component: Agora RTC SDK
Hardware Context: External Sound Card with active In-Ear Monitoring
Root Cause Analysis
This issue is caused by enabling both AEC (Acoustic Echo Cancellation) and In-Ear Monitoring simultaneously while using an external sound card.
Under the Hood (Technical Mechanism): External sound cards typically process audio signals and manage physical echo/monitoring internally. When the SDK's software Acoustic Echo Cancellation and ear monitoring are kept active alongside the sound card's internal processing, duplicate signal processing and algorithm conflicts occur. This interference disrupts the audio pipeline, resulting in noticeable audio stuttering and buffer interruptions.
Solution and Resolution Steps
Disable AEC When Using an External Sound Card
Because external sound cards handle audio signal processing internally, disable the SDK's software Acoustic Echo Cancellation to prevent duplicate processing and audio distortion.
Keep AEC Disabled If In-Ear Monitoring is Required
If in-ear monitoring must remain active during the session, ensure AEC is kept turned off to avoid conflicts between the monitoring and cancellation algorithms.
Apply Settings and Restart the Application
After updating the audio configuration settings, restart the application to ensure the new audio processing parameters take effect properly across the system.
Verify Audio Playback
Test the audio stream again to confirm that playback is smooth and free from stuttering or lag.
Prevention and Best Practice
To ensure optimal sound quality during live sessions that involve external sound cards:
Avoid Simultaneous AEC and In-Ear Monitoring: Do not enable both AEC and in-ear monitoring at the same time when routing audio through an external sound card.
Rely on Hardware Processing: Allow the external sound card to perform internal signal processing rather than applying duplicate software processing in the client application.