Last Comment Bug 782460 - Gaia video app doesn't play videos when run OOP
: Gaia video app doesn't play videos when run OOP
Status: RESOLVED FIXED
[LOE:S]
:
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:
: 779153 779156 (view as bug list)
Depends on: 730765 782456
Blocks: b2g-e10s-work
  Show dependency treegraph
 
Reported: 2012-08-13 16:37 PDT by Dave Hylands [:dhylands]
Modified: 2012-08-26 13:06 PDT (History)
14 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments
logcat output showing segfault and related debug output from running cubevid oop (265.12 KB, text/plain)
2012-08-22 12:01 PDT, David Flanagan [:djf]
no flags Details
Hack (848 bytes, patch)
2012-08-25 14:19 PDT, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
no flags Details | Diff | Splinter Review
Fix hal enum serializers, make wake lock permission checking match the DOM's, and log a message when an app process fails a backstop permission check (4.92 KB, patch)
2012-08-25 15:07 PDT, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
gal: review+
Details | Diff | Splinter Review

Description Dave Hylands [:dhylands] 2012-08-13 16:37:20 PDT
I I launch the video app OOP, then all I see is a black screen with the status bar (wifi/battery/time)

When run non-OOP I see a list of videos to play.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-21 02:50:41 PDT
The music app and gallery apps seem to be able to use mediastorage + IDB just fine when OOP.  Why is Video different?
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-21 02:55:55 PDT
Nothing interesting in logcat, except I do see a surprising number of cycle collections on startup. 

No string in ((close)*(restart)*(go-to-homescreen)*(open-task-switcher)*)* that I've tried shows me video entries.
Comment 3 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-21 03:02:57 PDT
Bug 783184 doesn't make this work.
Comment 4 David Flanagan [:djf] 2012-08-21 10:23:50 PDT
The video app is the neglected child of the media apps and its device storage code is out of date.  Dale is working on it as we speak.  This is probably just a Gaia bug.  Adding dale to the cc list.
Comment 5 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-21 11:11:13 PDT
It works in-process.  Do you have some sort of race condition in mind, maybe?
Comment 6 David Flanagan [:djf] 2012-08-21 11:13:53 PDT
I haven't thought about why in process vs oop would break it, and I haven't looked at the code, but I thought you should know that Dale is currently in the middle of changing all that code.
Comment 7 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-22 04:12:51 PDT
Since gallery and music seem to be able to find files OOP, I'm going to assume whatever is bugging video is small and dumb.  Maybe a gaia-only issue.
Comment 8 Dale Harvey (:daleharvey) 2012-08-22 04:25:35 PDT
The app now find videos oop but doesnt play them, as david said I will be looking into it / fixing it / filing issues. I have a bunch of code to PR later today
Comment 9 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-22 04:46:35 PDT
Not playing videos is almost certainly a separate bug.

Was the fix for finding videos all on the gaia side?  If so, we can morph this bug into "videos not playing OOP", but the work estimate will change.
Comment 10 Dale Harvey (:daleharvey) 2012-08-22 05:42:09 PDT
Yeh I didnt actually do anything, I had already switched Video to MediaDB locally and that 'just worked', repurposing this makes sense
Comment 11 Andrew Overholt [:overholt] 2012-08-22 10:59:47 PDT
(In reply to dale@arandomurl.com from comment #10)
> Yeh I didnt actually do anything, I had already switched Video to MediaDB
> locally and that 'just worked', repurposing this makes sense

Done.  Dale, are you the best owner here?
Comment 12 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-22 11:06:18 PDT
Possibly related to bug 778300.
Comment 13 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-22 11:07:21 PDT
Guys, audio and video seems completely broken from content processes on Gonk.  Assigning to myself, but we could really use some help here.
Comment 14 David Flanagan [:djf] 2012-08-22 12:01:38 PDT
Created attachment 654304 [details]
logcat output showing segfault and related debug output from running cubevid oop
Comment 15 David Flanagan [:djf] 2012-08-22 12:02:21 PDT
cubevid seems to have the same (or similar) problem.  Works on process, but fails (with segfault!) when run OOP.  See attachment
Comment 16 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-22 12:13:53 PDT
This may be a separate bug from video playback, if the video app doesn't behave similarly.
Comment 17 cajbir (:cajbir) 2012-08-22 16:34:15 PDT
I don't know much about B2G architecture - what's the difference between the browser app and the apps where video doesn't work? I can play videos fine in the browser.

When did this issue start happening? Do you have a regression range?
Comment 18 Andreas Gal :gal 2012-08-22 16:38:45 PDT
We should capture a stack for this.
Comment 19 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 14:19:08 PDT
Created attachment 655354 [details] [diff] [review]
Hack

When testing bug 782456, I had a patch equivalent to this that forced all content processes to run with inherited privileges.  With this patch, we find the list of videos, and without it, we don't.

WTF?
Comment 20 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 15:07:01 PDT
Created attachment 655361 [details] [diff] [review]
Fix hal enum serializers, make wake lock permission checking match the DOM's, and log a message when an app process fails a backstop permission check

Now need to see why things don't work when we're unprivileged ...
Comment 21 Andreas Gal :gal 2012-08-25 15:15:55 PDT
Comment on attachment 655361 [details] [diff] [review]
Fix hal enum serializers, make wake lock permission checking match the DOM's, and log a message when an app process fails a backstop permission check

Trivial. Stealing.
Comment 22 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 15:23:24 PDT
We're failing at

  rv = tmpFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0700);
  NS_ENSURE_SUCCESS(rv,rv);

in nsMediaCache.cpp.  The problem is

/data/local/tmp # ls -l
drwx------ root     root              2012-08-25 15:03 mozilla-media-cache

something has created the cache dir as root, and unprivileged content processes can't create files in there.

Deleting the cache and then relaunching the video app makes it work OOP.
Comment 23 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 15:24:58 PDT
doublec, this is going to be a icky little footgun.  Is there a reason we create a directory in which to store the cache files?  Just cleanliness?

We might need to create this as |mozilla-media-cache-$UID|.
Comment 24 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 15:25:47 PDT
Comment on attachment 655361 [details] [diff] [review]
Fix hal enum serializers, make wake lock permission checking match the DOM's, and log a message when an app process fails a backstop permission check

There's only one part here, thankfully.
Comment 25 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 15:38:43 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/af3d98089970
Comment 26 Justin Lebar (not reading bugmail) 2012-08-25 15:42:51 PDT
*** Bug 779156 has been marked as a duplicate of this bug. ***
Comment 27 Justin Lebar (not reading bugmail) 2012-08-25 15:43:11 PDT
*** Bug 779153 has been marked as a duplicate of this bug. ***
Comment 28 Justin Lebar (not reading bugmail) 2012-08-25 15:43:53 PDT
Maybe I should have fixed those serializer bugs when I found them, instead of relying on the presumed owners to fix them.  Sorry, Chris.
Comment 29 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 15:51:54 PDT
S'ok.  They weren't The Real Bug here, I just stumbled across them in gdb.
Comment 30 cajbir (:cajbir) 2012-08-25 17:56:28 PDT
Chris Pearce would know more about the reasoning behind the cache operation. Pinging him. Chris Pearce, please see comment 23.
Comment 31 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-25 17:59:44 PDT
Let's take that discussion to bug 785662.
Comment 32 Ryan VanderMeulen [:RyanVM] 2012-08-26 13:06:45 PDT
https://hg.mozilla.org/mozilla-central/rev/af3d98089970

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