Instant crash of camera app on mozilla-central + gaia-master

RESOLVED FIXED

Status

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gerard-majax, Assigned: pehrsons)

Tracking

unspecified
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(5 attachments, 2 obsolete attachments)

STR:
 0. Get current mc + master
 1. Build, flash
 2. Start Camera app

Expected:
 Preview starts

Actual:
 Crash of camera app
Reporter

Comment 1

3 years ago
Posted file gdb backtrace
Reporter

Comment 2

3 years ago
Andreas, it looks like GetOwnedStream() return a null pointer and it also looks like you hacked quite a lot around this in bug 1208371 :)

Can you have a look ? Thanks !
Flags: needinfo?(pehrsons)
If that helps, here are the error messages I see in the logcat when opening the Camera app.

E/mm-camera(  335): main: camera daemon notify error
E/QCamera3HWI(  322): static void qcamera::QCamera3HardwareInterface::camEvtHandle(uint32_t, mm_camera_event_t*, void*): Fatal, camera daemon died
E/Camera3-Device(  322): Camera 0: notifyError: Camera HAL reported serious device error
E/Camera2ClientBase(  322): Error condition 1 reported by HAL, requestId -1
E/mm-camera-intf(  322): mm_camera_open: cannot open control fd of '/dev/video2' (Connection timed out)
E/mm-camera-intf(  322): camera_open: mm_camera_open err = -1
E/QCamera3HWI(  322): static int qcamera::QCamera3HardwareInterface::initCapabilities(uint32_t): camera_open failed
D/CameraTraces(  322): Process trace saved. Use dumpsys media.camera to view.
E/Camera3-Device(  322): Camera 0: clearStreamingRequest: Device has encountered a serious error
E/Camera2-StreamingProcessor(  322): stopStream: Camera 0: Can't clear stream request: Function not implemented (-38)
E/Camera2Client(  322): stopPreviewL: Camera 0: Can't stop streaming: Function not implemented (-38)
E/Camera3-Device(  322): Camera 0: createStream: Device has encountered a serious error
E/Camera2-StreamingProcessor(  322): updatePreviewStream: Camera 0: Unable to create preview stream: Function not implemented (-38)
E/Camera2Client(  322): startPreviewL: Camera 0: Unable to update preview stream: Function not implemented (-38)
I/Gecko   ( 1965): [Child 1965] WARNING: 'NS_FAILED(rv)', file /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/dom/camera/GonkCameraControl.cpp, line 441
E/Camera3-Device(  322): Camera 0: clearStreamingRequest: Device has encountered a serious error
E/Camera2-StreamingProcessor(  322): stopStream: Camera 0: Can't clear stream request: Function not implemented (-38)
E/Camera2Client(  322): stopPreviewL: Camera 0: Can't stop streaming: Function not implemented (-38)
I/Gecko   ( 1965): [Child 1965] WARNING: Camera control API(10) failed with 0x80004005: file /home/mozilla/Projects/mozilla/src/hg.mozilla.org/mozilla-central/dom/camera/CameraControlImpl.cpp, line 352
E/Camera3-Device(  322): Camera 0: clearStreamingRequest: Device has encountered a serious error
E/Camera2-StreamingProcessor(  322): stopStream: Camera 0: Can't clear stream request: Function not implemented (-38)
E/Camera2Client(  322): stopPreviewL: Camera 0: Can't stop streaming: Function not implemented (-38)
E/Camera3-Device(  322): Camera 0: clearStreamingRequest: Device has encountered a serious error
E/Camera2-StreamingProcessor(  322): stopStream: Camera 0: Can't clear stream request: Function not implemented (-38)
E/Camera2Client(  322): stopPreviewL: Camera 0: Can't stop streaming: Function not implemented (-38)
E/Camera3-Device(  322): Camera 0: clearStreamingRequest: Device has encountered a serious error
E/Camera2-StreamingProcessor(  322): stopStream: Camera 0: Can't clear stream request: Function not implemented (-38)
E/Camera2Client(  322): stopPreviewL: Camera 0: Can't stop streaming: Function not implemented (-38)
Assignee

Comment 6

3 years ago
It's CameraPreviewMediaStream being evil again :(

Alexandre, does this patch help? I hope it compiles at least. I haven't gotten my B2G-build VM actually building B2G since my last bustage.

It hopefully only needs mOwnedStream/GetOwnedStream() for the PrincipalHandle listener. We can ignore that since the principal won't change from it's initial value. I think we'll even be OK not calling the callback on AddListener().
Assignee: lissyx+mozillians → pehrsons
Status: NEW → ASSIGNED
Flags: needinfo?(pehrsons)
Attachment #8742818 - Flags: review?(lissyx+mozillians)
Reporter

Comment 7

3 years ago
Thanks for the patch, I am testing it asap :)
Reporter

Comment 8

3 years ago
It is failing to build:
> /home/alex/codaz/Mozilla/b2g/devices/XperiaZ3c/B2G/gecko/dom/camera/DOMCameraControl.cpp:265:16: error: cannot convert 'RefPtr<mozilla::CameraPreviewMediaStream>' to 'mozilla::ProcessedMediaStream*' in assignment
Flags: needinfo?(pehrsons)
Assignee

Comment 9

3 years ago
What if you make CameraPreviewMediaStream inherit from ProcessedMediaStream instead of MediaStream?

If that doesn't work I'm out of quick fixes that don't include changing types of mOwnedStream/GetOwnedStream().
Flags: needinfo?(pehrsons)
Reporter

Comment 10

3 years ago
(In reply to Andreas Pehrson [:pehrsons] (Telenor) from comment #9)
> What if you make CameraPreviewMediaStream inherit from ProcessedMediaStream
> instead of MediaStream?
> 
> If that doesn't work I'm out of quick fixes that don't include changing
> types of mOwnedStream/GetOwnedStream().

I tried this but it was failing more :/
Assignee

Comment 11

3 years ago
Ok, I'll have to get my build working then.
Flags: needinfo?(pehrsons)
Reporter

Comment 12

3 years ago
Posted file build failure
Reporter

Comment 13

3 years ago
Posted file workaround (obsolete) —
So it looks like I have been too conservative when testing you hack. Adding a bit more code I have preview working !
Attachment #8742878 - Flags: feedback?(pehrsons)
Reporter

Comment 14

3 years ago
Attachment #8742818 - Attachment is obsolete: true
Attachment #8742818 - Flags: review?(lissyx+mozillians)
Attachment #8742879 - Flags: review+
Attachment #8742879 - Flags: feedback?(pehrsons)
Reporter

Updated

3 years ago
Attachment #8742878 - Attachment is obsolete: true
Attachment #8742878 - Flags: feedback?(pehrsons)
Assignee

Comment 15

3 years ago
Comment on attachment 8742879 [details] [diff] [review]
nsDOMCameraControl needs an mOwnedStream to be consistent towards its VideoStreamTrack r=gerard-majax

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

LGTM!
Attachment #8742879 - Flags: feedback?(pehrsons) → feedback+
Assignee

Updated

3 years ago
Flags: needinfo?(pehrsons)
Reporter

Comment 17

3 years ago
Comment on attachment 8742913 [details]
MozReview Request: Bug 1265427 - nsDOMCameraControl needs an mOwnedStream to be consistent towards its VideoStreamTrack r?gerard-majax

https://reviewboard.mozilla.org/r/47479/#review44215
Attachment #8742913 - Flags: review?(lissyx+mozillians) → review+
Assignee

Updated

3 years ago
Duplicate of this bug: 1265962

Comment 20

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6205def774ab
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.