-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local preview freezing for ~1sec (TextureRenderView only) when starting the meeting in the background #260
Comments
Thank you for detailed explanation and reproduce step. We'll investigate and get back to you. |
Correction: we discovered some issues with using |
@tmilovan123 I think your conjecture is correct. The problem seems to be in code where we are using main thread to start the audio client, which takes over UI thread causing some freezing issue there. |
@hokyungh Thanks for getting back! One thing, can you ping me when you have a potential fix so I could test with a dev version of the SDK in our app? The reason is, I tried moving it to another thread by myself, building an SDK and using in our app, and it still had some effects of freezing, even though it appeared fixed in demo app. So I would like to get to the bottom of it as well. Not sure if we do something special there to make the situation worse. Thanks in advance. |
@hokyungh As a result of our conversation, I can confirm that your fix + moving |
Hello @tmilovan123, The only potential issue I currently see is if Other than that, I currently don't see any potential issue with calling |
Hi @alnlau , Thanks for your response. Our minSdkVersion is 24, so it is not a risk for us. It's good to know Based on this, we can move both calls to another thread, and this should resolve/mitigate the impact. I know that part of the |
I'll close this for now. Feel free to reopen if you have further questions. We have an open issue for documentation: #267 |
Describe the bug
If you show a local preview (as described here) using TextureRenderView and call
audioVideo.start()
while the preview is still showing, you would see frames freezing (dropping?) on the preview visibly for ~1sec.Context
One of the use cases in our app is to display local preview (state 1) before the call starts and animate it into the proper (tile-based) local video views (state 2). To make sure both local and remote video views display something before transitioning to state 2 (we don't want to show black screens), we start the meeting while the local preview is still shown and wait until some frames get rendered onto local and remote video views, then transition to state 2.
To Reproduce
Steps to reproduce the behavior:
TextureRenderView
backed byDefaultCameraCaptureSource
,You will see the video freezing temporarily on the preview and continuing smoothly afterwards.
You can modify the Chime demo app to reproduce this issue. I have attached a diff with the simplest issue repro (starting a meeting in
DeviceManagementFragment
with 3 sec delay after preview start).Repro.patch.txt
Note: this does not reproduce with
SurfaceRenderView
. Currently usingDefaultVideoRenderView
as a workaround for preview in our app.Logs
logs.txt
Test environment Info (please complete the following information):
Additional context
I have tried executing
audioVideo.start()
on another thread (simply by usingCoroutineScope(Dispatchers.IO).launch{...}
. It makes it better for the demo app (even if I make the preview full-screen), but the issue is still visibly present in our app even with this workaround. Also, I'm not sure this method is thread safe.I also investigated a bit which code causes this drop, and it seems so far that
audioClientController.start(...)
(seeDefaultAudioVideoController#start(...)
) is the root cause, specifically some code inDefaultAudioClientController#start(...)
. Not sure what the connection is here. This guess is only based on random experiments with moving some of the audio code to another thread and making the issue to be less severe. However, this could totally be a false conclusion, I did not look thoroughly enough to make it definitive, nor did I profile these calls. Also, again, the effect of moving different code to another thread was not that pronounced in our app vs demo app, so it makes me think that it is either a false cause or the audio native code is causing it somehow.The text was updated successfully, but these errors were encountered: