Closed
Bug 836599
Opened 12 years ago
Closed 12 years ago
Implement OfflineAudioContext
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
(Keywords: dev-doc-complete)
Attachments
(15 files, 5 obsolete files)
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
ehsan.akhgari
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
roc, do you know what underlying assumptions MediaStreamsGraphImpl makes about the underlying hardware, such as the number of channels, sample rate, etc.?
Thanks!
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #709857 -
Flags: review?(roc)
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #709858 -
Flags: review?(roc)
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #709859 -
Flags: review?(roc)
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #709860 -
Flags: review?(roc)
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #709862 -
Flags: review?(roc)
Assignee | ||
Comment 7•12 years ago
|
||
I haven't finished the rest of the patches in this series yet so I won't attach them to the bug just now, but we should be able to land the first 6 parts now.
Attachment #709855 -
Flags: review?(roc) → review+
Attachment #709857 -
Flags: review?(roc) → review+
Attachment #709858 -
Flags: review?(roc) → review+
Attachment #709859 -
Flags: review?(roc) → review+
Attachment #709860 -
Flags: review?(roc) → review+
Attachment #709862 -
Flags: review?(roc) → review+
Assignee | ||
Comment 8•12 years ago
|
||
Landed the first 6 parts:
https://hg.mozilla.org/integration/mozilla-inbound/rev/852af57de5cc
https://hg.mozilla.org/integration/mozilla-inbound/rev/efe8cb43b6cd
https://hg.mozilla.org/integration/mozilla-inbound/rev/718e8b7288ae
https://hg.mozilla.org/integration/mozilla-inbound/rev/66c03536917a
https://hg.mozilla.org/integration/mozilla-inbound/rev/12715a3b5a08
https://hg.mozilla.org/integration/mozilla-inbound/rev/189766068d99
Whiteboard: [leave open]
Comment 9•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/852af57de5cc
https://hg.mozilla.org/mozilla-central/rev/efe8cb43b6cd
https://hg.mozilla.org/mozilla-central/rev/718e8b7288ae
https://hg.mozilla.org/mozilla-central/rev/66c03536917a
https://hg.mozilla.org/mozilla-central/rev/12715a3b5a08
https://hg.mozilla.org/mozilla-central/rev/189766068d99
Comment 10•12 years ago
|
||
Note that bug 836850 is now fixed, so we can just use a single class here if desired.
Assignee | ||
Comment 11•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #10)
> Note that bug 836850 is now fixed, so we can just use a single class here if
> desired.
Yes, thanks!
Depends on: 836850
Assignee | ||
Updated•12 years ago
|
Whiteboard: [leave open]
Assignee | ||
Comment 12•12 years ago
|
||
This currently passes try. I'd like to land this part sooner. I'm working on the rest.
Attachment #746745 -
Flags: review?(roc)
Comment on attachment 746745 [details] [diff] [review]
Part 7: Implement a non-realtime API in MediaStreamGraph
Review of attachment 746745 [details] [diff] [review]:
-----------------------------------------------------------------
Nice!
Attachment #746745 -
Flags: review?(roc) → review+
Assignee | ||
Updated•12 years ago
|
Whiteboard: [leave open]
Assignee | ||
Comment 14•12 years ago
|
||
Comment on attachment 746745 [details] [diff] [review]
Part 7: Implement a non-realtime API in MediaStreamGraph
https://hg.mozilla.org/integration/mozilla-inbound/rev/c97a67b4ec08
Attachment #746745 -
Flags: checkin+
Comment 15•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Whiteboard: [leave open]
Assignee | ||
Comment 16•12 years ago
|
||
Attachment #749983 -
Flags: review?(roc)
Assignee | ||
Comment 17•12 years ago
|
||
Attachment #749984 -
Flags: review?(roc)
Assignee | ||
Comment 18•12 years ago
|
||
Attachment #749986 -
Flags: review?(roc)
Assignee | ||
Comment 19•12 years ago
|
||
Attachment #749987 -
Flags: review?(roc)
Assignee | ||
Comment 20•12 years ago
|
||
Attachment #749988 -
Flags: review?(roc)
Assignee | ||
Comment 21•12 years ago
|
||
Attachment #749989 -
Flags: review?(roc)
Assignee | ||
Comment 22•12 years ago
|
||
Attachment #749990 -
Flags: review?(roc)
Assignee | ||
Comment 23•12 years ago
|
||
Assignee | ||
Comment 24•12 years ago
|
||
Try is happy with this stuff: https://tbpl.mozilla.org/?tree=Try&rev=b4da97aa2e0f
Attachment #749984 -
Flags: review?(roc) → review+
Comment on attachment 749983 [details] [diff] [review]
Part 8: Add a non-realtime media graph API to produce a given number of ticks
Review of attachment 749983 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/media/MediaStreamGraphImpl.h
@@ +531,5 @@
> */
> bool mRealtime;
> + /**
> + * True when a non-realtime MediaStreamGraph has started to process input. This
> + * value is always set to true on the main thread.
"only accessed on the main thread"
Attachment #749983 -
Flags: review?(roc) → review+
Attachment #749986 -
Flags: review?(roc) → review+
Comment on attachment 749987 [details] [diff] [review]
Part 11: Implement the processing of OfflineAudioContext
Review of attachment 749987 [details] [diff] [review]:
-----------------------------------------------------------------
I actually think we should run the entire graph at the OfflineAudioContext's rate. Sorry, I know that's a big change and maybe difficult, but it seems like the right thing to do.
If you want to take a shortcut and only support OfflineAudioContext with the IdealAudioRate, we can do that for now to get tests working better.
Attachment #749990 -
Flags: review?(roc) → review+
Attachment #749989 -
Flags: review?(roc) → review+
Comment on attachment 749988 [details] [diff] [review]
Part 12: Fix the lifetime management of the Web Audio graph in presence of OfflineAudioContexts
Review of attachment 749988 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/media/webaudio/AudioDestinationNode.cpp
@@ +253,5 @@
> mStream = graph->CreateAudioNodeStream(engine, MediaStreamGraph::EXTERNAL_STREAM);
> }
>
> +void
> +AudioDestinationNode::DestroyGraphIfNeeded()
This seems like a poor name, since you unconditionally destroy the graph.
Assignee | ||
Comment 28•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #26)
> Comment on attachment 749987 [details] [diff] [review]
> Part 11: Implement the processing of OfflineAudioContext
>
> Review of attachment 749987 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I actually think we should run the entire graph at the OfflineAudioContext's
> rate. Sorry, I know that's a big change and maybe difficult, but it seems
> like the right thing to do.
Hmm, why do you think that we should do that? That pretty much breaks everything that depends on the current assumption that the graph runs at 48KHz...
> If you want to take a shortcut and only support OfflineAudioContext with the
> IdealAudioRate, we can do that for now to get tests working better.
No matter what we decide to do eventually, I definitely don't want to make that big of a change here, since we need this sooner rather than later... We can always do that later, and it should be transparent as far as content is concerned.
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #28)
> (In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #26)
> > Comment on attachment 749987 [details] [diff] [review]
> > Part 11: Implement the processing of OfflineAudioContext
> >
> > Review of attachment 749987 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > I actually think we should run the entire graph at the OfflineAudioContext's
> > rate. Sorry, I know that's a big change and maybe difficult, but it seems
> > like the right thing to do.
>
> Hmm, why do you think that we should do that? That pretty much breaks
> everything that depends on the current assumption that the graph runs at
> 48KHz...
Why? Using OfflineAudioContext you can specify that the rate is 48KHz, which is actually *more* reliable than assuming AudioContext's rate is 48KHz!
That's one reason I think we should do that; if someone wants processing to happen at a certain rate, we can and should support that in OfflineAudioContext.
> > If you want to take a shortcut and only support OfflineAudioContext with the
> > IdealAudioRate, we can do that for now to get tests working better.
>
> No matter what we decide to do eventually, I definitely don't want to make
> that big of a change here, since we need this sooner rather than later...
> We can always do that later, and it should be transparent as far as content
> is concerned.
OK.
Assignee | ||
Comment 30•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #29)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #28)
> > (In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #26)
> > > Comment on attachment 749987 [details] [diff] [review]
> > > Part 11: Implement the processing of OfflineAudioContext
> > >
> > > Review of attachment 749987 [details] [diff] [review]:
> > > -----------------------------------------------------------------
> > >
> > > I actually think we should run the entire graph at the OfflineAudioContext's
> > > rate. Sorry, I know that's a big change and maybe difficult, but it seems
> > > like the right thing to do.
> >
> > Hmm, why do you think that we should do that? That pretty much breaks
> > everything that depends on the current assumption that the graph runs at
> > 48KHz...
>
> Why? Using OfflineAudioContext you can specify that the rate is 48KHz, which
> is actually *more* reliable than assuming AudioContext's rate is 48KHz!
Well, we make assumptions about IdealAudioRate() all around the code base. If we want to change that, all of the existing code must be audited to make sure we don't break things. (At least we should change all callers of IdealAudioRate.)
> That's one reason I think we should do that; if someone wants processing to
> happen at a certain rate, we can and should support that in
> OfflineAudioContext.
Hmm, I guess there's actually a content visible difference for a-rate AudioParams... I was not paying attention to that. :(
> > > If you want to take a shortcut and only support OfflineAudioContext with the
> > > IdealAudioRate, we can do that for now to get tests working better.
> >
> > No matter what we decide to do eventually, I definitely don't want to make
> > that big of a change here, since we need this sooner rather than later...
> > We can always do that later, and it should be transparent as far as content
> > is concerned.
>
> OK.
To confirm my understanding, do you mean throwing when you try to create an OfflineAudioContext with a different rate for now, or leave the patch as is? (I slightly prefer to leave it as is)
Assignee | ||
Comment 31•12 years ago
|
||
(with the nit addressed)
Attachment #749983 -
Attachment is obsolete: true
Assignee | ||
Comment 32•12 years ago
|
||
Attachment #749988 -
Attachment is obsolete: true
Attachment #749988 -
Flags: review?(roc)
Attachment #750186 -
Flags: review?(roc)
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #30)
> To confirm my understanding, do you mean throwing when you try to create an
> OfflineAudioContext with a different rate for now, or leave the patch as is?
> (I slightly prefer to leave it as is)
Throw, I think.
Assignee | ||
Comment 34•12 years ago
|
||
(In reply to comment #33)
> (In reply to :Ehsan Akhgari (needinfo? me!) from comment #30)
> > To confirm my understanding, do you mean throwing when you try to create an
> > OfflineAudioContext with a different rate for now, or leave the patch as is?
> > (I slightly prefer to leave it as is)
>
> Throw, I think.
OK, I'll do that tomorrow though. Not feeling well right now...
Attachment #750186 -
Flags: review?(roc) → review+
Assignee | ||
Comment 35•12 years ago
|
||
Attachment #749984 -
Attachment is obsolete: true
Attachment #750399 -
Flags: review?(roc)
Assignee | ||
Comment 36•12 years ago
|
||
Attachment #749986 -
Attachment is obsolete: true
Assignee | ||
Comment 37•12 years ago
|
||
Attachment #749987 -
Attachment is obsolete: true
Attachment #749987 -
Flags: review?(roc)
Attachment #750401 -
Flags: review?(roc)
Attachment #750399 -
Flags: review?(roc) → review+
Comment on attachment 750401 [details] [diff] [review]
Part 11: Implement the processing of OfflineAudioContext
Review of attachment 750401 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/media/webaudio/AudioDestinationNode.cpp
@@ +31,5 @@
> + // These allocations might fail if content provides a huge number of
> + // channels or size, but it's OK since we'll deal with the failure
> + // gracefully.
> + if (mInputChannels.SetLength(aNumberOfChannels)) {
> + static const fallible_t fallible = fallible_t();
Factoring this out seems pointless. Just use new (fallible_t()).
@@ +108,5 @@
> + {
> + // If it's not safe to run scripts right now, schedule this to run later
> + if (!nsContentUtils::IsSafeToRunScript()) {
> + nsContentUtils::AddScriptRunner(this);
> + return NS_OK;
Unnecessary. It's always safe to run script in an nsRunnable dispatched to the main thread.
@@ +165,1 @@
> uint32_t mLength;
Please document the meaning of mWriteIndex and mLength. And mInputChannels.
Attachment #750401 -
Flags: review?(roc) → review+
Assignee | ||
Comment 39•12 years ago
|
||
(In reply to comment #38)
> @@ +108,5 @@
> > + {
> > + // If it's not safe to run scripts right now, schedule this to run later
> > + if (!nsContentUtils::IsSafeToRunScript()) {
> > + nsContentUtils::AddScriptRunner(this);
> > + return NS_OK;
>
> Unnecessary. It's always safe to run script in an nsRunnable dispatched to the
> main thread.
See bug 865233 comment 8. :-)
Gah. We should have NS_DispatchToMainThreadWhenSafeToRunScript or something like that. OK.
Assignee | ||
Comment 41•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #38)
> Comment on attachment 750401 [details] [diff] [review]
> Part 11: Implement the processing of OfflineAudioContext
>
> Review of attachment 750401 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: content/media/webaudio/AudioDestinationNode.cpp
> @@ +31,5 @@
> > + // These allocations might fail if content provides a huge number of
> > + // channels or size, but it's OK since we'll deal with the failure
> > + // gracefully.
> > + if (mInputChannels.SetLength(aNumberOfChannels)) {
> > + static const fallible_t fallible = fallible_t();
>
> Factoring this out seems pointless. Just use new (fallible_t()).
That seems to confuse the compiler, since it doesn't know whether we mean to allocate a fallible_t or not. :(
Assignee | ||
Comment 42•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #40)
> Gah. We should have NS_DispatchToMainThreadWhenSafeToRunScript or something
> like that. OK.
Agreed! Filed bug 873292.
Assignee | ||
Comment 43•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/eccb855886ad
https://hg.mozilla.org/integration/mozilla-inbound/rev/b67a43c241c5
https://hg.mozilla.org/integration/mozilla-inbound/rev/3f5529434311
https://hg.mozilla.org/integration/mozilla-inbound/rev/35cedd1dd27a
https://hg.mozilla.org/integration/mozilla-inbound/rev/894831c54271
https://hg.mozilla.org/integration/mozilla-inbound/rev/7c4f7f3be361
https://hg.mozilla.org/integration/mozilla-inbound/rev/825f0424a603
Comment 44•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/eccb855886ad
https://hg.mozilla.org/mozilla-central/rev/b67a43c241c5
https://hg.mozilla.org/mozilla-central/rev/3f5529434311
https://hg.mozilla.org/mozilla-central/rev/35cedd1dd27a
https://hg.mozilla.org/mozilla-central/rev/894831c54271
https://hg.mozilla.org/mozilla-central/rev/7c4f7f3be361
https://hg.mozilla.org/mozilla-central/rev/825f0424a603
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Updated•12 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 45•11 years ago
|
||
Mass moving Web Audio bugs to the Web Audio component. Filter on duckityduck.
Component: Video/Audio → Web Audio
Comment 46•10 years ago
|
||
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•