Last Comment Bug 781024 - Video sometimes doesn't play in gaia video app, although audio does
: Video sometimes doesn't play in gaia video app, although audio does
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: unspecified
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
:
Mentors:
Depends on:
Blocks: 598868
  Show dependency treegraph
 
Reported: 2012-08-07 15:38 PDT by Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
Modified: 2012-08-08 18:24 PDT (History)
12 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments
Use the current decoded image as the reference for allocation (4.83 KB, patch)
2012-08-07 21:33 PDT, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
no flags Details | Diff | Review
Use the current decoded image as the reference for allocation, v2 (5.19 KB, patch)
2012-08-07 23:14 PDT, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
roc: review+
Details | Diff | Review

Description Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 15:38:48 PDT
STR
 (-1) Load video app in gaia (likely is just blank screen; that's not *this* bug)
 (0) Hold down HOME, close video app (work around bug)
 (1) Open video app
 (2) Tap first video in list to play

Intermittently, the app window is blank white, but audio plays back just fine.  I see the following in logcat

E/GeckoConsole(  672): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://video.thisdomaindoesnotexist.org/index.html" line: 0}]
E/GeckoConsole(  672): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://video.thisdomaindoesnotexist.org/index.html" line: 0}]
E/GeckoConsole(  672): [JavaScript Error: "content is null" {file: "chrome://global/content/BrowserElementChild.js" line: 185}]

Not clear whether
 - gaia is buggy here
 - mediastorage is handing out something wonky
 - BEC is causing problems somehow

or combination thereof.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 16:57:56 PDT
With some logging in gaia at where we set the video source, I see

E/GeckoConsole(  403): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://video.thisdomaindoesnotexist.org/index.html" line: 0}]
E/GeckoConsole(  403): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://video.thisdomaindoesnotexist.org/index.html" line: 0}]
E/GeckoConsole(  403): [JavaScript Error: "content is null" {file: "chrome://global/content/BrowserElementChild.js" line: 185}]
[snip]
E/GeckoConsole(  403): Content JS LOG at app://video.thisdomaindoesnotexist.org/js/video.js:263 in anonymous: VIDEO FILE: [object File]
E/GeckoConsole(  403): Content JS LOG at app://video.thisdomaindoesnotexist.org/js/video.js:269 in anonymous: VIDEO URL: blob:83c6cf36-b151-4ab5-843b-22df086a3c36

The video src URL looks correct, but something is apparently going wrong before that.
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 17:00:39 PDT
Maybe this is causing problems?

      <video src="about:blank" id="player"></video>
Comment 3 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 17:05:41 PDT
Indeed it is.  Will PR in gaia.
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 17:18:17 PDT
That wasn't the problem: this is intermittent and I had a lucky run.
Comment 5 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 17:45:18 PDT
With a little more logging

I/Gecko   (   77): 0x10797d8 Trying load from src=
E/GeckoConsole(   77): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://video.thisdomaindoesnotexist.org/index.html" line: 0}]
I/Gecko   (   77): 0x15135d0 Trying load from src=
E/GeckoConsole(   77): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://video.thisdomaindoesnotexist.org/index.html" line: 0}]
(SNIP)
E/GeckoConsole(   77): [JavaScript Error: "content is null" {file: "chrome://global/content/BrowserElementChild.js" line: 185}]

It appears that the BEC error is the root cause here.  Digging a bit more.
Comment 6 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 17:51:26 PDT
From a run when video actually plays

E/GeckoConsole(  204): [JavaScript Error: "content is null" {file: "chrome://global/content/BrowserElementChild.js" line: 185}]
I/Gecko   (  204): 0x2504b50 Trying load from src=blob:0ccd184b-4ac4-4ec3-aed8-31a506a22203

and from a run when video doesn't play

E/GeckoConsole(   78): [JavaScript Error: "content is null" {file: "chrome://global/content/BrowserElementChild.js" line: 185}]
I/Gecko   (   78): 0x17beed0 Trying load from src=blob:1a0812b9-f1f5-4f19-9e77-b538badac6ba

so the BEC error isn't the problem, and it looks like the video app is behaving as expected (setting the video src properly).

So apparently something is going wrong either in the video-frame decoder, or somewhere in the composition pipeline.
Comment 7 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 17:55:45 PDT
Indeed, when the video plays, the fps counter behaves as expected.

When it doesn't play, the fps counter doesn't move.
Comment 8 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 18:42:56 PDT
I/Gecko   (   78): ###!!! ABORT: Sizes must match to copy image data.: 'size == mSize', file /home/cjones/mozilla/inbound/gfx/layers/ipc/ImageContainerChild.cpp, line 135
I/Gecko - SYDNEY_AUDIO(   78): 0x1826aa8 - Wrote 4096
F/libc    (   78): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
Comment 9 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 20:16:53 PDT
So in this code

(gdb) p size
$1 = {
  <mozilla::gfx::BaseSize<int, nsIntSize>> = {
    width = 640, 
    height = 368
  }, <No data fields>}
(gdb) p mSize
$2 = {
  <mozilla::gfx::BaseSize<int, nsIntSize>> = {
    width = 640, 
    height = 360
  }, <No data fields>}

where |size| is the size of the Y component of the target SharedImage and mSize is a member of ImageContainerChild.

I'm not 100% sure what's supposed to happen here but this feels like an overzealous assertion.
Comment 10 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 21:33:17 PDT
Created attachment 649956 [details] [diff] [review]
Use the current decoded image as the reference for allocation
Comment 11 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2012-08-07 21:52:02 PDT
Your reorg of the code is good, but I think YUVImage is a bit wrong. It has "nsIntRect picture;" but it should also have nsIntSizes for each of its Y/U/V planes because they might be bigger than the picture rect (and might be different ... we're not guaranteed that U and V are half the dimensions of Y), and we should be checking all of those sizes when we pull an image out of the pool.
Comment 12 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-07 23:14:03 PDT
Created attachment 649974 [details] [diff] [review]
Use the current decoded image as the reference for allocation, v2

Right-o.
Comment 13 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-08 10:53:19 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/b60c2eedc759
Comment 14 Ryan VanderMeulen [:RyanVM] 2012-08-08 18:24:53 PDT
https://hg.mozilla.org/mozilla-central/rev/b60c2eedc759

Note You need to log in before you can comment on or make changes to this bug.