Closed Bug 1066015 Opened 10 years ago Closed 10 years ago

[Camera] black screen when press power key as soon as you open a camera app

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.0+, b2g-v2.0 verified, b2g-v2.0M verified, b2g-v2.1 verified, b2g-v2.2 verified)

RESOLVED FIXED
2.1 S5 (26sep)
blocking-b2g 2.0+
Tracking Status
b2g-v2.0 --- verified
b2g-v2.0M --- verified
b2g-v2.1 --- verified
b2g-v2.2 --- verified

People

(Reporter: hyuna.cho82, Assigned: justindarc)

Details

Attachments

(4 files)

Repos.
1) Open Camera app
2) Press power key when camera icon is shown
3) Unlock lockscreen
Observe camera app.
You can see only the black screen not preview stream.

It's reproduced on flame also.
Flags: needinfo?(dmarcos)
It's not different issue with Bug 1065199.
Summary: [Camera] black screen when press power key as soon as you a open camera app → [Camera] black screen when press power key as soon as you open a camera app
Hi Hyuna -

Just want to confirm, do you mean it is the same issue as Bug#1065199?

Thanks

Vance
Flags: needinfo?(hyuna.cho82)
Hi, Vance
Sorry, it's my mistake.
It's different issue.

When I check the log, camera obj released during getting camera obj in app side.

