-
Notifications
You must be signed in to change notification settings - Fork 55
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
[BUG] High CPU usage: "deviceinfochange" event is being dispatched indefinitely #126
Comments
Hi @cmaiquel , thanks for submitting. Usually devices will show with empty labels if you haven't asked for media permissions, or the user denied media access. We recommend to call getUserMedia and get the necessary permissions before enumerating devices or placing a call. With that said, are you able to reproduce this issue after getting the necessary media permissions? |
@charliesantos I'm using the Voice SDK for voice calls. Ideally, I wouldn't need the video device permissions. |
I submitted an internal ticket to address this @cmaiquel . |
Thanks @charliesantos. |
@cmaiquel I agree! This should get addressed in our modernization effort for the SDK. |
I kinda agree with @cmaiquel. Lately, we moved the device management logic into a separate logic instead of using Twilio internal implementation, and we react to the device change based on the modern browser APIs, but the issue, is when we try to let the Twilio SDK know about a newly plugged device, the SDK will just crash and fail clean-up resources (cleaning up the master audio, etc ...), as the SDK is not yet aware of this new plugged Device because of this 500ms interval. I think based on your Browser Support List, this most probably needs to be dropped off in favour of the native browser APIs. |
I completely agree @kamalbennani @cmaiquel ! |
@cmaiquel @kamalbennani we started the work on this issue. Just letting you know that we are probably not going to drop the polling logic since some of our supported browsers still does not support the native API. However, we will figure out how to feature detect this one so we don't have to poll on browsers that do support the native API. |
Should be fixed in #155 |
Should be fixed in 2.4.0 |
Thanks! I will try the fix. |
or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Code to reproduce the issue:
mediadevices.js
When a media device has an empty label, the method "deviceInfosHaveChanged" always returns true
A macOS "videoinput" device with an empty label, causing this behavior:
Expected behavior:
Do not dispatch "deviceinfochange" in an indefinite loop for empty labeled devices.
Software versions:
The text was updated successfully, but these errors were encountered: