Microphone initialization takes too long — retry logic and timeout handling advice

Hi @Thong1

  • Do you think it’s reasonable to apply a manual timeout of 5s to startAudio()/startVideo() to avoid long UI freezes?

It’s not reasonable — a 5-second timeout is inappropriate. As you mentioned, it could involve network connections, and even if you retry after a timeout, you’d still need to reconnect, which would take just as much time.

Since startAudio/startVideo are asynchronous methods, you can provide feedback to the user through the UI by indicating that audio/video is being started — for example, by showing a loading indicator or disabling the control area. You shouldn’t automatically retry in such a short time frame.

  • In case of overlapping calls (e.g., when a retry is triggered before the SDK call internally resolves), we’ve seen logs like INVALID_OPERATION. Is this harmful, or just a safe way the SDK rejects redundant calls?

Yes, we reject duplicate calls to prevent inconsistent states.

Thanks
Vic