Commit Graph

86 Commits

Author SHA1 Message Date
Ryan VanderMeulen
5cbfa3c2ce Backed out changeset 11f95edf23a4 (bug 1073615) for frequent mochitest-bc timeouts. 2014-10-01 13:04:02 -04:00
Andrea Marchesini
8e7ea7a033 Bug 1073615 - One MediaStreamGraph singleton per audioChannel, r=roc 2014-09-30 18:35:32 +01:00
Randell Jesup
d88304cbcf Bug 1074048: Allow MainThread access if the graph is shut down (for RunDuringShutdown) r=roc 2014-09-30 08:59:05 -04:00
Randell Jesup
863298d9e0 bug 1072780: patch 4 - Use atomics for EnsureNextIteration to close races around CurrentDriver r=roc 2014-09-28 12:07:25 -04:00
Randell Jesup
518b26e1f8 bug 1072780: patch 3 - Fix up Revive() to not trigger assertions, and also to avoid Init() (blocking) on MainThread r=roc 2014-09-28 12:07:24 -04:00
Randell Jesup
64af5f19cd Bug 1072775: Additional assertions for MediaStreamGraph/GraphDriver r=roc 2014-09-28 12:07:24 -04:00
Randell Jesup
bb9f80b6b1 Bug 1072780: patch 1 - clean up CurrentDriver() use off-MSG-thread; fix InCallback() r=roc 2014-09-28 12:07:24 -04:00
Daniel Holbert
8c09c51078 Back out bug 1072780 & bug 1072775 (by reverting to cset before them, d71444b75291) for pthread assertion failures 2014-09-28 09:56:40 -07:00
Randell Jesup
319ff20936 bug 1072780: patch 4 - Use atomics for EnsureNextIteration to close races around CurrentDriver r=roc 2014-09-28 12:07:25 -04:00
Randell Jesup
30d3930ed6 bug 1072780: patch 3 - Fix up Revive() to not trigger assertions, and also to avoid Init() (blocking) on MainThread r=roc 2014-09-28 12:07:24 -04:00
Randell Jesup
e78a54416d Bug 1072775: Additional assertions for MediaStreamGraph/GraphDriver r=roc 2014-09-28 12:07:24 -04:00
Randell Jesup
40d928dbfe Bug 1072780: patch 1 - clean up CurrentDriver() use off-MSG-thread; fix InCallback() r=roc 2014-09-28 12:07:24 -04:00
Paul Adenot
616503a7f6 Bug 1059389 - Unbreak --disable-webrtc. r=jesup
--HG--
extra : rebase_source : 4ef5373b44a889c0641b0e829e3feae2a0116f5e
2014-09-09 18:23:01 +02:00
Paul Adenot
0661e8b253 Bug 1062293 - Add specialized logging to track the lifetime state change of MediaStreamGraphs r=jesup
As noted in the comment, it is very useful to have this interleaved with the ADB
logcat on Android/b2g, because this way we can correlate gecko state with the
state of the Android HAL.

--HG--
extra : rebase_source : 80df45d0851a06daac3abeab2ea4b5bc7e58a21d
2014-08-31 14:19:48 +02:00
Randell Jesup
7dc8dd9b1e Bug 848954 - Part 29 - Make the MSG in stable state event ref counted. r=padenot 2014-08-26 17:04:39 +02:00
Randell Jesup
709c9d60a7 Bug 848954 - Part 29 - Make sure to clear the right boolean flag when dispatching a stable state event. r=padenot 2014-08-25 14:13:14 +02:00
Paul Adenot
e8039f0369 Bug 848954 - Part 27 - Only attempt to sleep if the graph is still running. r=jesup 2014-08-26 17:04:36 +02:00
Paul Adenot
5f32ebf427 Bug 848954 - Part 23 - Refcount the AudioOutputObserver. r=jesup 2014-08-26 17:02:31 +02:00
Paul Adenot
6628654530 Bug 848954 - Part 21 - Fix sleep/wake up code for the MSG. r=roc 2014-08-26 17:02:30 +02:00
Paul Adenot
7846782ef2 Bug 848954 - Part 20 - Remove the now useless DriverHolder class. r=roc 2014-08-26 17:02:28 +02:00
Paul Adenot
c66ac1d38b Bug 848954 - Part 16 - Make AudioCallbackDriver respect the AudioChannelType. r=roc 2014-08-26 17:02:08 +02:00
Paul Adenot
3bfd993eac Bug 848954 - Part 15 - Allow an AudioCallbackDriver to sleep to save power. r=roc 2014-08-26 17:02:08 +02:00
Paul Adenot
6c0f9e38fb Bug 848954 - Part 10 - Add a MediaStreamGraph driver based on an audio callback. r=roc 2014-08-26 17:01:33 +02:00
Paul Adenot
b76a30bb3f Bug 848954 - Part 9 - Allow to pass in hints when getting a reference to a MediaStreamGraph to get the right driver started as soon as possible. r=roc
This is useful because some platform have rather slow audio stream
initialization time, especially the first time an audio stream is created for
the process.

We put in telemetry probes to measure that:
First stream opened for the process:
http://telemetry.mozilla.org/#filter=nightly%2F33%2FAUDIOSTREAM_FIRST_OPEN_MS&aggregates=multiselect-all!Submissions!Mean!5th%20percentile!25th%20percentile!median!75th%20percentile!95th%20percentile&evoOver=Builds&locked=true&sanitize=true&renderhistogram=Graph

Subsequent streams:
http://telemetry.mozilla.org/#filter=nightly%2F33%2FAUDIOSTREAM_LATER_OPEN_MS&aggregates=multiselect-all!Submissions!Mean!5th%20percentile!25th%20percentile!median!75th%20percentile!95th%20percentile&evoOver=Builds&locked=true&sanitize=true&renderhistogram=Graph
2014-08-25 15:27:25 +02:00
Paul Adenot
679fac5442 Bug 848954 - Part 7 - Get rid of the stack allocated message queue. r=roc
In the next patches, when the AudioDriver will be implemented, the audio backend
thread (that we don't control), will return from the stack frame where the
nsTArray that allows the MSG thread to exchange message queues in a efficient
manner with the main thread. We put it in the MediaStreamGraph to avoid adding
an allocation/deallocation per iteration on the MSG thread.

In addition, the graph will be able to run on different threads during its
lifetime, so we can't guarantee a stable stack frame to allocate things on
anymore.

The array are renamed with meaningful names, explaining the double-buffering
pattern: the back queue is filled by the main thread, and is swapped with the
front queue that is processed by the MSG thread.

Arrays accesses are synchronized using the driver's monitor.
2014-08-25 15:26:21 +02:00
Paul Adenot
5283170bbe Bug 848954 - Part 5 - Mix down all audio and only output a single stream. r=roc 2014-08-25 15:25:49 +02:00
Paul Adenot
af9bfbca22 Bug 848954 - Part 3 - Separate interval time calculation and actual processing, and give an audio-callback compatible interface to the Process function. r=roc 2014-04-25 18:04:23 +02:00
Paul Adenot
f04cfc8457 Bug 848954 - Part 2 - Put the thread management in the driver. r=roc 2014-04-25 18:03:04 +02:00
Paul Adenot
53b7efb271 Bug 848954 - Part 1 - Factor out clocks and scheduling of MSG iterations. r=roc 2014-04-25 16:09:30 +02:00
Karl Tomlinson
c408e4099c b=932400 change stream ordering to get feedback DelayNode output before supplying input r=roc
Previously downstream nodes from DelayNodes in cycles sometimes received stale
output from the previous MSG iteration.

Also, if two cycles share a common path, they will now *both* be treated as
cycles, either by muting or by enforcing minimum delay.  Previously, marking
one cycle first could prevent detection of other cycles in the same SCC.

--HG--
extra : rebase_source : 82892c538c5ce514165b5f975474df15b99e3d2b
2014-07-17 12:55:55 +12:00
Karl Tomlinson
cbffbf7d6b b=932400 remove refcount manipulation of streams when reordering for processing r=roc
--HG--
extra : rebase_source : f99f4220b53a28a32e9a294b67f4db6218113d73
2014-07-07 11:52:25 +12:00
Karl Tomlinson
db2546467c b=1020411 correct control message order with RunAfterPendingUpdates() at shutdown r=roc
--HG--
extra : transplant_source : %AE%05%92%2C%60%9FL%D0%13O%EE%7D%09ZV%87%06%E9%B6%D8
2014-07-02 18:04:54 +12:00
Karl Tomlinson
a4b9a3c57e b=1023697 use audio ticks for graph time units r=roc
--HG--
extra : transplant_source : 8%BA%9D%5C%E32%05x%A79K%08TH%A7%F4%F2tg%EC
2014-06-12 16:45:00 +12:00
Karl Tomlinson
1fdee32d25 b=1023697 add functions to convert between track ticks and seconds, and remove global MediaTime/second conversion functions r=roc
--HG--
extra : transplant_source : %F3%D8%C168%B7%A3%13%B2p%3Ee%89TkGlD%A8%A7
2014-06-12 16:45:00 +12:00
Karl Tomlinson
d8be06bf30 b=1023697 add functions to convert between track rates and remove global StreamTime/tick conversion functions r=roc
--HG--
extra : transplant_source : %B6%BC%83%17%22%EE%5D%BEl%B6%17m%1C%D0N%D1C%97%60%E1
2014-06-12 16:44:59 +12:00
Karl Tomlinson
b0bb0ef6be b=1023697 record the graph tick rate on StreamBuffer and its Tracks for StreamTime calculations r=roc
--HG--
extra : transplant_source : 8%B4%DB%A4%FE%2C%B7%235%7F%7D5%2C%FA%BA%0D%9E%CC%7E%11
2014-06-12 16:44:59 +12:00
Karl Tomlinson
4fbb1323cc b=1015025 use a consistent reference timestamp for graph time to avoid accumulating drift from rounding to MediaTime r=roc
--HG--
extra : transplant_source : 2%B9y%D4%80%DA/qqx%C5%F5%86%8CoT%B9S%19%D9
2014-05-26 11:26:52 +12:00
Paul Adenot
9a84687a23 Bug 998179 - Refactor how MediaStreamGraph get and use their sample rate. r=roc
Use the sample rate passed to the OfflineAudioContext constructor in
MediaStreamGraph::CreateOfflineInstance, and pass the preferred mixer sample
rate to the (real time) MediaStreamGraph constructor.

Then, always use this sample rate for the lifetime of the graph.

This patch needed to pass the sample rate to the AudioMixer class to avoid
relying on globals like it was done before.

--HG--
extra : rebase_source : 2802208819887605fe26a7040998fc328b3c9a57
2014-04-23 11:20:56 +02:00
Eric Rahm
0c4d54b70f Bug 967817 - Finish memory reporters for Web Audio. r=roc, njn 2014-04-13 11:08:10 -07:00
Paul Adenot
c92abbdb27 Bug 982490 - Ensure for MSG cycle that each MediaStream write the same number of frames to their AudioStream. r=jesup,roc 2014-03-24 11:06:06 +01:00
Paul Adenot
ce58cb728c Bug 818822 - Resample all inputs of the MediaStreamGraph to the ideal audio rate. r=roc 2014-03-24 11:06:05 +01:00
Randell Jesup
8da8e8d53a Backed out changeset 5349ecd9c313 (bug 818822) 2014-04-07 15:40:55 -04:00
Randell Jesup
e5b76be31d Backed out changeset 87f437be7de5 (bug 982490) 2014-04-07 15:37:56 -04:00
Paul Adenot
07df38f7df Bug 982490 - Ensure for MSG cycle that each MediaStream write the same number of frames to their AudioStream. r=jesup,roc 2014-03-24 11:06:06 +01:00
Paul Adenot
bd6d91c746 Bug 818822 - Resample all inputs of the MediaStreamGraph to the ideal audio rate. r=roc 2014-03-24 11:06:05 +01:00
Randell Jesup
beb3941cd7 Backed out 965c62289427:cb894b5d342f for perma-orange on b2g emulator M10 r=backout 2014-04-02 17:11:12 -04:00
Paul Adenot
61d2f3b535 Bug 982490 - Ensure for MSG cycle that each MediaStream write the same number of frames to their AudioStream. r=jesup,roc 2014-03-24 11:06:06 +01:00
Paul Adenot
8b3bed64f3 Bug 818822 - Resample all inputs of the MediaStreamGraph to the ideal audio rate. r=roc 2014-03-24 11:06:05 +01:00
Karl Tomlinson
7bfe15413c b=969089 allow an offline graph to shutdown before it's AudioDestinationNode is unlinked r=roc
A non-realtime graph does not start up again after finished processing, so it
can safely enter LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION.

--HG--
extra : transplant_source : %AF%98D%D5%EE%CA7zfv.%B4%F4%D8%05Q7%C2%8D%A7
2014-02-11 13:04:58 +13:00
Robert O'Callahan
de915bf668 Bug 952893. Part 2: When all streams in the MSG are blocked, allow the MSG to suspend indefinitely and pause AudioStream outputs while suspended. r=padenot 2014-01-16 00:13:07 +13:00