Closed Bug 983705 Opened 7 years ago Closed 7 years ago

[Camera][Madai][Buri] Camera Preview is not working on Qualcomm QRD device due to preview size anomalies

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
1.4 S5 (11apr)
Tracking Status
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: hkoka, Assigned: justindarc)

References

Details

(Whiteboard: [branch-camera-new-features] [priority])

Attachments

(1 file)

Info from Qualcomm Testing on Camera-New-Features Branch:

Camera preview isn’t working on the QRD due to the preview size that the camera app is requesting during still capture mode:
* master branch (works): 352x228 
* camera-new-features branch (doesn’t work): 576x432

The selectOptimalPreviewSize() function in apps/camera/js/lib/camera-utils.js has seen significant change between the two branches and that’s where the preview size selection difference is coming from between the two Gaia branches.

In theory both preview sizes are being reported up from our Camera HAL, so I’m not convinced yet that this is a Gaia issue.   The larger preview size is desirable anyway, and AFAICT the Camera HAL is reporting 576x432 as a valid preview size to the framework, even though it later rejects that size at https://www.codeaurora.org/cgit/quic/la/platform/hardware/qcom/camera/tree/QCamera2/HAL/QCameraParameters.cpp?id=36bf886bb0c8e8422f1da158021a66bc6a87f18c#n1087

Diego, can you please take a look at this in more detail during Friday SD time.   It’s pretty important that we get to the bottom of this issue quickly, to enable these camera features to land ASAP.
No longer depends on: 982900
Assignee: nobody → jdarcangelo
Flags: needinfo?(dflanagan)
Assignee: jdarcangelo → dwilson
dwilson: if you need us to workaround this issue in gaia, let us know what the 'deviceinfo.hardware' setting returns on your device.  That's the string that appears under "Model" in  Settings->Device Information
Flags: needinfo?(dflanagan)
Looks like this branch has the same issue as bug 969761. The camera app is not using the real screen resolution when calculating the preview size. This is solved by multiplying window.innerWidth by window.devicePixelRatio here:

https://github.com/mozilla-b2g/gaia/blob/camera-new-features/apps/camera/js/lib/camera-utils.js#L56-L63

When I do this I can see the preview and take snapshots. Although the preview position looks a bit off.

There's probably still a bug in the camera driver for 576x432.

@djf does the gaia camera change above sound reasonable to you?
Flags: needinfo?(dflanagan)
dwilson: we keep changing this code, and I can't remember if there is any reason why we're not using devicePixelRatio here.  This function is a recent chagne and I think I should have caught that on code review but did not.  Setting needinfo for Justin to confirm.
Flags: needinfo?(dflanagan) → needinfo?(jdarcangelo)
Well, the best explanation for this I know of comes from you https://bugzilla.mozilla.org/show_bug.cgi?id=969761#c12
Assignee: dwilson → jdarcangelo
Flags: needinfo?(jdarcangelo)
Attachment #8391506 - Flags: review?(dflanagan)
Comment on attachment 8391506 [details] [review]
pull-request (camera-new-features)

r+ if you add documentation making it explicit that the viewportSize argument is expected to be in device pixels. This is an unusual enough design choice that it needs to be called out.
Attachment #8391506 - Flags: review?(dflanagan) → review+
Landed on camera-new-features:

https://github.com/mozilla-b2g/gaia/commit/8c53c3e6d09a14a6ad398a4ad8c98b392f7361e1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Hi Justin
My QRD still has no preview in camera, or do I need specific gecko version?
Eric: There is no preview at all? Or the preview is not using the correct size?
Flags: needinfo?(echang)
Eric: If possible, can you debug the Camera in App Manager and run the following in the JS console and report the results here:

`app.camera.previewSizes()`

and

`app.camera.previewSize()`

The first line will give you the list of previewSizes being returned from the QRD camera, the second line will give you the previewSize that's being used. This will help us out a great deal in determining the issue.

Also, while you're at it, if you could get me the devicePixelRatio of the QRD, that would be a tremendous helps as well:

`window.devicePixelRatio`

Thanks!
There is no preview at all, like a black wallpaper with icons on it. I got this.mozCamera is null from these 2 preview size commands so I think there should be something wrong with my gecko. 

window.devicePixelRatio = 2
Flags: needinfo?(echang)
Ok, yeah, if mozCamera is null, the problem is more than just the previewSize selection, I think. Try flashing latest Gecko if you can and try again. If you get your Gecko working, it would be beneficial if you could post those previewSize values here so I can add them to the test data for our unit tests. Thanks for trying this out!
Bulk edit for camera bugs.

If earlier comments do not show how this bug landed to master, it probably landed as part of https://github.com/mozilla-b2g/gaia/pull/17599 which merged the camera-new-features branch into master.

This bug was uplifted from master to v1.4 as part of https://github.com/mozilla-b2g/gaia/commit/a8190d08e61316a86bba572ba8d894d081a20530
Target Milestone: --- → 1.4 S5 (11apr)
You need to log in before you can comment on or make changes to this bug.