Calling getUserMedia in Safari Technology Preview gives an error: NotReadableError: The I/O read operation failed. Safari 11.1.2 works fine. Tested with Safari Technology Preview Release 62 https://webrtc.github.io/samples/src/content/getusermedia/gum/
<rdar://problem/42916838>
I am unable to reproduce on Mojave running STP Release 62 (Safari 12.1, WebKit 14607.1.1) I am also unable to reproduce on High Sierra Release 62 STP (Safari 12.1, WebKit 13607.1.1) Could you please capture a sysdiagnose after reproducing this issue? Thank you.
I'm using: MacBook Pro (13-inch Late 2011) macOS High Sierra Version 10.13.6 Safari Technology Preview Release 62 (Safari 12.1, WebKit 13607.1.1 I tested again and now I'm not getting the error so feel free to close the issue.
It sounds like the camera and/or microphone wasn't available when you tested before. Thanks for reporting the bug and for updating it so quickly Ben!
I have a test case that cause the NotReadableError every time both on Safari Technology Preview 12.1 (WebKit 13607.1.1) and Safari on iOS 12 Beta 4: https://benbro.github.io/samples/src/content/peerconnection/pc1/ Click on the Start and Call buttons. It'll call getUserMedia with just audio, add it to the peer connection and negotiate. Click on the GUM button. This time it call getUserMedia with both audio and video and you should see the NotReadableError.
Created attachment 346648 [details] Patch
Comment on attachment 346648 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=346648&action=review Looks good r=me > Source/WebKit/UIProcess/UserMediaProcessManager.cpp:151 > + if (withAudio && !(currentExtensions & ProcessState::SandboxExtensionsGranted::Audio)) { All of this might be slightly easier to follow if we used a helper function to check for extension types (e.g., "bool hasAudioExtension(unsigned currentExtensions) { return currentExtensions & ProcessState::SandboxExtensionsGranted::Audio; }" and so forth). But not needed for this bug fix.
Comment on attachment 346648 [details] Patch Attachment 346648 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8788544 New failing tests: imported/blink/transitions/unprefixed-transform.html
Created attachment 346712 [details] Archive of layout-test-results from ews206 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
(In reply to Build Bot from comment #9) > Created attachment 346712 [details] > Archive of layout-test-results from ews206 for win-future > > The attached test failures were seen while running run-webkit-tests on the > win-ews. > Bot: ews206 Port: win-future Platform: > CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit These are unrelated.
Comment on attachment 346648 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=346648&action=review >> Source/WebKit/UIProcess/UserMediaProcessManager.cpp:151 >> + if (withAudio && !(currentExtensions & ProcessState::SandboxExtensionsGranted::Audio)) { > > All of this might be slightly easier to follow if we used a helper function to check for extension types (e.g., "bool hasAudioExtension(unsigned currentExtensions) { return currentExtensions & ProcessState::SandboxExtensionsGranted::Audio; }" and so forth). > > But not needed for this bug fix. Good idea, I will upload a new patch that does this.
Created attachment 346713 [details] Patch
Comment on attachment 346713 [details] Patch Wow -- this is a lot easier to understand. r=me
Comment on attachment 346713 [details] Patch Clearing flags on attachment: 346713 Committed r234662: <https://trac.webkit.org/changeset/234662>
All reviewed patches have been landed. Closing bug.
I'm still getting NotReadableError on iOS 12 Beta 10 with the test https://benbro.github.io/samples/src/content/peerconnection/pc1/ Tested with: iOS 12.0 Beta 10 (605.1.15)
Still broken on Safari 12 (AppleWebkit/605.1.15) iOS beta 10.
Still broken on Safari 12 (AppleWebkit/605.1.15) iOS 12.
(In reply to Ben from comment #18) > Still broken on Safari 12 (AppleWebkit/605.1.15) iOS 12. Thanks Ben, I also was able to repro the issue. Will need to investigate further to find the root cause.
Still broken on iOS 12.1
If you first call GUM with just video and than again with audio+video you won't get an error but the audio packets with have zero volume.
youenn: any update on this bug?
(In reply to Ben from comment #22) > youenn: any update on this bug? Trying on STP and iOS12.2 beta, I cannot repro it anymore. I will try on another device though. I saw some crashes but https://bugs.webkit.org/show_bug.cgi?id=194181 should solve this.
Thank you for the fix and validation. This bug is about first calling GUM with audio and than with audio+video. Did you also check the reverse? Calling GUM with only video and than with audio+video? In my test there is no error but the audio packets has zero volume.
(In reply to Ben from comment #24) > Thank you for the fix and validation. If you have time for iOS 12.2 validation, that would be great. > This bug is about first calling GUM with audio and than with audio+video. > Did you also check the reverse? Calling GUM with only video and than with > audio+video? In my test there is no error but the audio packets has zero > volume. Tried https://youennf.github.io/webrtc-tests/src/content/getusermedia/volume-after-video/. This seems to work fine on iOS. On MacOS, I hit that issue a few times but am unable to repro it right now. Reloading the page fixes the issue.
I can reproduce both issues (error and volume zero) in iOS 12.1.4 so if you don't see them on iOS 12.2 beta that's great. The fact that you hit the volume issue on MacOS few times is not reassuring.