Closed Bug 835367 Opened 12 years ago Closed 11 years ago

[camera][Meta] Improve performace of the camera

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pabloUX, Assigned: mikeh)

References

Details

(Keywords: perf, Whiteboard: [c= p= s=2013.11.08 u=] interaction, UX-P2, TEF_REQ)

Attachments

(2 files, 1 obsolete file)

No description provided.
Spreadsheet with some data on how long it takes the various picture-taking APIs to execute. This is the time spent in those synchronous functions, not necessarily the time it takes for the asynchronous processes (of i.e. autoFocus() and takePicture()) to complete. The worst API by far is startPreview(), which (interestingly) takes only 202ms to run when the camera first starts, but 500 to 600ms (and in one instance, up to 850ms) on subsequent post-takePiture() calls. Mean execution times for other functions is: - getParameters() 2052ms - setParameters() 25546ms - autoFocus() 348ms - takePicture() 76836ms - stopPreview() 1.1s See spreadsheet for full details, including standard deviations.
(Also, the above numbers were obtained on Unagi, with B2G_DEBUG=0.)
Speculation: part of the long execution time for startPreview() may be having to reallocate 9 graphics buffers each time. It may be possible to reuse these buffers between photos.
Android camera hal do not require graphic buffer reallocation between photos. I confirmed it on some android phone running FirefoxOS. But unagi phones's camera hal seems not work correctly in current setting...
(In reply to Sotaro Ikeda [:sotaro] from comment #5) > > Android camera hal do not require graphic buffer reallocation between > photos. I confirmed it on some android phone running FirefoxOS. But unagi > phones's camera hal seems not work correctly in current setting... Do you have a patch? :) Is there a bug in the Unagi camera driver?
(In reply to Mike Habicher [:mikeh] from comment #6) > (In reply to Sotaro Ikeda [:sotaro] from comment #5) > > Do you have a patch? :) Is there a bug in the Unagi camera driver? I do not have a patch right now. It is implemented as part of Bug 803471. I am going to create the patch by referencing Bug 803471. I am not sure that I can say it is a bug for unagi. How ANativeWindow works is still different from android original implementation. But it worked on qcom's ics_strawberry. ungi phone uses qcom's ics_chocolate. There might be other workaround for ics_chocolate.
More data: - when startPreview() takes ~600ms, ~250ms of that is in the calls to abandon() and dequeueBuffer() - the first call to dequeueBuffer() in startPreview() takes ~60 to 80ms - the second call takes ~10 to 20ms - the third through ninth calls take ~5 to 10ms
(In reply to Sotaro Ikeda [:sotaro] from comment #7) > (In reply to Mike Habicher [:mikeh] from comment #6) > > (In reply to Sotaro Ikeda [:sotaro] from comment #5) > > > > Do you have a patch? :) Is there a bug in the Unagi camera driver? > > I do not have a patch right now. It is implemented as part of Bug 803471. I > am going to create the patch by referencing Bug 803471. I remind what I had done about preview start. I just removed abandon() call in GonkCameraHardware::StartPreview(). The hardware using ics_strawberry did not require all GraphicBuffers when startPreview after camera capture. But unagi using ics_chocolate always requires all GraphicBuffers when startPreview :-( It is implemented in QualcommCameraHardware::getBuffersAndStartPreview().
- forcibly free graphic buffers in rendering state in StartPreview() - reallocate graphic buffers when graphic buffers attributes are different than requested
(In reply to Sotaro Ikeda [:sotaro] from comment #10) > Created attachment 707604 [details] [diff] [review] > WIP patch - reduce graphic buffer reallocation in StartPreview() > > - forcibly free graphic buffers in rendering state in StartPreview() > - reallocate graphic buffers when graphic buffers attributes are different > than requested I confirmed that the patch works on unagi phone.
Comment on attachment 707604 [details] [diff] [review] WIP patch - reduce graphic buffer reallocation in StartPreview() I can confirm that this works on unagi as well, and get getBuffersAndStartPreview(), most of the dequeueBuffer() calls drop to >30us (below the resolution of CLOCK_MONOTONIC). Furthermore, startPreview() drops from ~500 to 600ms, to ~450 to 500ms, with no outliers above ~570ms. It's not a big difference, but the shorter cycle time does make the camera feel more responsive.
Attachment #707604 - Flags: feedback+
Jumping the gun on nom-ing what looks like a meta bug. Apologies.
tracking-b2g18: ? → ---
Summary: [camera] Improve performace of the camera → [camera][Meta] Improve performace of the camera
Depends on: 836782
Guys, either we keep that as a meta and move the patch to a dependant bug, or we change this one to not be a meta. In any case, this patch looks worth nominating for b2g-18
(In reply to Fabrice Desré [:fabrice] from comment #14) > Guys, either we keep that as a meta and move the patch to a dependant bug, > or we change this one to not be a meta. In any case, this patch looks worth > nominating for b2g-18 I am going to move attachment 707604 [details] [diff] [review] to but 836782 and will nominate for b2g-18. Before nominating it, I am going to check Camera hw hal code.
Comment on attachment 707604 [details] [diff] [review] WIP patch - reduce graphic buffer reallocation in StartPreview() the patch move to Bug 836782.
Attachment #707604 - Attachment is obsolete: true
Keywords: perf
OS: Windows 7 → Gonk (Firefox OS)
Hardware: x86_64 → ARM
Whiteboard: interaction, UX-P2, TEF_REQ → [c= p= s= u=] interaction, UX-P2, TEF_REQ
Marking fixed since this is a meta bug and all its dependencies are closed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [c= p= s= u=] interaction, UX-P2, TEF_REQ → [c= p= s=2013.11.08 u=] interaction, UX-P2, TEF_REQ
Assignee: nobody → mhabicher
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: