Closed Bug 1121769 Opened 9 years ago Closed 9 years ago

[Camera] Pictures have the wrong size after switching from Camcorder after invoking the Task Manager

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.2+, b2g-v2.1 unaffected, b2g-v2.2 verified, b2g-master verified)

VERIFIED FIXED
2.2 S5 (6feb)
blocking-b2g 2.2+
Tracking Status
b2g-v2.1 --- unaffected
b2g-v2.2 --- verified
b2g-master --- verified

People

(Reporter: pcheng, Assigned: mikeh)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Attached file Logcat on Flame 3.0 (obsolete) —
Description:
The camera takes pictures in 144x176 resolution after it was previously switched from Camcorder mode and returned from Task Manager.

STR:
1) Launch Camera app
2) Switch to Camcorder mode
3) Long-press Home button to bring up Task Manager
4) Tap on the Camera screenshot to return to Camera app
5) Switch to normal camera mode and take some pictures

Expected:
Photos are taken correctly

Actual:
Photos are taken in mini sizes (144x176) instead of their normal 1536x2048 dimensions.

Repro rate:
10/10

Video:
https://www.youtube.com/watch?v=fge2mQt5mdY

Attaching a logcat.

Device: Flame 3.0 Master
BuildID: 20150114010205
Gaia: e2a0f7c311119d4a8e160bdfb9e28a0e61a180fc
Gecko: 63006936ab99
Gonk: a814b2e2dfdda7140cb3a357617dc4fbb1435e76
Version: 38.0a1 (3.0 Master)
Firmware: V18D-1
User Agent: Mozilla/5.0 (Mobile; rv:38.0) Gecko/38.0 Firefox/38.0
Branch check:

This issue reproduces on Flame 2.2. Following STR, camera takes pictures in wrong dimensions.

Device: Flame (KK, full flash, 319MB mem)
BuildID: 20150114002502
Gaia: 7c5b27cad370db377b18a742d3f3fdb0070e899f
Gecko: 748b20315f75
Gonk: a814b2e2dfdda7140cb3a357617dc4fbb1435e76
Version: 37.0a2 (2.2)
Firmware: V18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

-----

This issue does NOT reproduce on Flame 2.1. Following STR, camera takes pictures in correct dimensions.

Device: Flame (KK, full flash, 319MB mem)
BuildID: 20150114001300
Gaia: 6957ac8a322234ec99c8abb7cc18dc6a2e0176db
Gecko: 6600eba54256
Gonk: a814b2e2dfdda7140cb3a357617dc4fbb1435e76
Version: 34.0 (2.1)
Firmware: V18D-1
User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Keywords: regression
This could effect a lot of end user so nominating 2.2?
blocking-b2g: --- → 2.2?
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
QA Whiteboard: [QAnalyst-Triage+]
QA Contact: pcheng
b2g-inbound regression window:

Last Working Environmental Variables:
Device: Flame
BuildID: 20141217182050
Gaia: 7a865bd6163e9a0372861d27450b3434875ef5c1
Gecko: 655536bc9ccd
Version: 37.0a1 (2.2 Master)
Firmware: V18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

First Broken Environmental Variables:
Device: Flame
BuildID: 20141217184854
Gaia: 7a865bd6163e9a0372861d27450b3434875ef5c1
Gecko: bea91a0b4dfb
Version: 37.0a1 (2.2 Master)
Firmware: V18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

Gaia is the same so it's a Gecko issue.

Gecko pushlog:
http://hg.mozilla.org/integration/b2g-inbound/pushloghtml?fromchange=655536bc9ccd&tochange=bea91a0b4dfb

Caused by patches to Bug 1104913.
QA Whiteboard: [QAnalyst-Triage?]
Component: Gaia::System::Window Mgmt → Gaia::Camera
Flags: needinfo?(ktucker)
Andrew, can you take a look at this issue please? Looks like this was caused by the work done on bug 1104913
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker) → needinfo?(aosmond)
Flags: needinfo?(aosmond) → needinfo?(aosmond)
Blocking Reason: Regression/broken functionality
blocking-b2g: 2.2? → 2.2+
Flags: needinfo?(aosmond) → needinfo?(mhabicher)
Confirmed on http://hg.mozilla.org/integration/mozilla-inbound/rev/dbdbade50ffa (the last patch where the camera preview is working; see bug 1124139).

/me takes.
Assignee: nobody → mhabicher
Status: NEW → ASSIGNED
Flags: needinfo?(mhabicher)
Summary: Camera takes pictures in wrong dimensions after switching from Camcorder and invoking Task Manager → [Camera] Pictures have the wrong size after switching from Camcorder after invoking the Task Manager
On flame:
- default picture size:          176 x 144
After the mode change back to picture, it looks like something gets dropped:

