Closed Bug 895857 Opened 11 years ago Closed 6 years ago

[Camera] Preview does not restart when camera hw is freed during taking picture.

Categories

(Firefox OS Graveyard :: Vendcom, defect)

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

(blocking-b2g:-)

RESOLVED WONTFIX
1.1 QE4 (15jul)
blocking-b2g -

People

(Reporter: leo.bugzilla.gaia, Unassigned)

References

Details

(Whiteboard: [POVB])

1. Title :  Camera app UI sticks with Focus ring
2. Precondition : Camera app should be working
3. Tester's Action : 1. Open camera app -> press capture image button -> immediately press on gallery button->return to camera app
                     2. Open Camera app-> touch gallery -> immediately touch capture -> return to camera app
                     3. Open Camera app-> touch capture button -> immediately press home button-> return to camera app
4. Detailed Symptom (ENG.) : When user return to camera app from above scenarios -> camera app UI hangs with focus ring.

5. Expected : Auto focus should be cleared and no auto focus ring should be shown.

6.Reproducibility: Y
1)Frequency Rate : 100%
7.Gaia Master/v1-train : Reproduced
8.Gaia Revision: 8d8af3f039d5f3bdf24b91cd0ce62798e1feac96
blocking-b2g: --- → leo?
Target Milestone: --- → 1.1 QE4 (15jul)
I could regenerate the problem by using v1.1 leo. It seems that dead lock happens in camera service in mediaserver process.
Leo, does camera can resume when the camera app kill and start again? In my case, the camera app did not work again until device reboot.
Flags: needinfo?(leo.bugzilla.gaia)
Assignee: nobody → sotaro.ikeda.g
In my case, camera did not work even when restarting the camera app. And there was following log in logcat. It says the initialization failed because of rejection from CameraService.

> E QualcommCamera: Qint android::get_camera_info(int, camera_info*): E
> W CameraService: CameraService::connect X (pid 726) rejected (existing client).
Sotaro, Camera works sometimes after killing and restarting the app.
One more observation: once autofocus is done, the ring changes to green color and now if I press homebutton, the camera app still takes the picture with camera app minimized.
Flags: needinfo?(leo.bugzilla.gaia)
Sotaro, This situation can be avoided with a small modification in gaia by calling hideFocusRing funcation when camera app is hidden (calling Camera.hideFocusRing();  when mozvisibilitychange event fires and camera app will be hidden).

