Closed Bug 924015 Opened 6 years ago Closed 2 years ago

[flatfish] Can't play (.mp4) file ( Android 4.2 )

Categories

(Firefox OS Graveyard :: Gaia::Video, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(b2g-v1.3 affected, b2g-v1.4 affected, b2g-v2.0 affected)

RESOLVED WONTFIX
1.3 Sprint 6 - 12/6
Tracking Status
b2g-v1.3 --- affected
b2g-v1.4 --- affected
b2g-v2.0 --- affected

People

(Reporter: tommy.cvkk, Assigned: vliu)

References

Details

(Whiteboard: [POVB][flatfish=breakage])

Attachments

(6 files)

MOZ_OMX_DECODER doesn't enable.
Blocks: flatfish
according to triage result, it is koi+
blocking-b2g: --- → koi+
Whiteboard: [Flatfish only]
Hi Thomas,
Could you take a look on this, did we fix it now?
Flags: needinfo?(ttsai)
Flags: needinfo?(ttsai) → needinfo?(vliu)
The below link lists omx supported media type. 

http://mxr.mozilla.org/mozilla-central/source/content/media/DecoderTraits.cpp#208

From list, we can see MP4 is decoded by OMX decoder. Currently MOZ_OMX_DECODER doesn't enable it because we encounter build fail by integrating NativeWindow/Camera relative code in JB. But in my local side, I'd tried to integrate NativeWindow/Camera and also enabled MOZ_OMX_DECODER. Now I can do camera preview and taking picture. I will also try MP4 playback. If I got any result, I will comment here.
Flags: needinfo?(vliu)
Assignee: nobody → vliu
Blocks: 922972
Bug 922510 is necessary to enable omx codec.
Depends on: 922510
Depends on: 920992
No longer depends on: 922510
Hi Vincent,

May I know why does this bug depend on 920992? Thanks.
(In reply to Marco Chen [:mchen] from comment #5)
> Hi Vincent,
> 
> May I know why does this bug depend on 920992? Thanks.

Bug 920992 causes video launching fail and can't verify any further video test including mp4.
Hi all,

After doing some investigation, I found that the root cause is OMX.allwinner.video.decoder.avc didn't be registered as an OMX component but it is registered into media_codec.xml. So we need partner's help to provide such kind libraries.
Flags: needinfo?(tommy.cvkk)
By the way, I didn't find libstagefrighthw.so in the device. Is it not ready now?
Whiteboard: [Flatfish only] → [Flatfish only][developer+]
Marco is right that some codec hal are missing. I have updated the manifest and device common.mk to build the necessary libs.
base-jb.xml:
  <project name="platform/hardware/aw" path="hardware/aw" remote="bitbucket" revision="jb4.2.2"/>
common.mk:
PRODUCT_PACKAGES += \
	libcedarxbase \
	libcedarxosal \
	libcedarv \
	libcedarv_base \
	libcedarv_adapter \
	libve \
	libaw_audio \
	libaw_audioa \
	libswdrm \
	libstagefright_soft_cedar_h264dec \
	libfacedetection \
	libthirdpartstream \
	libcedarxsftstream \
	libsunxi_alloc \
	libjpgenc \
	libstagefrighthw \
	libOmxCore \
	libOmxVdec \
	libOmxVenc \
	libaw_h264enc \
	libI420colorconvert
as we confirmed that Flatfish will use v1.3 and we need to respect current testing cycle, set target milestone to 12/6 since 1.3FC tag is not created yet.
blocking-b2g: koi+ → 1.3+
Target Milestone: ProductDemo → 1.3 Sprint 6 - 12/6
hi Tommy,

are you able to provide the library as comment#7 mentioned?
Attached file libstagefrighthw.so
Flags: needinfo?(tommy.cvkk)
Blocks: 935381
Here comes with the patch from partner and adding the patch of bug 864230, we can play mp4 file. But with this patch, the color format seems have problem showing the video thumbnail in video app.
Whiteboard: [Flatfish only][developer+] → [POVB]
See Also: → 931733
hi Tommy,

is there anything you can do? Vincent has identified that issue can not be fixed from our end and it requires partner's effort.
Flags: needinfo?(tommy.cvkk)
Now, the video app has played mp4 file by hardware codec successfully using v1.3, but it still has an issue, after playing to the end of the file, I press play or seek to the any position of this video,  the audio is fine, but the video freeze. Vincent has my testing patch.
Flags: needinfo?(tommy.cvkk)
hi Vincent,

have you tried Tommy's testing patch? are you able to provide some advices for video freeze?
Flags: needinfo?(vliu)
I suggest filing a new bug if it is really a problem.
Flags: needinfo?(vliu)
The video player of the last code base will hang after launched and no thumbnail is generated. It seems that the application is waiting for some task to be done.
Code base info:
Gecko: 103721818359a64521e5c8a7dca2bbeb73eaabc1
Gaia: ce8dc3feceb9060de1e347a2641ce348f6d5fa6a

The video player is working fine with 3gp/ogg/webm/mp4 in the following code base:
Gecko: c63c0a68f58a026e2b1fb8eca89ccd1e5c11adf6
Gaia: 1abda08e450cb66a61a31bdcfd3352e2df9d9ace
The messages about launching video player starts from line 514.
The first 2 errors when launching player are as follows:
E/Sandbox ( 1706): install_syscall_filter() failed
E/GeckoConsole( 1706): [JavaScript Error: "TypeError: Argument 1 of MediaQueryList.addListener is not callable." {file: "app://video.gaiamobi]
The results will help us narrow down the range of commits causes the video player hang issues
Before the following commits(included), the video player are fine with MP4 file:
gecko ffebd88dd68cbcf4463676b602e602a2f518db14
gaia 55055b89a84905ba30cfd3897ceb1cb3f1e36f81
The video player hanging with MP4 file is related to the commits between the above commit and the following commits:
gecko 577bf4bd2d74569c7ee79306c2357ac1fccd1457
gaia bef0c2fec1726eec61284241b24f0e93efc25840
Ogv files are fine.
Mp4 files will cause the gaia video player crash in the playlist, the GonkBufferQueue::dequeueBuffer message is strange. The cancelBuffer sequence is cancelBuffer slot 1->2->3->1->2->3-> ... ->1->2->0->1->3 ---> crash.
I guess the cancelBuffer slot 0 maybe the reason that causes the video player crash.

my version:
gecko: commit ca14938a7f7520cbfa8b306c094cac26d35b18bd
gaia: commit e2f0e09e980b1cb3275a0bb033931cb48f9d521c

logcat message :
=== log start ===
W/omx_vdec( 1269): set_parameter, OMX_IndexParamPortDefinition, OutPortDef : change nBufferSize[38016] to [345600] to suit frame width[640] and height[360]
I/OMXCodec( 2073): [OMX.allwinner.video.decoder.avc] video dimensions are 640 x 360
D/omx_vdec( 1269):  set state command, cmd = 0, cmddata = 2.
V/GonkBufferQueue( 2073): setBufferCount: count=4
D/GonkBufferQueue( 2073): releaseBufferFreeListUnlocked: E
D/GonkBufferQueue( 2073): releaseBufferFreeListUnlocked: X
V/GonkConsumerBase( 2073): onBuffersReleased
V/GonkBufferQueue( 2073): getReleasedBuffers
V/GonkBufferQueue( 2073): getReleasedBuffers: returning mask 0xffffffff
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=0
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=1
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=2
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=3
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=4
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=5
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=6
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=7
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=8
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=9
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=10
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=11
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=12
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=13
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=14
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=15
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=16
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=17
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=18
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=19
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=20
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=21
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=22
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=23
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=24
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=25
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=26
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=27
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=28
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=29
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=30
V/GonkConsumerBase( 2073): freeBufferLocked: slotIndex=31
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
D/GonkBufferQueue( 2073): dequeueBuffer: about to alloc surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: got surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: returning slot=0 buf=0x447dc4c0 
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=0 buf=0x447dc4c0 flags=0x1
V/GonkBufferQueue( 2073): requestBuffer: slot=0
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
D/GonkBufferQueue( 2073): dequeueBuffer: about to alloc surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: got surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 flags=0x1
V/GonkBufferQueue( 2073): requestBuffer: slot=1
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
D/GonkBufferQueue( 2073): dequeueBuffer: about to alloc surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: got surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: returning slot=2 buf=0x447dc560 
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=2 buf=0x447dc560 flags=0x1
V/GonkBufferQueue( 2073): requestBuffer: slot=2
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
D/GonkBufferQueue( 2073): dequeueBuffer: about to alloc surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: got surface descriptor
D/GonkBufferQueue( 2073): dequeueBuffer: returning slot=3 buf=0x447dc5b0 
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=3 buf=0x447dc5b0 flags=0x1
V/GonkBufferQueue( 2073): requestBuffer: slot=3
D/omx_vdec( 1269):  set state command, cmd = 0, cmddata = 3.
I/SoftAAC2( 2073): Reconfiguring decoder: 48000 Hz, 2 channels
V/GonkBufferQueue( 2073): cancelBuffer: slot=1
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=2
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=2 buf=0x447dc560 flags=0
D/omx_vdec( 1269):  flush command.
D/omx_vdec( 1269):  flush command.
V/GonkBufferQueue( 2073): cancelBuffer: slot=1
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=2
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=2 buf=0x447dc560 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=3
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=3 buf=0x447dc5b0 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=1
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=2
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=2 buf=0x447dc560 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=3
............... ** ignore **......................
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=3 buf=0x447dc5b0 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=1
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=2
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=2 buf=0x447dc560 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=0
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=0 buf=0x447dc4c0 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=1
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=1 buf=0x447dc510 flags=0
V/GonkBufferQueue( 2073): cancelBuffer: slot=3
V/GonkBufferQueue( 2073): dequeueBuffer: w=640 h=360 fmt=0x32315659 usage=0x2100
V/GonkBufferQueue( 2073): dequeueBuffer: returning slot=3 buf=0x447dc5b0 flags=0
I/Gecko   ( 1877): 
I/Gecko   ( 1877): ###!!! [Parent][MessageChannel] Error: Channel error: cannot send/recv
I/Gecko   ( 1877): 
E/OMXNodeInstance( 1269): !!! Observer died. Quickly, do something, ... anything...
D/omx_vdec( 1269):  set state command, cmd = 0, cmddata = 2.
I/Gonk    ( 1877): Setting nice for pid 1993 to 1
I/Gonk    ( 1877): Changed nice for pid 1993 from 18 to 1.
V/Sensors ( 1877): int poll__activate(sensors_poll_device_t*, int, int)
D/Sensors ( 1877): tiger sensor 111111111111111111111
V/Sensors ( 1877): int sensors_poll_context_t::activate(int, int)
V/Sensorsmpltiger( 1877): enable - sensor Accelerometer (handle 4) en -> dis
V/Sensorsmpltiger( 1877): enabled_sensors: 0 dmp_started: 1
V/Sensorsmpltiger( 1877): Stopping DMP11
I/MPL-mldl_cfg_mpu:( 1877): inv_mpu_suspend(,,,,7fff) -> 0000
I/GeckoDump( 1877): Crash reporter : Can't fetch app.reportCrashes. Exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://browser/content/shell.js :: shell_reportCrash :: line 124"  data: no]
D/omx_vdec( 1269):  set state command, cmd = 0, cmddata = 1.
D/omx_vdec( 1269):  stop command.
D/osal_linux( 1269): exit hw ref count:0
D/omx_vdec( 1269): ~omx_dec done!
D/aw_omx_core( 1269):  Unloading the dynamic library for OMX.allwinner.video.decoder.avc
I/Gonk    ( 1877): Setting nice for pid 2141 to 18
I/Gonk    ( 1877): Changed nice for pid 2141 from 0 to 18.
E/Profiler( 2141): BEGIN mozilla_sampler_init
E/Profiler( 2141): BPUnw: [1 total] thread_register_for_profiling(me=0x401173dc, stacktop=0xbe92000f)
E/Profiler( 2141): SPS:
======= log end =========
(In reply to tommy_chiu from comment #22)
> Ogv files are fine.
> Mp4 files will cause the gaia video player crash in the playlist, the
> GonkBufferQueue::dequeueBuffer message is strange. The cancelBuffer sequence
> is cancelBuffer slot 1->2->3->1->2->3-> ... ->1->2->0->1->3 ---> crash.
> I guess the cancelBuffer slot 0 maybe the reason that causes the video
> player crash.
> 
> my version:
> gecko: commit ca14938a7f7520cbfa8b306c094cac26d35b18bd
> gaia: commit e2f0e09e980b1cb3275a0bb033931cb48f9d521c
> 
> logcat message :
> === log start ===

> I/Gecko   ( 1877): 
> I/Gecko   ( 1877): ###!!! [Parent][MessageChannel] Error: Channel error:
> cannot send/recv
> I/Gecko   ( 1877): 
> E/OMXNodeInstance( 1269): !!! Observer died. Quickly, do something, ...
> anything...
> D/omx_vdec( 1269):  set state command, cmd = 0, cmddata = 2.


I also noticed. Still tried to figure it out.
I tried to roll back the commit id and found the video got crash by adding the patches in bug 897452. Here to arrange the issue we saw in this bug.

1. Try to |make reset-gaia| or clean data for video app in data partition.
2. Put *.mp4 file into /sdcard/Movies/
3. Launch video app and it will parse fail for *.mp4 file and then pops up crash message for video app. Comment 22 can see the detail for logcat.

Hi :bjacob, 

I need your help to figure it out for what I met. Can you have comment for it? Thanks. If you don't have device to to do test, I can help on it.
Flags: needinfo?(bjacob)
Bug 897452 contains 17 commits for its patch.

commit 9f063375a944b79344b9bc44431c41b64fc1a3c8
                 :
                 :
commit 1f2be47e2ac1a54d25bd7628bc5337f7302a4f56

The below commit id committed above |commit 1f2be47e2ac1a54d25bd7628bc5337f7302a4f56| won't cause video crash.

commit e569b2628d0e92a6d1340ea73649829f84284cb2
Thanks for the report. Yes, there have been known crash regressions from Bug 897452, which might be the crash that you are seeing. A fix is currently on mozilla-inbound:

https://hg.mozilla.org/integration/mozilla-inbound/rev/a06e9d86b669

I am currently making a B2G build to check if this fixes the present crash. What would help a lot is a stack from the crash here. If it involves TextureClient::Finalize(), then it is likely to be fixed by the above-mentioned changeset. I'll try to reproduce and get that stack myself; until then, I can't say much more.
Flags: needinfo?(bjacob)
(In reply to Benoit Jacob [:bjacob] from comment #26)
> Thanks for the report. Yes, there have been known crash regressions from Bug
> 897452, which might be the crash that you are seeing. A fix is currently on
> mozilla-inbound:
> 
> https://hg.mozilla.org/integration/mozilla-inbound/rev/a06e9d86b669
> 
> I am currently making a B2G build to check if this fixes the present crash.
> What would help a lot is a stack from the crash here. If it involves
> TextureClient::Finalize(), then it is likely to be fixed by the
> above-mentioned changeset. I'll try to reproduce and get that stack myself;
> until then, I can't say much more.

Thanks for your reply. I will give it a trial with your patch. Once there have any update, you can see it in bug 955976.
I'm unsure why this would be 1.3 blocker specifically, as I don't recall work happening for flatfish on any branch other than trunk. Renominating for more discussion.
blocking-b2g: 1.3+ → 1.3?
Whiteboard: [POVB] → [POVB], qawanted, [2.0-flame-test-run-1]
The flags here are entirely incorrect. Please contact your QA lead to figure out how you should be filing bugs as part of test runs.
Flags: needinfo?(bmorgan)
Whiteboard: [POVB], qawanted, [2.0-flame-test-run-1] → [POVB]
Switching needinfo to Kevin since I am not getting a response from bmorgan.
Flags: needinfo?(bmorgan) → needinfo?(ktucker)
I spoke to bmorgan and the lead over in SLC to go over the proper procedure once again to ensure this doesn't happen again. They will also be receiving even more training this week.
Flags: needinfo?(ktucker)
flatfish
Whiteboard: [POVB] → [POVB][flatfish]
Whiteboard: [POVB][flatfish] → [POVB][flatfish=breakage]
Video Player crash by *.mp4(H.264) file

See more detail on bug 1040648 comment #14
Blocks: 952410
Officially, Android does play MP4 movies. But it only plays MP4 files encoded with H.263 or H.264 AVC. While MP4 is a video container format, it can contain different video codecs which may not be the Android supported one. Therefore, whether we can play MP4 on Android or not, it all depends on what the video codec is inside in MP4.

In order to solve Android doesn't play MP4 videos and successfully play all kinds of MP4 files on Android devices; we had better convert Android unsupported MP4 to Android more supported MP4 at http://www.idealshare.net/video-converter/play-mp4-on-android.html
Thanks for changegrowup recommending this useful method and it solve my problem.
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.