Closed
Bug 776069
Opened 13 years ago
Closed 12 years ago
Audio played from content process (main thread) causing dialer to hang
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-basecamp:+)
RESOLVED
FIXED
blocking-basecamp | + |
People
(Reporter: dhylands, Assigned: cjones)
References
Details
Attachments
(1 file)
1009 bytes,
patch
|
kinetik
:
review+
|
Details | Diff | Splinter Review |
If I run the Dialer App OOP, it seems to be completely unresponsive to touches. I can't enter a phone number or otherwise get the UI to respond in any way.
Updated•13 years ago
|
blocking-basecamp: ? → +
Reporter | ||
Comment 2•13 years ago
|
||
I tried again on the latest codebase, and this particular problem seems to be resolved.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Comment 3•12 years ago
|
||
(In reply to Dave Hylands [:dhylands] from comment #2)
> I tried again on the latest codebase, and this particular problem seems to
> be resolved.
It didn't work for me, neither on otoro nor on sgs2-ics.
gaia commit: f7c95943b9bf49dcd52c8c336dc1f93717ebd7d2
(I marked 'Dialer' in the OOP blacklist)
gecko commit: f7c95943b9bf49dcd52c8c336dc1f93717ebd7d2
Reporter | ||
Comment 4•12 years ago
|
||
I tried again on my otoro, and it seems to still be broken. Maybe I wasn't really testing OOP previously. So I'm re-opening
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Updated•12 years ago
|
Comment 5•12 years ago
|
||
I found that the main cause seems resulting from "nsHTMLAudioElement::MozWriteAudio()", because |mAudioStream->Write()| [1] does not return. So the app is stuck when calling 'this._audio.mozWriteAudio(soundData);' in "keypad.js" [2].
[1] http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLAudioElement.cpp#172
[2] https://github.com/mozilla-b2g/gaia/blob/master/apps/dialer/js/keypad.js#L51
Assignee | ||
Comment 6•12 years ago
|
||
Thanks for diagnosing, Hsin-Yi!
Summary: Dialer doesn't seem to see touches when run OOP → Audio played from content process (main thread) causing dialer to hang
Updated•12 years ago
|
Assignee: nobody → htsai
Comment 7•12 years ago
|
||
MozWriteAudio uses nsAudioStream::Available to ensure writes are non-blocking. It turns out that Available() isn't implemented correctly on nsRemotedAudioStream and always returns a fixed size: https://mxr.mozilla.org/mozilla-central/source/content/media/nsAudioStream.cpp#697
This wasn't obvious in the past because nsRemotedAudioStream::Write was broken in such a way that it never blocked; that was fixed by bug 695612 was fixed.
A high level question: we needed this audio remoting to work around the fact that JNI wasn't available in content processes in Android XUL. Since we're using native audio APIs on B2G, can we just disable this audio remoting code altogether?
Assignee | ||
Comment 8•12 years ago
|
||
Not entirely, but that was part of it.
We can do that, but
- it requires giving content processes access to a larger surface area of system resources
- we want to do mixing in gecko anyway eventually, which would use this (well, a successor) remoting code
Assignee | ||
Comment 9•12 years ago
|
||
With this patch, OOP dialer works. Remote audio badly needs a rewrite, but I'm not sure anyone has bandwidth for that for v1. Since it seems too broken, we'll need to trade some security for functionality.
But audio played from browser tabs *still* doesn't work. Argh! http://people.mozilla.com/~cjones/media.html
Assignee: htsai → jones.chris.g
Attachment #653115 -
Flags: review?(kinetik)
Comment 10•12 years ago
|
||
Comment on attachment 653115 [details] [diff] [review]
Disable remote audio for gonk. Sigh
We *could* implement remote Available() instead, but I just don't know what else we're going to uncover, and rewriting this the sane way seems like the best use of effort.
Attachment #653115 -
Flags: review?(kinetik) → review+
Assignee | ||
Comment 11•12 years ago
|
||
I agree.
Assignee | ||
Comment 12•12 years ago
|
||
Comment 13•12 years ago
|
||
(In reply to Matthew Gregan [:kinetik] from comment #10)
> Comment on attachment 653115 [details] [diff] [review]
> Disable remote audio for gonk. Sigh
>
> We *could* implement remote Available() instead, but I just don't know what
> else we're going to uncover, and rewriting this the sane way seems like the
> best use of effort.
I think we can keep a counter for RemotedAudioStream to track how many AudioWriteEvents are not acked. Once it exceeds a threshold, Available() always return 0. I guess the threshold is 1.
Comment 14•12 years ago
|
||
(In reply to Thinker Li [:sinker] from comment #13)
> (In reply to Matthew Gregan [:kinetik] from comment #10)
> > Comment on attachment 653115 [details] [diff] [review]
> > Disable remote audio for gonk. Sigh
> >
> > We *could* implement remote Available() instead, but I just don't know what
> > else we're going to uncover, and rewriting this the sane way seems like the
> > best use of effort.
>
> I think we can keep a counter for RemotedAudioStream to track how many
> AudioWriteEvents are not acked. Once it exceeds a threshold, Available()
> always return 0. I guess the threshold is 1.
I have missed something. We should also stop blocking calling Write() if the counter does not exceeds the threshold. It is an easy and fast way to resolve the problem in the front of us.
Comment 15•12 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 13 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•