I tested after change the code like the below and it's not reproduce on the our device.
---------------------------------------------------
camera\js\lib\camera\camera.js

  function onSuccess(mozCamera) {
    debug('successfully got mozCamera');

    // black screen when press power key
    // as soon as you open a camera app
    if (document.hidden) {
      self.mozCamera = mozCamera;
      self.release();
      return;
    }

    self.setupNewCamera(mozCamera);
---------------------------------------------------

Please check it.
Flags: needinfo?(hyuna.cho82)
Hi Justin, Diego, could you help to comment on partner's modification on Comment#3 ?

Thanks

Vance
Flags: needinfo?(jdarcangelo)
Dear Hema,

Please check comment-3 with your engineer. 

Thank you.
Flags: needinfo?(hkoka)
I'd like to know if this is being caused by Bug 1067205. It seems like we're not getting visibilitychange events properly. If we were, I would think that the patch described in Comment 3 wouldn't be necessary.
Flags: needinfo?(jdarcangelo)
(In reply to hyuna.cho from comment #3)
> Hi, Vance
> Sorry, it's my mistake.
> It's different issue.
> 
> When I check the log, camera obj released during getting camera obj in app
> side.
> 
> I tested after change the code like the below and it's not reproduce on the
> our device.
> ---------------------------------------------------
> camera\js\lib\camera\camera.js
> 
>   function onSuccess(mozCamera) {
>     debug('successfully got mozCamera');
> 
>     // black screen when press power key
>     // as soon as you open a camera app
>     if (document.hidden) {
>       self.mozCamera = mozCamera;
>       self.release();
>       return;
>     }
> 
>     self.setupNewCamera(mozCamera);
> ---------------------------------------------------
> 
> Please check it.

Hyuna, can you put this change in a pull request?
Flags: needinfo?(hyuna.cho82)
clearing my NI. Justin can provide feedback, please create PR.
Attached file PR-1066015.html
Attachment #8492946 - Flags: review?(jdarcangelo)
Flags: needinfo?(hyuna.cho82)
Comment on attachment 8492946 [details]
PR-1066015.html

I really don't know what to do here. While this patch *does* fix the issue, this bug itself is actually a side-effect of Bug 1067205 where we are no longer getting `visibilitychange` events when the lock-button is pressed. So, while this patch fixes the one particular case where the user presses the 'lock' button before the viewfinder appears, we still have many other issues related to `visibilitychange` that are not fixed (ex: pressing 'lock' at any time when the viewfinder is up and running does not release the camera hardware and the camera will continue to focus and emit the flash while the phone is locked).

Note, I don't have any particular issues with the code in this patch and I would otherwise give an R+, I would like to get to the bottom of Bug 1067205 first.
Depends on: 1067205
Flags: needinfo?(dmarcos)
After further investigation, removing dependency on Bug 1067205. This issue, while related, is actually separate and is reproducible even in earlier builds that are not affected by Bug 1067205.
No longer depends on: 1067205
Comment on attachment 8492946 [details]
PR-1066015.html

Looks good. This should prevent a race condition where the device is locked prior to the camera hardware acquisition completes.
Attachment #8492946 - Flags: review?(jdarcangelo) → review+
Flags: needinfo?(hkoka)
Landed on master:

https://github.com/mozilla-b2g/gaia/commit/b81589cee548ebc95ad9a3f75c4d231ea3644cb8
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Hi, Justin

plz land this patch on v2.0 branch also.

Thanks
Flags: needinfo?(jdarcangelo)
[Blocking Requested - why for this release]:

See comment 14.
blocking-b2g: --- → 2.0?
Flags: needinfo?(jdarcangelo) → needinfo?(hkoka)
Triage requesting branch checks from QA. We need to understand the reproducibility, and whether this occurs on 2.1 and needs a backport to there as well.
Keywords: qawanted
Blocking Reason: Black Screen when opening camera in a not-so-uncommon scenario (see original description), leading to extremely poor user experience. Affecting Madai and Flame based on dev testing. 

Inder, Are you able to reproduce this on QRD too?

NI Bhavana too for any other approvals required for 2.0
blocking-b2g: 2.0? → 2.0+
Flags: needinfo?(ikumar)
Flags: needinfo?(hkoka)
Flags: needinfo?(bbajaj)
This issue DOES repro on Flame 2.1, Flame 2.0, Flame 2.0(Base), and Open C 2.2

Actual Result: Black screen is displayed. 

Device: Open_C 2.2
BuildID: 20140923065343
Gaia: 37b8a812c642ca616bf9457cb9b71e45261cdfa8
Gecko: 9e193395b912
Version: 35.0a1 (2.2)
Firmware: P821A10v1.0.0B06_LOG_DL
User Agent: Mozilla/5.0 (Mobile; rv:35.0) Gecko/35.0 Firefox/35.0

Flame 2.1 

Device: Flame 2.1
BuildID: 20140924000243
Gaia: 93a99bea0b40d81bd063f7d8b1964dc1ba35ba7b
Gecko: d7e31ecd48af
Version: 34.0a2 (2.1)
Firmware: v180
User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0

Flame 2.0 

Device: Flame 2.0
BuildID: 20140924003005
Gaia: 263e3b201dca967ec5346e35901aa981ca47dce7
Gecko: 35d791e16d31
Version: 32.0 (2.0)
Firmware: V180
User Agent: Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0

Flame 2.0 base

Device: Flame 2.0
BuildID: 20140904160718
Gaia: 506da297098326c671523707caae6eaba7e718da
Gecko: 
Version: 32.0 (2.0)
Firmware: V180
User Agent: Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0

____________________________________________________________________________________________________________________________________
This issue does NOT repro on Flame 2.2

Actual result: Preview stream is displayed.

Flame 2.2

Device: Flame 2.2
BuildID: 20140923162022
Gaia: ff6dbb006e4e60edba697639aa2a2a199b07069b
Gecko: afc933adf723
Version: 35.0a1 (Master) 
Firmware Version: L1TC10011800
User Agent: Mozilla/5.0 (Mobile; rv:35.0) Gecko/35.0 Firefox/35.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(jmitchell)
Keywords: qawanted
QA Contact: smiko
Justin - 

2.0 and 2.1 are both affected and need uplifts
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(jmitchell) → needinfo?(jdarcangelo)
Attached file pull-request (v2.0)
Pull Request for v2.0 -- Carrying R+ forward
Attachment #8494796 - Flags: review+
Flags: needinfo?(jdarcangelo)
Attached file pull-request (v2.1)
Pull Request for v2.1 -- Carrying R+ forward
Attachment #8494797 - Flags: review+
Please request v2.0 and v2.1 approval on these patches when you get a chance.
Assignee: nobody → jdarcangelo
Flags: needinfo?(jdarcangelo)
Target Milestone: --- → 2.1 S5 (26sep)
Comment on attachment 8494796 [details] [review]
pull-request (v2.0)

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): none
[User impact] if declined: User can launch Camera, lock the screen and get a black screen when unlocking
[Testing completed]: Tested on Flame
[Risk to taking this patch] (and alternatives if risky): none
[String changes made]: none
Attachment #8494796 - Flags: approval-gaia-v2.0?(fabrice)
Flags: needinfo?(jdarcangelo)
Comment on attachment 8494797 [details] [review]
pull-request (v2.1)

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #): none
[User impact] if declined: User can launch Camera, lock the screen and get a black screen when unlocking
[Testing completed]: Tested on Flame
[Risk to taking this patch] (and alternatives if risky): none
[String changes made]: none
Attachment #8494797 - Flags: approval-gaia-v2.1?(fabrice)
Attachment #8494796 - Flags: approval-gaia-v2.0?(fabrice) → approval-gaia-v2.0?(release-mgmt)
Attachment #8494797 - Flags: approval-gaia-v2.1?(fabrice) → approval-gaia-v2.1+
Flags: needinfo?(bbajaj)
Attachment #8494796 - Flags: approval-gaia-v2.0?(release-mgmt) → approval-gaia-v2.0+
Attached video video
According to issue steps, we cannot reproduce on Woodduck 2.0, Flame 2.0, 2.1, 2.2.
See attachment: Verify_video.MP4
Reproducing rate: 0/5

Woodduck2.0 build:
Gaia-Rev        60146ec47cd38a8be8ed22e0116902eceb9ac067
Gecko-Rev       cdfbe9866cf0b71b33454926638ce0cd8bb1fb00
Build-ID        20141117050313
Version         32.0

Flame 2.0 build:
Gaia-Rev        086a668942292168f312b3bb53e275fa0886fab1
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/a57b299c5cf2
Build-ID        20141117000200
Version         32.0

Flame 2.1 build:
Gaia-Rev        81160ad79e5b4c21967418dd63f1a1d08d77924e
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/3572aa3e6766
Build-ID        20141117001201
Version         34.0

Flame 2.2 build:
Gaia-Rev        ae3a84acaab80a5b35d5542d63e68462273c8a1b
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/2d0a51ef828d
Build-ID        20141117160200
Version         36.0a1
Flags: needinfo?(ikumar)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: