twilio / twilio-video.js

Twilio’s Programmable Video JavaScript SDK
https://www.twilio.com/docs/video/javascript
Other
567 stars 216 forks source link

Android 11 Chrome participant is thrown out with 53405 error #1701

Closed Antiai closed 2 years ago

Antiai commented 2 years ago

Issue description:

We were trying the Twilio Video App React on different devices and faced an issue on Android 11 Chrome browsers:

We've found the same behavior of the Quickstart app on the Android 11 Chrome browser. photo_2022-02-09 14 56 41

It could be reproduced here https://video-app-3516-1636-dev.twil.io?passcode=90170835161636 (passcode expires Wed Feb 16 2022)

Also, we have an enterprise app where we are experiencing the same issue on Android Chrome.

Expected behavior:

Actual behavior:

Software versions:

aibek-top commented 2 years ago

Same issue for me, please see my comment https://github.com/twilio/twilio-video.js/issues/1698#issuecomment-1033679913.

PikaJoyce commented 2 years ago

Hi @Antiai,

Thanks for opening up this issue with us and providing a ton of useful information. I'm going to begin my investigations and see if I can reproduce this. Could you also provide some room sids when this happens as well? Thank you!

Best, Joyce

Antiai commented 2 years ago

Hi, @PikaJoyce! Sure! Please use any of these:

PikaJoyce commented 2 years ago

Thank you for that @Antiai,

So I've tried to reproduce your issue on an Android 10 device but I was unable to reproduce it. However, it was an Android 10 device. I see that your ICE connection on the Android device is never established and there was one issue in the past in which Android 11 / Chrome v82 had ICE gathering issues, I'm wondering if this issue may have resurfaced.

Here are some other tools we can try out to narrow down what the issue might be: Could you try out this WebRTC sample on your device and see if a connection can be established? You should be able to see your local video (on the left) and if your connection is established, you'd see a remote video on the right side.

Also, please try opening this network test app up on your Android device and see if there are any failures.

Please let me know the results of your findings and hopefully we can hash this out!

Best, Joyce

Antiai commented 2 years ago

Thank you, @PikaJoyce !

I've checked WebRTC sample, and it works on Android 11 Chrome. I forgot to mention, that in the Twilio Video App React before connecting to a room we have a page with video preview - it works as well, and I can see the video stream from a camera. Troubles begin on trying to connect to a room. Also, here is the log from network test app on Android 11 Chrome:

[23:10:58] Test "TURN UDP Connectivity" started...

[23:11:03] Error: Error: Could not establish a UDP connection to Twilio within 5 seconds

[23:11:03] Test "TURN TCP Connectivity" started...

[23:11:04] Successfully established a TCP connection to Twilio in 1361ms

[23:11:04] Test "TURN TCP Connectivity" ended

[23:11:04] Test "TURN TLS Connectivity" started...

[23:11:10] Error: Error: Could not establish a TLS connection to Twilio within 5 seconds

[23:11:10] Test "Bandwidth" started...

[23:11:15] Error: Error: Could not establish a connection to Twilio within 5 seconds

[23:11:15] Test "Test call using PCMU" started...

[23:11:15] Initializing Twilio Client. Setting up Twilio.Device using PCMU...

[23:11:15] Twilio Client initialized

[23:11:15] Twilio Client connected to de1

[23:11:15] Requesting microphone access...

[23:11:16] Twilio Client disconnected. Overall quality not available - not supported by browser.

[23:11:16] Error: Error: Error making call: (31003) Connection with Twilio was interrupted.

It may fail on Voice: Bandwidth or Voice: Test call using PCMU steps - it changes from run to run.

PikaJoyce commented 2 years ago

Thank you for that @Antiai,

That's great to know. So I tested this on an Android 9 device as well on Chrome and I couldn't reproduce this either. Upon closer inspection of the logs from the two room sids you've provided I noticed something interesting. So in the room RM67f4e1b89ce13e31d301d699784c88df, the Android Chrome participant sent a disconnect so it doesn't seem like there's much there. However, more interestingly, in this room RMf2eb50f0a0fdda38160e1669f6ed9eab, I notice that there's a signaling connection time out on the Android Chrome participant.

2022-02-06T10:37:17.303Z: [participant_reconnecting] for P2 
2022-02-06T10:37:49.888Z: P2 received error: 53002 Signaling connection timed out: Reconnecting timeout
2022-02-06T10:37:49.888Z: [participant_disconnected] for P2 
2022-02-06T10:37:49.893Z: [participant_removed]

I noticed that aside from the OS version number being different, my group room signaling region is set to us1. Could you try setting that and seeing if it changes anything? Based on your error code documentation, this could be a possible solution!

I'll also file an internal ticket(VIDEO-8717) to investigate this further regardless, and post any updates or movements on that end on this thread.

Thank you for your patience and do let me know your results! Joyce

Antiai commented 2 years ago

@PikaJoyce I've tried to change signaling region to global and Germany - unfortunately, it doesn't help. Also, I've noticed a couple of things:

Here is the room SID of these cases RM4cf90538e04ee52262063a117d73e9d2

PikaJoyce commented 2 years ago

Hi @Antiai,

Thank you for your continued testing that's very valuable. I've reached out to the team about this issue. There is another thing I'm a tad bit worried about and was wondering if you could test really quickly as well which is this sample. If you click Gather candidates a list should show up. Please try this on both FireFox and Chrome if you have some time!

I noticed that on all instances where you're using Android Chrome, there is no ICE connection being established for any participant, but Android on FireFox establishes a connection in one of your rooms. This leads me to think the problem may run a bit deeper.

Thank you again, Joyce

q-kit commented 2 years ago

Hello @PikaJoyce,

I'm having a similar issue. Two of our users, both of whom are on Android 11, were not able to publish video or audio, and their attempts to connect ended up with multiple sessions of 45 to 48 seconds long.

I was able to reproduce this issue in AWS Device Farm with a Samsung Galaxy S21 emulator running on Android 11. I tried networktest.twilio.com with the emulator, and got a couple of errors for TURN UDP connection, TLS connection and a 31003 error, as the below screenshots show. Hope these clues can help with your troubleshooting.

errors errors2

Q

Antiai commented 2 years ago

Hi, @PikaJoyce! I've checked this sample on Android Firefox and Android Chrome. FF shows the list as expected, Chrome - doesn't do anything after a click on Gather candidates.

aibek-top commented 2 years ago

Hi @PikaJoyce,

Same thing happens to me. I have tested this app network test app and it shows many errors on Android 11 device, while when running on the desktop Chrome it works fine.

photo_2022-02-14_18-24-29 photo_2022-02-14_18-24-34 photo_2022-02-14_18-24-37 photo_2022-02-14_18-24-39

Also, similarly as in @Antiai's case in this sample I don't see anything after I press Gather candidates, on Chrome desktop it works fine.

Reproduced on twilio-video: @2.16.0, @2.19.1, Android 11 Galaxy A02, Chrome 98.0.4758.87 The room SID: RM744b2f1eb746b067f96a9826f42b7949

PikaJoyce commented 2 years ago

Folks,

Thank you all for providing various test cases and being so patient. Since this seems to be a more wide spread issue and others have also reported it through other outlets as well, I have gone ahead and filed an issue against Chrome. Please follow the issue here and star if you can so we can get this issue resolved as soon as possible! I'll keep this issue updated with any new updates that come in through Chrome and I will also pin this issue to get more visibility here.

Best, Joyce

fippo commented 2 years ago

This is mostly on Samsung devices, correct? The fix should be coming to Chrome shortly in M100 and potentially M99

PikaJoyce commented 2 years ago

Thank you @fippo !

Yes it seems like most folks here are testing on Samsung devices. We're looking forward to the fix!

Folks @Antiai @q-kit @aibek-top , I'll be keeping this thread open for updates. Once the fix goes out, if things look good, I will close this.

Best, Joyce

PikaJoyce commented 2 years ago

Hi folks,

It seems like this will be fixed on latest M99: 99.0.4844.58. I'll now be closing this issue. However, if folks are still coming up on issues please do not hesitate to open another ticket!

Last update here

Thanks, Joyce

PikaJoyce commented 2 years ago

Hi Folks,

I'm here to leave a quick tidbit in case anyone comes across this issue and is looking for some way to minimize the impact of this issue. Some users may not update their browsers and Chrome has not quite pushed out this fix yet on stable (as of this message, stable is at 99.0.4844.48), it's still coming soon (99.0.4844.58) but in the meanwhile, here's quick snippet the team came up with for folks to use to display a warning or error message to users on the affected devices.

// Chrome or Samsung browsers on Android 11
if (/(?=.*Android 11)(?=.*Chrome|SamsungBrowser)/.test(navigator.userAgent)) {
  showMessage('This browser version is not well suited for video apps on Android OS version 11. Please update your Chrome to the latest version, use Firefox browser, or update to Android 12');
}

Until then, I'll reopen this issue until Chrome ships the fix!

Best, Joyce

PikaJoyce commented 2 years ago

Hi everyone,

Long time no see! It's with great pleasure to say that Chrome has released the fix to this issue in the latest stable Chrome 99 (99.0.4844.78) today. So the update should be available for folks to use soon. As promised, I'll now close this issue as it's been fixed but will keep the pin on this.

Please see the post here

Thanks again for the patience everyone, Joyce

futurealecks commented 2 years ago

@PikaJoyce I believe this has resurfaced in Android 12, which I reported late last year (https://github.com/twilio/video-quickstart-android/issues/687).

Logs and screenshots are located in issue attached.