RESOLVED FIXED 198577
mediaDevices.enumerateDevices() doesn't list the system default audio devices with deviceId as "default"
https://bugs.webkit.org/show_bug.cgi?id=198577
Summary mediaDevices.enumerateDevices() doesn't list the system default audio devices...
Jaya A
Reported 2019-06-05 13:26:24 PDT
Created attachment 371432 [details] Output of mediaDevices.enumerateDevices() on Safari mediaDevices.enumerateDevices() on Safari 12.1 and Safari TP does not list the system default audio devices with deviceId as "default". Chrome enumerates the system default audio devices twice, once with the deviceId as "default" so that the WebRTC applications can identify them as such. Without this mechanism, the WebRTC application cannot identify the default mics and can run into issues with echo since microphones (like thunderbolt display and Logitech cameras) other than the built-in mics would still need AEC.
Attachments
Output of mediaDevices.enumerateDevices() on Safari (147.58 KB, image/png)
2019-06-05 13:26 PDT, Jaya A
no flags
Output of mediaDevices.enumerateDevices() on Chrome (284.19 KB, image/png)
2019-06-05 13:26 PDT, Jaya A
no flags
Patch (9.22 KB, patch)
2019-06-07 10:39 PDT, youenn fablet
no flags
Patch (9.26 KB, patch)
2019-06-07 12:12 PDT, youenn fablet
no flags
Jaya A
Comment 1 2019-06-05 13:26:55 PDT
Created attachment 371433 [details] Output of mediaDevices.enumerateDevices() on Chrome
Radar WebKit Bug Importer
Comment 2 2019-06-05 13:38:33 PDT
youenn fablet
Comment 3 2019-06-05 13:43:15 PDT
Thanks for the report. One option is to go like Chrome is doing but it duplicates the default entry which is not great. Another option might be to use the order of the MediaDeviceInfo sequence. The first microphone and first camera could always be the default devices.
youenn fablet
Comment 4 2019-06-05 14:04:32 PDT
> default mics and can run into issues with echo since microphones (like > thunderbolt display and Logitech cameras) other than the built-in mics would > still need AEC. I just tried with a Logitech Camera and did not experience the echo cancellation issue. I tried to test with a Thunderbolt Display and ended up with some issues. In that case, the microphone was the built-in one and the output was the display.
youenn fablet
Comment 5 2019-06-07 10:39:15 PDT
youenn fablet
Comment 6 2019-06-07 12:12:33 PDT
youenn fablet
Comment 7 2019-06-07 14:43:24 PDT
@Jaya, the patch will make sure that the first mic device is system default when calling enumerateDevices. Similarly, if calling getUserMedia without any constraint, the system mic will be used.
WebKit Commit Bot
Comment 8 2019-06-07 15:12:31 PDT
Comment on attachment 371602 [details] Patch Clearing flags on attachment: 371602 Committed r246215: <https://trac.webkit.org/changeset/246215>
WebKit Commit Bot
Comment 9 2019-06-07 15:12:32 PDT
All reviewed patches have been landed. Closing bug.
Jaya A
Comment 10 2019-06-07 15:39:27 PDT
Thank you Youenn for the quick fix. This will fix all our device selection and AEC issues with Safari.
Note You need to log in before you can comment on or make changes to this bug.