01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]: void mozilla::nsDOMCameraControl::OnConfigurationChange(mozilla::nsDOMCameraControl::DOMCameraConfiguration*):1286 : this=b1fc20c0
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]: DOM OnConfigurationChange: this=b1fc20c0
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]:     mode                   : picture
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]:     maximum focus areas    : 1
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]:     maximum metering areas : 5
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]:     preview size (w x h)   : 640 x 480
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]:     picture size (w x h)   : 2592 x 1944
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]:     recorder profile       : 720p
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]: nsresult mozilla::nsGonkCameraControl::PushParameters():524 - dispatching to Camera Thread
01-21 13:18:51.281  4979  5004 I PRLog   : -1216088904[b27dca00]: Pushing camera parameters
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]: nsresult mozilla::nsGonkCameraControl::PushParameters():524 - dispatching to Camera Thread
01-21 13:18:51.281  4979  4979 I PRLog   : -1225051820[b444a080]: void mozilla::nsDOMCameraControl::StopFaceDetection(mozilla::ErrorResult&):919 : this=b1fc20c0
01-21 13:18:51.281   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::initBatchUpdate(void*):Initializing batch parameter set
01-21 13:18:51.281   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::setPreviewSize(const qcamera::QCameraParameters&): Requested preview size 640 x 480
01-21 13:18:51.281   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::setVideoSize(const qcamera::QCameraParameters&): Requested video size 1280 x 720
01-21 13:18:51.281   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::setPictureSize(const qcamera::QCameraParameters&): Requested picture size 176 x 144
Once in this state, the disconnect persists:

01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: already_AddRefed<mozilla::dom::Promise> mozilla::nsDOMCameraControl::TakePicture(const mozilla::dom::CameraPictureOptions&, mozilla::ErrorResult&):928 : this=b1fc20c0
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: Begin deferring camera configuration updates (nest level 1)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: setting picture size to 2592x1944
01-21 13:18:53.371  4979  5004 I PRLog   : -1216088904[b27dca00]: Requested picture size 2592x1944 unchanged
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: virtual int android::GonkCameraHardware::GetSensorOrientation(uint32_t)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: Defering config update (nest level 1)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: Defering config update (nest level 1)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: setting picture date/time to 2015:01:21 13:18:53
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: Defering config update (nest level 1)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: Defering config update (nest level 1)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: End deferring camera configuration updates (nest level 1)
01-21 13:18:53.371  4979  4979 I PRLog   : -1225051820[b444a080]: nsresult mozilla::nsGonkCameraControl::PushParameters():524 - dispatching to Camera Thread
01-21 13:18:53.371  4979  5004 I PRLog   : -1216088904[b27dca00]: Pushing camera parameters
01-21 13:18:53.371   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::initBatchUpdate(void*):Initializing batch parameter set
01-21 13:18:53.371   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::setPreviewSize(const qcamera::QCameraParameters&): Requested preview size 640 x 480
01-21 13:18:53.371   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::setVideoSize(const qcamera::QCameraParameters&): Requested video size 1280 x 720
01-21 13:18:53.371   205  5530 D QCameraParameters: int32_t qcamera::QCameraParameters::setPictureSize(const qcamera::QCameraParameters&): Requested picture size 176 x 144
Attachment #8549269 - Attachment is obsolete: true
Attachment #8552689 - Flags: review?(aosmond)
Comment on attachment 8552689 [details] [diff] [review]
Keep camera driver in sync with Gecko, v1

Review of attachment 8552689 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me. Minor nit but r+ either way (since later we will probably want to rethink the exception for Set(CAMERA_PARAM_PICTURESIZE).

::: dom/camera/GonkCameraControl.cpp
@@ +353,5 @@
> +    mCurrentConfiguration.mMode = config.mMode;
> +    mCurrentConfiguration.mRecorderProfile = config.mRecorderProfile;
> +    
> +    if (config.mMode == kPictureMode) {
> +      mCurrentConfiguration.mPictureSize = config.mPictureSize;

I don't think we need to re-cache the picture size at lines 357 and 361 because the ::Set call has an exception which intercepts it (that I had not realized or thought about when I did the original patch).
Attachment #8552689 - Flags: review?(aosmond) → review+
Greatly simplified patch -- thanks, Andrew.
Attachment #8552689 - Attachment is obsolete: true
Attachment #8553142 - Flags: review?(aosmond)
Comment on attachment 8553142 [details] [diff] [review]
Keep camera driver in sync with Gecko, v2

Review of attachment 8553142 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM.
Attachment #8553142 - Flags: review?(aosmond) → review+
https://hg.mozilla.org/mozilla-central/rev/b2474bca8494
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S5 (6feb)
Please request b2g37 approval on this when you get a chance.
Flags: needinfo?(mhabicher)
Comment on attachment 8553142 [details] [diff] [review]
Keep camera driver in sync with Gecko, v2

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 #): bug 1121769
User impact if declined: upon returning to the Camera app, taken pictures will unexpectedly be the wrong size
Testing completed: manual testing on Flame
Risk to taking this patch (and alternatives if risky): minimal
String or UUID changes made by this patch: none
Flags: needinfo?(mhabicher)
Attachment #8553142 - Flags: approval-mozilla-b2g37?
Attachment #8553142 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
This issue is verified fixed on Flame 3.0 master and Flame 2.2.

Observed behavior: Camera takes pictures in expected sizes after following STR.

Device: Flame (full flash, nightly build, 319MB mem)
BuildID: 20150202154235
Gaia: 4171327fce4803c52b2fae8071b114a70a3a68a7
Gecko: 3bf7ed413e87
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 38.0a1 (3.0 Master)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:38.0) Gecko/38.0 Firefox/38.0

Device: Flame (full flash, nightly build, 319MB mem)
BuildID: 20150202002507
Gaia: d6141fa3208f224393269e17c39d1fe53b7e6a05
Gecko: be206fa2fb60
Gonk: e7c90613521145db090dd24147afd5ceb5703190
Version: 37.0a2 (2.2) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0
Status: RESOLVED → VERIFIED
Flags: needinfo?(ktucker)
Flags: needinfo?(ktucker)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: