Skip to content
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

onVideoTileAdded sometimes not called for videos added #186

Closed
ribafish opened this issue Nov 25, 2020 · 9 comments
Closed

onVideoTileAdded sometimes not called for videos added #186

ribafish opened this issue Nov 25, 2020 · 9 comments
Labels

Comments

@ribafish
Copy link

ribafish commented Nov 25, 2020

Describe the bug
onVideoTileAdded callback is not always called when an attendee enables his video. This is not tied to a specific device or even only to android platform - it happens (on android) even with a cross-platform call. onVideoTileAdded is also not (always) called when the local video is started. We get all the correct onVideoTileRemoved events, but not onVideoTileAdded.

To Reproduce
Steps to reproduce the behavior:

  1. Start a call with multiple (3+) participants
  2. Start and stop video streams on devices
  3. Observe the onVideoTileAdded events on devices, which are not always called for all streams.

Expected behavior
For any attendee that started his local videoStream we expect to get onVideoTileAdded on all other attendee devices.

Logs
Can't log something that doesn't happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Test environment Info (please complete the following information):

  • Device: Samsung Note 9 - Android 10
  • Device: Samsung Galaxy Tab A (2016) - Android 8.1.0
  • Device: Samsung Galaxy S8 - Android 9
  • Device: Huawei Mate 9 - Android 7.0
  • Version amazon-chime-sdk: 0.8.1 (and 0.8.0)
  • Version amazon-chime-sdk-media: 0.8.1 (and 0.8.0)
@tianyux-amz
Copy link
Contributor

Hi @ribafish,

Could you enable verbose logging in the Logger to gather detailed logs? This will collect verbose logs from media side and help us understand what was going on. Thank you!

Best,
Tianyu

@ribafish
Copy link
Author

chime_verbose_log_onVideoTileAdded_missing.txt
This is the log I managed to capture - The start is missing, as it doesn't happen always, but after starting/stopping the video it does. Here you can see multiple consecutive onVideoTileRemoved outputs for the same attendee. I hope this helps you with the debugging.

Note: This log was captured on Samsung Galaxy Tab A (2016) - Android 8.1.0. With sdk and sdk-media v 0.8.1

@tianyux-amz
Copy link
Contributor

Hi @ribafish,

Thanks for providing verbose logs. I checked the log and seemed like the SDK could subscribe the video stream properly. I did notice that there was no unbindVideoView call after each onVideoTileRemoved call, which indicates that you did not unbind the video view in your onVideoTileRemoved handler. You should unbind the video view properly so that the SDK can recognize your new video streams and call onVideoTileAdded callback. You can refer to our demo app implementation for a reference.

@ribafish
Copy link
Author

ribafish commented Dec 2, 2020

Hi @tianyux-amz ,

Thanks for helping, but as we show only one stream at a time (decided by activeSpeaker functionality), the times you didn't see unbindVideoView after onVideoTileRemoved was when that video was not bound before this, as the video did not belong to the active speaker.

You can also find another log, which has capture from the beginning of the call here:
Uploading chime_verbose_log_onVideoTileAdded_missing2.txt… - I can confirm that the video was added as well, as the web client was working perfectly during this last test.

Edit: I don't think github wants to upload it, so here is a mirror for the logfile: https://drive.google.com/file/d/1zMAmUCXPawyaKXP6RJ4hXRMXmANGWZt5/view?usp=sharing

@tianyux-amz
Copy link
Contributor

Hi @ribafish,

Thanks for providing details regarding your implementation. I understand that you are not binding view to newly added videos that do not belong to active speakers. However, the current SDK implementation always adds metadata of the new video to the internal cache, even you did not explicitly bind the video. The internal cache will be cleared only after you call unbindVideoView . If you don't unbind the view from the video, the internal cache remains and SDK will recognize the video as a new video.

I will discuss with the team and see if we want to update the SDK implementation and auto-clear the internal cache when onVideoTileRemoved was called for better API symmetry. At the same time, could you try to explicitly unbind video view when onVideoTileRemoved was called, and see if this solves your issue?

@ribafish
Copy link
Author

ribafish commented Dec 3, 2020

Hi @tianyux-amz ,

Thank you for the quick reply. Now that I added that video is unbound unconditionally when onVideoTileRemoved is called it seems to work well. I saw that you opened a PR with the change you proposed, which is great.

Just another clarification (both for before and going forward): In our case, where we're displaying a single video at a time, are we expected to call unbindVideoView before binding a different video or better not to? Since unbindVideoView clears some internal metadata, I'd say just call bindVideoView "over" the old one, but I wanted to confirm it.

@tianyux-amz
Copy link
Contributor

When you call bindVideoView(videoView, tileId), if videoView was bound to a different tile id before, or if tileId was bound to a different video render view before, it will automatically unbind and rebind with the new parameters. So you don't have to call unbindVideoView before calling bindVideoView.

@stale
Copy link

stale bot commented Dec 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive Stale label Dec 19, 2020
@linsang21
Copy link
Contributor

Hi @ribafish, PR has been merged with v.0.9.0. Maybe you can try out with your original implementation, if that is preferred.
Also let us know if there's further question regarding the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants