Closed Bug 1744807 Opened 3 years ago Closed 3 years ago

[webcontent] Camera switching bug when remembering decision for site

Categories

(Core :: WebRTC: Audio/Video, defect)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: kbrosnan, Assigned: jib)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

From github: https://github.com/mozilla-mobile/fenix/issues/22704.

Site with issue and any steps to reproduce

The following issue happens when toggling between cameras and telling Firefox to remember decision for this site.
It can be tested in the following example: https://codepen.io/mozmorris/pen/mddvKBE (this is not my code, but has the same issue I have in my own code that is not publicly available).

Expected behavior

When using the example and pressing the Switch camera button, the camera is supposed to switch between facing modes. When not remembering the decision, this functionality works properly, but once you selected remember it will crash and give the following error:
Error: DOMException: Starting videoinput failed

Actual behavior

Once remembered, the view crashes and the following error is thrown in the console: Error: DOMException: Starting videoinput failed

Does toggling Tracking Protection fix the issue? (Press the shield icon in the toolbar while on the site to see toggle)

No, this does not fix the issue

Can you reproduce in Chrome (or other non-Mozilla browser)?

No, in Chrome and Safari this is not an issue. The camera switching is done properly.

Device information

  • Android device: Google pixel 4a (but I can confirm this is also not working on other android devices)
  • Fenix version: 94.1.2

Change performed by the Move to Bugzilla add-on.

Hi Kevin, are you able to reproduce using the codepen in comment 0? — It WFM on my old Samsung S9.

If you're able to reproduce, which device(s) does it crash on (crash link?), and does it also repro using https://jsfiddle.net/jib1/fsexmu8v/ ?

Flags: needinfo?(kbrosnan)

I was going on Laurentiu Apahidean's confirmation of the problem. Redirect.

Flags: needinfo?(kbrosnan) → needinfo?(Laurentiu.Apahidean)

I wasn't able to reproduce the crash only the fact that the image becomes still when switching cameras.

Device used:
OnePlus 6T (Android 9)

Flags: needinfo?(Laurentiu.Apahidean)

The severity field is not set for this bug.
:jib, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jib)

Hi Laurentiu, does it repro with https://jsfiddle.net/jib1/fsexmu8v/show ?

Flags: needinfo?(jib) → needinfo?(Laurentiu.Apahidean)
Attached video 20220106_145410.mp4

I managed to reproduce the issue on the latest Firefox Preview Nightly 2022-01-05 using a OnePlus 6T (Android 9). After switching camera several times without selecting the remember option and eventually selecting it the AbortError: Starting videoinput failed error message is displayed when trying to switch cameras.

Flags: needinfo?(Laurentiu.Apahidean)
Assignee: nobody → jib
Status: NEW → ASSIGNED

Hi Laurentiu, would you mind trying this build (ARM, AArch64) from comment 8 to see if it fixes it?

Note since there's no ☑ Remember this decision in the GeckoView example app UX, you'll need to first go to about:config and set media.navigator.permission.disabled to true.

Flags: needinfo?(Laurentiu.Apahidean)
Attached video 20220110_173241.mp4

I tested the issue on a OnePlus 6T (Android 9) using the GeckoView example builds and the issue still occurs. The AbortError: Starting videoinput failed error message is still displayed when trying to switch cameras.

Flags: needinfo?(Laurentiu.Apahidean)

There's a chance my fix in comment 9 was no good. Laurentiu, would you mind trying again with the following build (ARM, AArch64)?

Flags: needinfo?(Laurentiu.Apahidean)
Attached video 20220120_174221.mp4

I tested the issue on a OnePlus 6T (Android 9) using the GeckoView example builds from Comment 11 and the issue still occurs. The AbortError: Starting videoinput failed error message is still displayed when trying to switch cameras.

Flags: needinfo?(Laurentiu.Apahidean)
Flags: needinfo?(jib)

Laurentiu, thank you for your patience. Could you run https://jsfiddle.net/jib1/78ba05vd/show and report back the output?

Flags: needinfo?(jib) → needinfo?(Laurentiu.Apahidean)
Attached video 20220202_171855.mp4

I ran https://jsfiddle.net/jib1/78ba05vd/show on the build from Comment 11 using a OnePlus 6T (Android 9) and didn't find any issues, no errors were encountered when switching camera and and the video didn't freeze.

Flags: needinfo?(Laurentiu.Apahidean)

Strange, so the 200ms delay worked in that case. Maybe it's worth landing the patch after all then. Odd that the try builds didn't have the same effect. Sometimes the gecko example builds don't install properly unless previous versions are deleted first...

Pushed by jbruaroey@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9fab2e3a294d Retry camera 200ms after failure to start once, like we do for mics, to assist frequent front/back flipping on some phones r=padenot
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

Although I can see that Firefox is not crashing anymore, I am still having issues with this.

It works fine, until it doesn't anymore. so like, first camera works, and then switching camera requires me ask permission again which should not be the case, but anyway, after switching through them all, one of the cameras fails to retrieve the stream, and once that one fails, all of the cameras seems to fail after that. And this happens with both asking permissions for every single camera, and with the "remember decision" option on...

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: