Camera - preview can't start reliably

RESOLVED WORKSFORME

Status

Firefox OS
General
RESOLVED WORKSFORME
6 years ago
6 years ago

People

(Reporter: kanru, Assigned: mikeh)

Tracking

unspecified
x86_64
Linux

Firefox Tracking Flags

(blocking-basecamp:+)

Details

(Whiteboard: [WebAPI:P0][LOE:M])

(Reporter)

Description

6 years ago
This is tested on m-c 102789:360ab7771e27 with optimize disabled. It might be related to bug 781892

How to reproduce?

 1. start the camera app (no preview)
 2. go back to home screen
 3. start the camera app (still no preview)
 4. tap the black preview area (the preview starts)
 5. go back to home screen
 6. start the camera app (preview never starts)
On 102864:0900ffbccd14, step (4) doesn't work for me.

I also see 

E/GeckoConsole(  106): [JavaScript Error: "TypeError: this._cameraObj is null" {file: "app://camera.thisdomaindoesnotexist.org/js/camera.js" line: 312}]

in logcat when I try to capture an image.  Seems like it might be related.

Maybe we're failing to create some camera-related objects in the DOM API and preview has no chance to start?
Summary: Camera preview can't start reliably → Camera - preview can't start reliably
Nomming for basecamp, as this is a must have.
blocking-basecamp: --- → ?
Kan-Ru, Mike, when testing bug 782456 I noticed that preview worked very reliably in a debug build on the Nexus S.  I found out while flying, however, that it is *not* reliable in an opt build on the Nexus S.

So it would be interesting to test a debug build on otoro, and see if it works there.  If so, I would suspect a race condition in initialization.
blocking-basecamp: ? → +
(Reporter)

Comment 4

6 years ago
(In reply to Chris Jones [:cjones] [:warhammer] from comment #3)
> Kan-Ru, Mike, when testing bug 782456 I noticed that preview worked very
> reliably in a debug build on the Nexus S.  I found out while flying,
> however, that it is *not* reliable in an opt build on the Nexus S.
> 
> So it would be interesting to test a debug build on otoro, and see if it
> works there.  If so, I would suspect a race condition in initialization.

By debug build do you mean B2G_NOOPT && B2G_DEBUG? The STR in comment 0 is from such debug build. However with latest gecko and patch from bug 784829 I can get the camera preview reliably on first launch.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #3)
> Kan-Ru, Mike, when testing bug 782456 I noticed that preview worked very
> reliably in a debug build on the Nexus S.  I found out while flying,
> however, that it is *not* reliable in an opt build on the Nexus S.
> 
> So it would be interesting to test a debug build on otoro, and see if it
> works there.  If so, I would suspect a race condition in initialization.

I've been testing on Otoro with B2G_DEBUG enabled, along with media stream logging, and a whole ton of reference count logging, and the pattern is almost always the same: initial preview bring-up works, take a picture, preview comes back, take a picture, no preview.
I've confirmed that if ReceiveFrame() is replaced with a stub that just immediately frees the preview data buffer, the preview never freezes.
(In reply to Kan-Ru Chen [:kanru] from comment #4)
> (In reply to Chris Jones [:cjones] [:warhammer] from comment #3)
> > Kan-Ru, Mike, when testing bug 782456 I noticed that preview worked very
> > reliably in a debug build on the Nexus S.  I found out while flying,
> > however, that it is *not* reliable in an opt build on the Nexus S.
> > 
> > So it would be interesting to test a debug build on otoro, and see if it
> > works there.  If so, I would suspect a race condition in initialization.
> 
> By debug build do you mean B2G_NOOPT && B2G_DEBUG? The STR in comment 0 is
> from such debug build. However with latest gecko and patch from bug 784829 I
> can get the camera preview reliably on first launch.

Yes DEBUG && NOOPT.
Mike, it probably doesn't matter, but should you or Kan-Ru be the owner here?  I picked you but feel free to re-assign.  Thanks.
Assignee: nobody → mhabicher
(Reporter)

Comment 9

6 years ago
The preview stall issue is resolved in bug 781892. This one is about that camera fails to stop & start reliably. Let's see how it works after Mike land the cycle collector patches.
The Sao Paulo patch landed in m-i last night:
  https://hg.mozilla.org/integration/mozilla-inbound/rev/244bba751ce4

Hopefully it will show up on m-c soon.
Whiteboard: [WebAPI:P0]
Kan-Ru: can you confirm whether or not this issue is still happening?
Whiteboard: [WebAPI:P0] → [WebAPI:P0][LOE:M]
(Reporter)

Comment 13

6 years ago
(In reply to Mike Habicher [:mikeh] from comment #12)
> Kan-Ru: can you confirm whether or not this issue is still happening?

I can start the camera every time now.
Should we close this?
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.