I found that in iOS 14+ device, after creating and running an AudioUnit in VPIO mode(with 3A processing), when I recreate my AudioUnit with RemoteIO mode, the 3A processing seems will remain working, which will make my ear loopback feature sounds discontinuous.
And I found a tricky way to avoid this: before creating AudioUnit, set the PreferredInput to BuiltInMic for AudioSession at first......So weird.
I uploaded my demo to Github: https://github.com/PandaraWen/AudioUnit_BugReport
- Build and run de demo in Xcode 12 on iOS 14 device, and plug in EarPods;
- Turn the "Loopback" switcher on;
- Click the "AU-RemoteIO" button, and say "Ah~~~~~~~", you will hear your normal voice from EarPods;
- Click the "AU-VPIO" button, and say "Ah~~~~~~~", you will hear your voice from EarPods discontinuously, that is because AEC I think;
- Click the "AU-RemoteIO" button again, and say "Ah~~~~~~~", the bug occurs! You will hear your discontinuous and low voice! THAT IS ABSOLUTELY ABNORMAL!!!!!
- Turn the "Should Set to build in mic" switch on, and click the "AU-RemoteIO" button again, you will hear your normal voice from EarPods again.
Finally, I found that the "BuildInMic tricky way" would cost some additional time, which would do hurt to user experience, so I hope that this problem can be fixed completely!!!!