Closed Bug 1265427 Opened 8 years ago Closed 8 years ago

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

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
Tracking Status
firefox48 --- fixed

People

(Reporter: gerard-majax, Assigned: pehrsons)

References

Details

Attachments

(5 files, 2 obsolete files)

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

Expected:
 Preview starts

Actual:
 Crash of camera app
Attached file gdb backtrace
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)
Attached file printing mOwningStream
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)
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)
Thanks for the patch, I am testing it asap :)
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)
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)
(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 :/
Ok, I'll have to get my build working then.
Flags: needinfo?(pehrsons)
Attached file build failure
Attached 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)
Attachment #8742818 - Attachment is obsolete: true
Attachment #8742818 - Flags: review?(lissyx+mozillians)
Attachment #8742879 - Flags: review+
Attachment #8742879 - Flags: feedback?(pehrsons)
Attachment #8742878 - Attachment is obsolete: true
Attachment #8742878 - Flags: feedback?(pehrsons)
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+
Flags: needinfo?(pehrsons)
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+
https://hg.mozilla.org/mozilla-central/rev/6205def774ab
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.