Closed
Bug 1114477
Opened 10 years ago
Closed 9 years ago
[Gonk-L-Camera]:Integrate Camera recording.
Categories
(Firefox OS Graveyard :: GonkIntegration, defect)
Tracking
(feature-b2g:2.2+, b2g-v2.2 fixed)
Tracking | Status | |
---|---|---|
b2g-v2.2 | --- | fixed |
People
(Reporter: vliu, Assigned: jhlin)
References
Details
Attachments
(5 files)
This is a porting issue based on bug 1107300 Comment 17.
Reporter | ||
Comment 1•10 years ago
|
||
I got some error messages when I tried to do camera recording. The detailed log print was attached. It seems that these messages cause OMX Component deinit. Does anyone can help me to figure it out? Thanks. E/OMXMaster( 186): A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one. E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a D/camera ( 1244): OnNewPreviewFrame: we have 1 preview frame listener(s) D/camera ( 1244): OnNewPreviewFrame: got 1920 x 1080 frame D/GonkNativeWindow( 1244): GonkNativeWindow::returnBuffer E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663311) ERROR: 0x8000101a E/OMXNodeInstance( 186): getParameter(100663297) ERROR: 0x8000101a These error codes were indicating OMX_ErrorUnsupportedIndex.
Reporter | ||
Comment 2•10 years ago
|
||
gdb backtrack for the first error code which OMXCodec was trying to QueryCodec.
Reporter | ||
Comment 3•10 years ago
|
||
Hi Blake, Would you please have some idea for the log I attached? Thanks.
Flags: needinfo?(bwu)
Comment 4•10 years ago
|
||
Comment on attachment 8539970 [details]
gdb-bt.log
John should be better than me to answer this question. :)
Flags: needinfo?(bwu) → needinfo?(jolin)
Assignee | ||
Comment 5•10 years ago
|
||
According to the backtrace in gdb-bt.log, it's querying audio codec (mime type "audio/mpeg"), but the index to query is for video codec only (IndexParamVideoProfileLevelQuerySupported). FWICT, QueryCodec() returns OK (with empty CodecCapabilities) and MediaCodecList just pass that to MediaCodecInfo. It seems those are not actual errors in this case.
Flags: needinfo?(jolin)
Reporter | ||
Comment 6•10 years ago
|
||
Hi John, I tried to enable the log flag for OMXCodec/ACodec and make sure the library has beed updated by date. The file was attached. Could you please also have a check for me? Thanks
Updated•9 years ago
|
Blocks: gonk-L-Camera
Comment 7•9 years ago
|
||
It's the porting issue. Marked feature-b2g : 2.2+. Hi Vincent, we will need ETA for better understanding the risk to the next sprint. Thanks.
No longer blocks: gonk-L-Camera
feature-b2g: --- → 2.2+
Flags: needinfo?(vliu)
Flags: needinfo?(jolin)
Target Milestone: --- → 2.2 S3 (9jan)
Updated•9 years ago
|
Blocks: gonk-L-Camera
Assignee | ||
Comment 8•9 years ago
|
||
Tried adding some code to dump data in the AVC/H.264 buffers from encoder and found it playable in VLC. I guess the problem is not the encoder.
Flags: needinfo?(jolin)
Assignee | ||
Comment 9•9 years ago
|
||
A hacky patch to work around the 'stagefright log not showing up' problem (It's because of failed socket() call at [1], but I don't know why that happens). Anyway this should make debugging much easier. [1] https://android.googlesource.com/platform/system/core/+/master/liblog/logd_write.c#113
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Steven Yang [:styang] from comment #10) > Hi John, assign to you since you're working on it. Actually Vincent & Becker are working very hard on this one, but I don't mind taking the credit. :P
Comment 12•9 years ago
|
||
(In reply to John Lin [:jolin][:jhlin] from comment #9) > Created attachment 8541687 [details] [diff] [review] > ** NOT FOR CHECKING IN** patch to make stagefright log appear. > > A hacky patch to work around the 'stagefright log not showing up' problem > (It's because of failed socket() call at [1], but I don't know why that > happens). Anyway this should make debugging much easier. > > [1] > https://android.googlesource.com/platform/system/core/+/master/liblog/ > logd_write.c#113 Maybe we should create a bug for this logging problem.
Reporter | ||
Comment 13•9 years ago
|
||
When stoping the recording, video track would block at pthread_join(). https://github.com/mozilla-b2g/platform_frameworks_av/blob/b2g-5.0.0_r6/media/libstagefright/MPEG4Writer.cpp#L1791 The root casue would be blocking in the below wait function. https://github.com/mozilla-b2g/platform_frameworks_av/blob/b2g-5.0.0_r6/media/libstagefright/OMXCodec.cpp#L3999 Here has a considered solution. https://android.googlesource.com/platform/frameworks/av/+/bf37f33/media/libstagefright/MPEG4Writer.cpp The main idea is switching the calling order for |pthread_join(mThread, &dummy)| and |mSource->stop()|. When mDone turns to true, making sure the thread is done from exiting pthread_join and then calling mSource->stop() to stop the data feeding. Flame-kk also run on this order.
Flags: needinfo?(vliu)
Updated•9 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Vincent Liu[:vliu] from comment #13) > When stoping the recording, video track would block at pthread_join(). > > https://github.com/mozilla-b2g/platform_frameworks_av/blob/b2g-5.0.0_r6/ > media/libstagefright/MPEG4Writer.cpp#L1791 > > The root casue would be blocking in the below wait function. > > https://github.com/mozilla-b2g/platform_frameworks_av/blob/b2g-5.0.0_r6/ > media/libstagefright/OMXCodec.cpp#L3999 > > Here has a considered solution. > > https://android.googlesource.com/platform/frameworks/av/+/bf37f33/media/ > libstagefright/MPEG4Writer.cpp > > The main idea is switching the calling order for |pthread_join(mThread, > &dummy)| and |mSource->stop()|. When mDone turns to true, making sure the > thread is done from exiting pthread_join and then calling mSource->stop() to > stop the data feeding. Flame-kk also run on this order. The proposed fix essentially undo what Google did in [1]. From the commit message it seems to me that the change is part of rewriting Android recorder implementation to use MediaCodec (and deprecate OMXCodec). I'll test if the fix breaks Android recording functionality. If not then this could be a low risk solution for us. [1] https://android.googlesource.com/platform/frameworks/av/+/72cecca17d735db6532c45f0a7e10c47ee6f065a
Assignee | ||
Comment 15•9 years ago
|
||
Change component to gonk integration, where the fix will be more likely to land.
Component: Gaia::Camera → GonkIntegration
Assignee | ||
Comment 16•9 years ago
|
||
Hi Mike, could you please help review this PR? I tested it on AOSP as mentioned in comment 14 and it seems no problem. Thanks a lot & happy new year.
Attachment #8543814 -
Flags: review?(mhabicher)
Comment 17•9 years ago
|
||
Comment on attachment 8543814 [details] [review] Don't stop source until track thread is stopped. LGTM.
Attachment #8543814 -
Flags: review?(mhabicher) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 18•9 years ago
|
||
b2g-5.0.0_r6: https://github.com/mozilla-b2g/platform_frameworks_av/commit/8642b85281d90c0d804c382a884ebd1c113b9570
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-b2g-v2.2:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Comment 19•9 years ago
|
||
Please also land the patch to v2.2 branch, thanks.
You need to log in
before you can comment on or make changes to this bug.
Description
•