[Camera][Leo] Viewfinder is black

VERIFIED FIXED in Firefox OS v1.1hd

Status

--
major
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: marcia, Assigned: roc)

Tracking

({regression, smoketest})

unspecified
1.1 QE4 (15jul)
ARM
Gonk (Firefox OS)
regression, smoketest

Firefox Tracking Flags

(blocking-b2g:leo+, firefox25 unaffected, b2g18 verified, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix, b2g-v1.1hd fixed)

Details

Attachments

(6 attachments)

Seen while running unagi, using:

Gecko  http://hg.mozilla.org/releases/mozilla-b2g18/rev/855297ec671e
Gaia   e6666a2135244f75ff793aae790feeddbeae8832
BuildID 20130626070211
Version 18.0

STR:
1. Fresh flash of latest V1 train unagi build
2. Select the camera icon
3. See nothing through the viewfinder - all is black
4. Take a picture

Expected: I could see what I am taking a picture of
Actual: I cannot see anything but black
Created attachment 767824 [details]
Logcat filtered on camera

Here is the logcat. At time of testing, battery on device was at 17%.
Looks like we're setting up the preview window and then tearing it down again.

06-26 09:45:07.055: E/QualcommCamera(120): Qint android::set_preview_window(camera_device*, preview_stream_ops*): E window = 0x999cd8
06-26 09:45:07.055: E/QualcommCamera(120): Qint android::start_preview(camera_device*): E
06-26 09:45:07.235: E/QualcommCameraHardware(120): bool android::QualcommCameraHardware::initPreview() Got preview dimension as 576 x 432 
06-26 09:45:07.295: E/QualcommCamera(120): Qint android::start_preview(camera_device*): X
06-26 09:45:08.756: E/QualcommCamera(120): Qvoid android::disable_msg_type(camera_device*, int32_t): E
06-26 09:45:08.756: E/QualcommCamera(120): Qvoid android::disable_msg_type(camera_device*, int32_t): E
06-26 09:45:08.756: E/QualcommCamera(120): Qvoid android::stop_preview(camera_device*): E
06-26 09:45:08.837: E/QualcommCameraHardware(120): stopPreviewInternal, J_mCameraRunning = 0
06-26 09:45:08.847: E/QualcommCamera(120): Qvoid android::disable_msg_type(camera_device*, int32_t): E
06-26 09:45:08.847: E/QualcommCamera(120): Qvoid android::disable_msg_type(camera_device*, int32_t): E
06-26 09:45:08.847: E/QualcommCamera(120): Qvoid android::stop_preview(camera_device*): E
06-26 09:45:08.847: E/QualcommCameraHardware(120): stopPreviewInternal, J_mCameraRunning = 0
06-26 09:45:08.847: E/QualcommCamera(120): Qvoid android::disable_msg_type(camera_device*, int32_t): E
06-26 09:45:08.847: E/QualcommCamera(120): Qvoid android::stop_preview(camera_device*): E
06-26 09:45:08.847: E/QualcommCameraHardware(120): stopPreviewInternal, J_mCameraRunning = 0
06-26 09:45:08.847: E/QualcommCamera(120): Qint android::cancel_picture(camera_device*): E
06-26 09:45:08.847: E/QualcommCamera(120): Qvoid android::release(camera_device*): E
06-26 09:45:08.847: I/QualcommCameraHardware(120): release: mCameraRunning = 0
06-26 09:45:08.847: E/CAM_FD(120): cam_conf: CAMERA_EXIT
06-26 09:45:08.847: I/QualcommCameraHardware(120): release X: mCameraRunning = 0, mFrameThreadRunning = 0
06-26 09:45:08.847: E/QualcommCamera(120): Qint android::set_preview_window(camera_device*, preview_stream_ops*): E window = 0x0

Marcia, was the logcat captured while the fail-case happened, or after the fact?

Either way, can you please attach a copy of the logcat output captured while the test is happening, without filtering on "camera"? It might be useful to have additional context. If you can also capture the kernel log at the same time in a separate window, that would be handy: |adb shell dmesg|.

No need to post as .rtf files--text is fine. Thanks!
Flags: needinfo?(mozillamarcia.knous)
Mike: Logcat taking during the fail case. Nominating for blocking since this is occuring on Leo as well. Better logcat coming.
blocking-b2g: --- → leo?
Flags: needinfo?(mozillamarcia.knous)
Summary: [Camera] Viewfinder is black → [Camera][Leo] Viewfinder is black
Duplicate of this bug: 887340
Created attachment 767893 [details]
Leo device logcat running while taking pics with camera
Created attachment 767894 [details]
Leo device adb shell dmesg
Thanks, Marcia.

Inder, I see this in the kernel log:

<3>[2013-06-27 03:19:51 KST][  982.508193] [adsp_driver.c:adsp_pmem_check] module JPEGTASK: region (vaddr 43156c00 len 2883584) clashes with registered region (vaddr 42f82000 paddr 2baef000 len 2883584

Could this be the cause of the viewfinder failing to start?

The logcat output also shows plenty of occurrences of "fail" and "error", but none of them make any sense to me.
Flags: needinfo?(ikumar)
For reference, push log from past two days below:

http://hg.mozilla.org/releases/mozilla-b2g18/pushloghtml?startdate=2013-06-24&enddate=2013-06-26

Although based on the discussion I'm seeing above, this looks like a RIL problem potentially.

Comment 9

5 years ago
> Inder, I see this in the kernel log:
> 
> <3>[2013-06-27 03:19:51 KST][  982.508193] [adsp_driver.c:adsp_pmem_check]
> module JPEGTASK: region (vaddr 43156c00 len 2883584) clashes with registered
> region (vaddr 42f82000 paddr 2baef000 len 2883584
> 
> Could this be the cause of the viewfinder failing to start?

MikeH, not sure. Don't see how JPEGTASK pmem clash would impact viewfinder to not come up.
Flags: needinfo?(ikumar)

Comment 10

5 years ago
We are able to reproduce this issue on our reference devices. What we noticed that this issue  doesn't happen on "userdebug" builds but we are able to reproduce it on "eng" builds. I compared the two logcats and I don't see any camera errors.
MikeH, I also don't see any JPEGTASK error in dmesg.

Only difference that jumps out and can give a clue to the issue is this error i see on eng build:

E/msm7627a.hwcomposer(  124): drawLayerUsingCopybit: wrong params for display screen_w=0 src_crop_width=576 screen_w=0                                 src_crop_width=576

I see this message in the attached logcat as well.
Diego, any idea why we are seeing this in "eng" build only and could it be causing any issue?
Flags: needinfo?(dwilson)
(Reporter)

Updated

5 years ago
Duplicate of this bug: 887727

Comment 12

5 years ago
I could successfully take pictures even with viewfinder blank which confirms that there is no issue with the camera. It's just not able to display it on screen because of some wrong display dimensions.
BTW, As I suspected, I disabled the hwcomposer by removing /system/lib/hw/hwcomposer.msm7627a.so and still see the issue. (removing NI on Diego).

Not sure how it works in userdebug builds though.
Flags: needinfo?(dwilson)
Duplicate of this bug: 888043
blocking-b2g: leo? → leo+
Keywords: smoketest

Comment 14

5 years ago
Look likes a regression of Bug 876542.
After reverted this commit, camera preview works.

--
Keven
(In reply to kkuo from comment #14)
> Look likes a regression of Bug 876542.
> After reverted this commit, camera preview works.
> 
> --
> Keven

I can confirm that reverting this commit makes the camera preview working again on Nexus S and Inari.
Maybe :nical could help us ?
Flags: needinfo?(nical.bugzilla)
Seems like this change also « fix »:

diff --git a/apps/camera/js/camera.js b/apps/camera/js/camera.js
index 3102edf..8c90781 100644
--- a/apps/camera/js/camera.js
+++ b/apps/camera/js/camera.js
@@ -878,9 +878,9 @@ var Camera = {
     var dy = -(width - screenWidth) / 2;
     transform = 'translate(' + dx + 'px,' + dy + 'px) ' + transform;
 
-    style.transform = transform;
-    style.width = width + 'px';
-    style.height = height + 'px';
+    // style.transform = transform;
+    // style.width = width + 'px';
+    // style.height = height + 'px';
   },
 
Of I only leave the style.width and style.height, then the video is here but misplaced.
Flags: needinfo?(dale)
After testing with padenot, we deduced that it seems to be related to the rotate and/or the transform operations performed in setPreviewSize() of camera.js. I'll try to investigate this during the weekend.
Fun fact: I've just noticed that the task switcher preview is okay.
Created attachment 769376 [details]
fun fact part 1

Fun fact part 1 : preview is black in camera app.
Created attachment 769377 [details]
fun fact part 2

Fun fact part 2: the camera preview is okay in taskswitcher mode
Not reverting anything, but adding this change, I get Camera preview working !

diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp
index ae20e8c..5b8dcbd 100644
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -602,8 +602,10 @@ CompositorParent::TransformFixedLayers(Layer* aLayer,
   gfxMatrix transform2D;
   gfxSize scale = aScaleDiff;
   if (transform.Is2D(&transform2D)) {
-    scale.width *= transform2D.xx;
-    scale.height *= transform2D.yy;
+    if (transform2D.xx > 0.0 && transform2D.yy > 0.0) {
+      scale.width *= transform2D.xx;
+      scale.height *= transform2D.yy;
+    }
   }
 
   if (aLayer->GetIsFixedPosition() &&
Created attachment 769389 [details] [diff] [review]
Ensuring that the transform is useful

Please find attached a patch that fixes the issue. I'm not sure to understand the full implications, though, but it makes Camera preview working again.
Attachment #769389 - Flags: review?(roc)
Attachment #769389 - Flags: review?(ajones)
Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(dale)
Fixed by backing out fix for bug 876542.
https://hg.mozilla.org/releases/mozilla-b2g18/rev/5618446628da
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 25

5 years ago
Confirmed resolved on Unagi/Leo v1.1.0 Moz/Comm RILs:
Build ID: 20130701070213
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/15923aca6e6d
Gaia: c7472acec84f0d4527cdd6fd555d289e1d3e1d1d
Platform Version: 18.1

Comment 26

5 years ago
Verifying as fixed per comment 25
Status: RESOLVED → VERIFIED
https://hg.mozilla.org/releases/mozilla-b2g18_v1_1_0_hd/rev/5618446628da
status-b2g18: --- → verified
status-b2g18-v1.0.0: --- → wontfix
status-b2g18-v1.0.1: --- → wontfix
status-b2g-v1.1hd: --- → fixed
status-firefox25: --- → unaffected
Assignee: nobody → roc
Target Milestone: --- → 1.1 QE4 (15jul)
Attachment #769389 - Flags: review?(roc)
Attachment #769389 - Flags: review?(ajones)

Comment 28

5 years ago
:Inder,

On a qcom device, I see this issue on 1.3 as well. Do you have any fix for this issue?

When I launch the camera, the screen goes blank often, but able to capture the picture. When tapped on the view finder, preview comes and again goes off. I had to capture a random pic, launch the gallery from the film strip and come back to camera app to have it working proper.
Flags: needinfo?(ikumar)

Updated

5 years ago
Flags: needinfo?

Comment 29

5 years ago
:Madana -- it's probably a hwc issue which will be fixed soon. Please send me an email if you need more details.
Flags: needinfo?(ikumar)
Flags: needinfo?
You need to log in before you can comment on or make changes to this bug.