Last Comment Bug 695612 - nsRemotedAudioStream::Write is non-blocking
: nsRemotedAudioStream::Write is non-blocking
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Audio/Video (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla16
Assigned To: Matthew Gregan [:kinetik]
:
: Maire Reavy [:mreavy]
Mentors:
: 766824 768272 (view as bug list)
Depends on:
Blocks: 695986 b2g-e10s-work 761936 766824
  Show dependency treegraph
 
Reported: 2011-10-18 22:26 PDT by Matthew Gregan [:kinetik]
Modified: 2012-07-04 17:15 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments
patch v0 (4.84 KB, patch)
2012-07-01 22:05 PDT, Matthew Gregan [:kinetik]
cajbir.bugzilla: review+
Details | Diff | Splinter Review

Description Matthew Gregan [:kinetik] 2011-10-18 22:26:57 PDT
nsAudioStream consumers expect Write to block when the backend audio buffer is full, and rely on this behaviour to put audio refill threads to sleep until buffer space becomes available.

nsRemotedAudio's Write does not block, and currently has no knowledge of how full the audio stream's buffers it is remoting to actually are.
Comment 1 Matthew Gregan [:kinetik] 2011-10-20 22:06:37 PDT
I don't plan to work on this anytime soon.  The NativeUI Fennec project for Android is single process, which means we can use sydneyaudio (and future audio APIs) directly without the remoted nsAudioStream.
Comment 2 Matthew Gregan [:kinetik] 2011-10-20 22:08:46 PDT
So I don't forget: Oleg's media bridge patch in bug 598868 is useful for pointers on how to do  non-main-thread IPC bridging, which would make fixing this bug much simpler by allowing Write() to be an synchronous inter-audio-thread call.
Comment 3 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-06-07 22:38:49 PDT
This would be quite easy to do.  We might want this for b2g.
Comment 4 Matthew Gregan [:kinetik] 2012-07-01 22:05:01 PDT
Created attachment 638266 [details] [diff] [review]
patch v0

This is kind of a crummy fix, but we already use this technique to make Drain() blocking, so it's super simple to reuse it for Write.
Comment 5 Matthew Gregan [:kinetik] 2012-07-03 17:25:27 PDT
I spun off bug 770753 for reworking the PAudio protocol to avoid shunting everything through the main threads of each process (which I mentioned in comment 2 in thus bug).
Comment 6 Matthew Gregan [:kinetik] 2012-07-03 20:57:06 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/f39b9c98ab14
Comment 7 Ryan VanderMeulen [:RyanVM] 2012-07-04 06:37:23 PDT
https://hg.mozilla.org/mozilla-central/rev/f39b9c98ab14
Comment 8 cajbir (:cajbir) 2012-07-04 17:14:52 PDT
*** Bug 766824 has been marked as a duplicate of this bug. ***
Comment 9 cajbir (:cajbir) 2012-07-04 17:15:45 PDT
*** Bug 768272 has been marked as a duplicate of this bug. ***

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