Please check.
Flags: needinfo?(sotaro.ikeda.g)
(In reply to Leo from comment #5)
> Sotaro, This situation can be avoided with a small modification in gaia by
> calling hideFocusRing funcation when camera app is hidden (calling
> Camera.hideFocusRing();  when mozvisibilitychange event fires and camera app
> will be hidden).
> 
> Please check.

I confirmed it works. Can you create a new bug? one handle focus ring, other handle preview do not restart.
Flags: needinfo?(sotaro.ikeda.g) → needinfo?(leo.bugzilla.gaia)
> I confirmed it works. Can you create a new bug? one handle focus ring, other
> handle preview do not restart.

They are different bugs, need to be handled as different bug numbers.
Sotaro, I have registered a defect for handling focus ring UI, Bug :896296
Flags: needinfo?(leo.bugzilla.gaia)
Change the summary and component. focus ring ui was split to Bug 896296.
Component: Gaia::Camera → General
Summary: [Camera] Camera app UI sticks with Focus ring → [Camera] Preview does not restart when camera hw is freed during taking picture.
I do not have a symbol around camera hal's implementation. Therefore, I can not debug about why deadlock happened in CameraServer. Alternatively, I checked where the problem happened within CameraServer by adding log.
By manually adding a log to CameraService, I confirmed that the camera shutdown stopped at "mHardware->cancelPicture()" in CameraService::Client::disconnect().

http://androidxref.com/4.0.4/xref/frameworks/base/services/camera/libcameraservice/CameraService.cpp#495
I checked android's source about the camera hw close. There is no protection code of camera hw close during taking a photo. And CameraService::Client::disconnect()'s source code care about the camera shutdown during camera capture. From them, it becomes clear that the camera hw could be closed even during taking a photo from android framework point of view.
Android JB code has following comment. From it, camera could be disconnected from CameraService any time.
> // Allow both client and the media server to disconnect at all times

http://androidxref.com/4.2.2_r1/xref/frameworks/av/services/camera/libcameraservice/CameraClient.cpp#215
Therefore, there is a problem to disconnect from camera hw during taking a photo, it is a camera hal's bug.
Inder, do you know something about this bug?
Flags: needinfo?(ikumar)
Leo, can you debug why mHardware->cancelPicture() did not exit?
Flags: needinfo?(leo.bugzilla.gaia)
qawanted to see if we can reproduce. The fact that you have to do something "immediately" three times, makes me feel like this is an edge case.
Keywords: qawanted
Flags: needinfo?(leo.bugzilla.gaia)
Keywords: qawanted
Flags: needinfo?(leo.bugzilla.gecko)
Keywords: qawanted
I can not reproduce this issue with my LEO device.
Can you share the reproducible steps?
yesterday(7/25), :mwu internally distributed the new leo rom for the developement. By using the rom, I still can reproduce the symptom, but it became harder.

STR
- 1. Open camera app
- 2. press capture image button
- 3. wait a very shot time until focus become green or shotly before the focus becomes green
- 4. push home button

Frequency Rate : 1/30

Continue 2-4 until the problem happens. When this happened, the shutter sound did not heard. Timing is very important, push home button as late as possible, but need to be a quick timing as shutter sound is not heard.
Leo, can you generate it by comment #19.
Flags: needinfo?(leo.bugzilla.fw)
This looks hard to reproduce (1/30) and it's not a regression. If it's bad enough to trip IOT it will come back to us and we can re-prioritize.
blocking-b2g: leo? → -
QA Contact: sparsons
Unable to reproduce on Leo when following the STR in comment 19 due to the camera app breaking if the user opens the camera app, takes a picture then immediately closes then reopens the app about 3-4 times. Created bug 89961 for this issue. 

Build ID: 20130729070226
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/8135299f3efd
Gaia: 7aaffc8ccb6cf7ddd1e97943c108f1cb9eae5de0
Platform Version: 18.1
RIL Version: 01.01.00.019.172
Sorry, the correct bug number is 899161


(In reply to Sarah Parsons from comment #22)
> Unable to reproduce on Leo when following the STR in comment 19 due to the
> camera app breaking if the user opens the camera app, takes a picture then
> immediately closes then reopens the app about 3-4 times. Created bug 89961
> for this issue. 
> 
> Build ID: 20130729070226
> Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/8135299f3efd
> Gaia: 7aaffc8ccb6cf7ddd1e97943c108f1cb9eae5de0
> Platform Version: 18.1
> RIL Version: 01.01.00.019.172
Sarah - The bug you found actually then confirms that you are able to reproduce this on b2g18.
Keywords: qawanted
From comment #11, the problem is in partners source code area. I already did all analysis about this bug what I can do. I un-assign myself from this bug.
Assignee: sotaro.ikeda.g → nobody
(In reply to Sotaro Ikeda [:sotaro] from comment #26)
> From comment #11, the problem is in partners source code area. I already did
> all analysis about this bug what I can do. I un-assign myself from this bug.

Can you be more specific? Is this a bug in the commercial RIL? Or in Leo's code?

Trying to figure out who I should followup with here.
(In reply to Jason Smith [:jsmith] from comment #27)
> Can you be more specific? Is this a bug in the commercial RIL? Or in Leo's
> code?

The problem happens at qcom or leo source code around camera hw controling. Mozilla do not have the source code of this area.
(In reply to Sotaro Ikeda [:sotaro] from comment #28)
> (In reply to Jason Smith [:jsmith] from comment #27)
> > Can you be more specific? Is this a bug in the commercial RIL? Or in Leo's
> > code?
> 
> The problem happens at qcom or leo source code around camera hw controling.
> Mozilla do not have the source code of this area.

mvines - Can you someone from your team look into this?
Flags: needinfo?(mvines)
Support requests for camera stuff under Gecko need an SR please.
Flags: needinfo?(mvines)
Flags: needinfo?(ikumar)
(In reply to Michael Vines [:m1] [:evilmachines] from comment #30)
> Support requests for camera stuff under Gecko need an SR please.

I've actually never done a SR before. Can you explain what I need to do process-wise?
The reporter has access to this system.
(In reply to Michael Vines [:m1] [:evilmachines] from comment #32)
> The reporter has access to this system.

Leo - Can you file a SR?
Flags: needinfo?(leo.bugzilla.gecko)
Flags: needinfo?(leo.bugzilla.gaia)
Flags: needinfo?(leo.bugzilla.fw)
Whiteboard: [POVB]
Component: General → Vendcom
Flags: needinfo?(leo.bugzilla.gaia)
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.