Граф коммитов

339 Коммитов

Автор SHA1 Сообщение Дата
Andreas Pehrson 7fba1319b5 Bug 1657246 - Don't fall back to a system driver if it's already running on error. r=padenot
A fallback driver is started whenever an audio callback driver is started, to
run the graph while the audio driver starts, which can be slow.

If the audio driver has started (according to the StateCallback) but not had a
callback yet, it won't have stopped the fallback driver. The handover from the
fallback driver to the audio driver is not yet done.

We do not want to start another fallback driver in this case.

Differential Revision: https://phabricator.services.mozilla.com/D94566
2020-10-28 00:58:20 +00:00
Andreas Pehrson 3d58248e26 Bug 1657246 - Unset AudioCallbackDriver::mStarted on error. r=padenot
Start() will assert !mStarted, but only Stop() unsets it. In case we receive an
error through the state callback and try to restart the driver we fail the above
assert. This patch unsets mStarted on error, and moves the Stop() unsetting to
the STOPPED part of the state callback, to contain all the unsetting there.

Differential Revision: https://phabricator.services.mozilla.com/D94564
2020-10-28 00:58:24 +00:00
Andreas Pehrson b3df0295ce Bug 1657246 - Back out bug 1632864's fix. r=padenot
This keeps the gtest from bug 1632864, but reverts the fixes for a second take.

Differential Revision: https://phabricator.services.mozilla.com/D94562
2020-10-28 00:58:15 +00:00
Csoregi Natalia 4e9f1c5359 Backed out 6 changesets (bug 1657246) for mingw bustage on TestAudioTrackGraph.cpp. CLOSED TREE
Backed out changeset a7c8f608a2f4 (bug 1657246)
Backed out changeset 9ee3d71303c6 (bug 1657246)
Backed out changeset fbba0ed1f3e9 (bug 1657246)
Backed out changeset e7d0acdef9c3 (bug 1657246)
Backed out changeset 0382b9eb2507 (bug 1657246)
Backed out changeset 28d15a125fed (bug 1657246)
2020-10-28 02:50:05 +02:00
Andreas Pehrson 056db4b004 Bug 1657246 - Don't fall back to a system driver if it's already running on error. r=padenot
A fallback driver is started whenever an audio callback driver is started, to
run the graph while the audio driver starts, which can be slow.

If the audio driver has started (according to the StateCallback) but not had a
callback yet, it won't have stopped the fallback driver. The handover from the
fallback driver to the audio driver is not yet done.

We do not want to start another fallback driver in this case.

Differential Revision: https://phabricator.services.mozilla.com/D94566
2020-10-27 14:37:58 +00:00
Andreas Pehrson 50f5f91b68 Bug 1657246 - Unset AudioCallbackDriver::mStarted on error. r=padenot
Start() will assert !mStarted, but only Stop() unsets it. In case we receive an
error through the state callback and try to restart the driver we fail the above
assert. This patch unsets mStarted on error, and moves the Stop() unsetting to
the STOPPED part of the state callback, to contain all the unsetting there.

Differential Revision: https://phabricator.services.mozilla.com/D94564
2020-10-27 14:37:27 +00:00
Andreas Pehrson 4fa631b73a Bug 1657246 - Back out bug 1632864's fix. r=padenot
This keeps the gtest from bug 1632864, but reverts the fixes for a second take.

Differential Revision: https://phabricator.services.mozilla.com/D94562
2020-10-27 15:17:14 +00:00
Paul Adenot 0ddc112415 Bug 1670917 - Add a pref to allow using raw WASAPI streams. Make it default to input-only raw streams. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D93363
2020-10-20 20:03:26 +00:00
Razvan Maries 6ad7ee6c29 Backed out 7 changesets (bug 1670917) for multiple GTest perma failures. CLOSED TREE
Backed out changeset 635942af8244 (bug 1670917)
Backed out changeset b0825300e78d (bug 1670917)
Backed out changeset 881fac72e13c (bug 1670917)
Backed out changeset 0285b2ab6d50 (bug 1670917)
Backed out changeset b58d65b96f2d (bug 1670917)
Backed out changeset 6ad13b34f08d (bug 1670917)
Backed out changeset 426aa6482835 (bug 1670917)
2020-10-20 22:55:47 +03:00
Paul Adenot fded7de4b4 Bug 1670917 - Add a pref to allow using raw WASAPI streams. Make it default to input-only raw streams. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D93363
2020-10-20 13:08:27 +00:00
Paul Adenot 4f9d9dd0be Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-22 13:44:05 +00:00
Sebastian Hengst cf7b0b4636 Backed out 3 changesets (bug 1663917) for crashes (bug 1665983).
Crashes with
* [@ arena_dalloc | `anonymous namespace'::setup_wasapi_stream]
* [@ `anonymous namespace'::wasapi_create_device ]

Backed out changeset f08ef676251a (bug 1663917)
Backed out changeset 5bf586f8f81a (bug 1663917)
Backed out changeset 91ff0dad958b (bug 1663917)
2020-09-18 20:07:30 +02:00
Paul Adenot 56781da2dc Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-17 12:14:22 +00:00
Bogdan Tara 5efefd3ef2 Backed out 3 changesets (bug 1663917) on jcristau's request, for crashes a=backout
DONTBUILD

Backed out changeset 706c1dc89ab3 (bug 1663917)
Backed out changeset 837d83a0bddd (bug 1663917)
Backed out changeset 18143730ca80 (bug 1663917)
2020-09-17 12:58:50 +03:00
Paul Adenot fb0d032a06 Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-15 15:05:08 +00:00
Cristina Coroiu f7fbc59a7a Backed out 3 changesets (bug 1663917) for causing crashes
Backed out changeset 5ff7eb9b8a22 (bug 1663917)
Backed out changeset 8d5dfe86bd98 (bug 1663917)
Backed out changeset 02d7087c466d (bug 1663917)
2020-09-12 18:03:32 +03:00
Paul Adenot 810a0eb3fe Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-11 13:16:05 +00:00
Narcis Beleuzu 807eb4e6a9 Backed out 3 changesets (bug 1663917) for hazard bustages on cubeb_log.h CLOSED TREE
Backed out changeset efddab14db95 (bug 1663917)
Backed out changeset 5d049e004a9c (bug 1663917)
Backed out changeset f6b10dbb0863 (bug 1663917)
2020-09-11 02:11:45 +03:00
Paul Adenot f3177d3cdf Bug 1663917 - Remove special case on Windows for VOICE cubeb stream. r=kinetik
This [0] commit unties the device selection from the fact that a stream
transports voice data. Telling cubeb that the stream has voice data allows
lowering the complexity of the resampler, and lowering the impact of the
resampler on the latency.

[0]: ac3569ef18

Depends on D89590

Differential Revision: https://phabricator.services.mozilla.com/D89591
2020-09-09 21:23:06 +00:00
Paul Adenot 6cd89c3d99 Bug 1653113 - Backed out changeset 61336bfc7584. r=achronop
Depends on D83804

Differential Revision: https://phabricator.services.mozilla.com/D83805
2020-07-17 09:50:48 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Paul Adenot 36b91efcb0 Bug 1648059 - Switch to async tracing in AudioStream.cpp and GraphDriver.cpp. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D80859
2020-06-25 22:26:31 +00:00
Paul Adenot f2a2fb7d24 Bug 1646348 - Use the AudioThreadRegistry in GraphDriver.cpp. r=achronop
This patch changes the type of mAudioThreadId because `std:🧵:id` is
non-memovable and AudioThreadRegistry uses an nsTArray, that needs elements to
be memovable.

Differential Revision: https://phabricator.services.mozilla.com/D80466
2020-06-23 16:43:40 +00:00
Paul Adenot 5272ad6142 Bug 1646348 - Fix audio thread registration in GraphDriver.cpp. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D80000
2020-06-23 16:42:57 +00:00
Cosmin Sabou 6822e213d4 Backed out changeset f26dbc8340cf (bug 1646348) for assertion failures on core/platform.cpp. CLOSED TREE 2020-06-18 17:18:25 +03:00
Paul Adenot e6c3203e23 Bug 1646348 - Fix audio thread registration in GraphDriver.cpp. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D80000
2020-06-18 13:23:09 +00:00
Paul Adenot f8dfbc795e Bug 1626918 - Properly check thread id when running with cubeb not sandboxed on a CLOSED TREE.
Differential Revision: https://phabricator.services.mozilla.com/D79486
2020-06-12 15:19:25 +00:00
Paul Adenot d6a6773f04 Bug 1626918 - Don't register the audio callback thread when using audioipc: it's already registered. r=achronop
Depends on D78510

Differential Revision: https://phabricator.services.mozilla.com/D79460
2020-06-12 13:33:04 +00:00
Paul Adenot 33cf21901b Bug 1626918 - Register the audio callback thread(s) to the Gecko profiler even when it changes. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D78504
2020-06-12 13:32:49 +00:00
Karl Tomlinson 41f6931d73 Bug 1644647 rewrite AudioContextOperation handling using PendingResumeOperation r=padenot
The key change here is that AudioContextOperation promises for the same
AudioContext are resolved in order as long as the graph is running.
There is one remaining case where AudioContextOperation promises can be
resolved out of order, which is when
AudioContextOperationControlMessage::RunDuringShutdown() resolves a Close
operation shortly after Run() has queued its update via mUpdateRunnables.
mUpdateRunnables are run after controlMessagesToRunDuringShutdown.
https://searchfox.org/mozilla-central/rev/ea7f70dac1c5fd18400f6d2a92679777d4b21492/dom/media/MediaTrackGraph.cpp#1793,1803

Pending resume operations are now stored on the graph instead of on
mNextDriver.  This means there is no need to move operations between drivers
when switching from one mNextDriver to another, the code for which was
previously missing.

Suspend operations are performed immediately, because even a callback driver
can render nothing.  Tracks are not resumed until either there is an
AudioCallbackDriver to deliver the rendered audio or the Resume operation is
canceled by a subsequent Suspend.

While the graph is running, DispatchToMainThreadStableState() is used
consistently, whereas previously this was mixed with direct Dispatch() to the
main thread, which could have the runnable Run() before main thread state had
been updated for rendering up to the time of a Suspend.

Differential Revision: https://phabricator.services.mozilla.com/D76806
2020-06-11 08:52:00 +00:00
Alex Chronopoulos c267d99198 Bug 1637235 - Implement a ring buffer for audio data. r=padenot,jya
Implement a ring buffer that is not thread-safe and preallocate its internal buffers. The intention is that the internal data is preallocate to any thread and then read/write operations will take place in a single thread using the memory in a ring manner.

Differential Revision: https://phabricator.services.mozilla.com/D74882
2020-06-01 15:53:18 +00:00
Noemi Erli e8580c92df Backed out 3 changesets (bug 1637235) for causing bustages in TestDynamicResampler.cpp CLOSED TREE
Backed out changeset 705f2d35af32 (bug 1637235)
Backed out changeset d32ea183ab01 (bug 1637235)
Backed out changeset 81012bc3b3ac (bug 1637235)
2020-06-01 17:39:50 +03:00
Alex Chronopoulos aea5a8674c Bug 1637235 - Implement a ring buffer for audio data. r=padenot,jya
Implement a ring buffer that is not thread-safe and preallocate its internal buffers. The intention is that the internal data is preallocate to any thread and then read/write operations will take place in a single thread using the memory in a ring manner.

Differential Revision: https://phabricator.services.mozilla.com/D74882
2020-06-01 12:27:00 +00:00
Paul Adenot 3eb71b17bf Bug 1628779 - Update the latency periodically on main thread. r=achronop
We're doing it async, triggered during the stable state runnable, and then the
values are cached in atomic variables, so that the rendering thread can have the
info as well, for using during processing.

Differential Revision: https://phabricator.services.mozilla.com/D75331
2020-05-28 09:50:20 +00:00
alwu 0bccc7a4cf Bug 1612557 - part2 : create a sub-category 'Cubeb'. r=padenot
This patch will do :
- create a sub-category `Cubeb`
- add  `Cubeb` profiling labels in related codes

The advantage of doing so :
- allow us to know the percentage of time respectively we spend on cubeb and non-cubeb codes

More details :
The profiling code would include `<atomic>` which is C++ only, so I can't use the label in `cubeb.c` directly. Instead, I add labels on the `AudioStream` and `AudioCallbackDriver` where we would call cubeb related methods.

Differential Revision: https://phabricator.services.mozilla.com/D74172
2020-05-11 14:08:10 +00:00
Karl Tomlinson 0a1151e126 Bug 1625372 request interrupt of AudioWorklet JS on force shutdown r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D71915
2020-05-15 08:24:06 +00:00
Csoregi Natalia 0da2867bf2 Backed out 5 changesets (bug 1625372) for assertion failures on GraphDriver.cpp. CLOSED TREE
Backed out changeset b9feee4f447c (bug 1625372)
Backed out changeset d86f066bd68b (bug 1625372)
Backed out changeset 7a38398623f8 (bug 1625372)
Backed out changeset 6e9928fb37d1 (bug 1625372)
Backed out changeset ca93e9921c05 (bug 1625372)
2020-05-13 13:09:22 +03:00
Karl Tomlinson 53bf89e445 Bug 1625372 request interrupt of AudioWorklet JS on force shutdown r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D71915
2020-05-12 07:10:51 +00:00
Paul Adenot 32d217338f Bug 1626081 - Add a pref to disable the audio output stream routing on Android. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D74274
2020-05-12 08:31:58 +00:00
Cosmin Sabou 72e80153f2 Backed out 3 changesets (bug 1626081) for causing build bustages. CLOSED TREE
Backed out changeset 82cae35b52eb (bug 1626081)
Backed out changeset 42135f164217 (bug 1626081)
Backed out changeset 2676f31077bc (bug 1626081)
2020-05-11 21:38:54 +03:00
Paul Adenot c2836cdf8d Bug 1626081 - Add a pref to disable the audio output stream routing on Android. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D74274
2020-05-11 18:23:46 +00:00
Sylvestre Ledru 1929dd1ab3 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D73347
2020-05-09 14:51:53 +00:00
Paul Adenot 7ae051725e Bug 1633747 - Don't call NaN fixing code on platforms where samples are in i16.
Differential Revision: https://phabricator.services.mozilla.com/D73611
2020-05-04 10:12:55 +00:00
Paul Adenot 052b46021c Bug 1633747 - Flush NaNs to zeros before handing back the audio output buffer to the OS. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D72927
2020-05-01 23:57:30 +00:00
Alex Chronopoulos ba0acfe03a Bug 1632864 - Handle error state callback in GraphDriver. r=padenot
Till now an AudioCallbackDriver, on error state callback, creates a FallbackDriver, which attempts to start the existing AudioCallbackDriver. If the driver has already started this creates a cr
ash because restart is not allowed.

This patch continues using the FallbackDriver, on cubeb state error but the driver has been enhanced with an error state that will not attempt to restart the driver. The fallback driver will continue advancing the graph similar to a ThreadedDriver until a driver switch takes place.

Depends on D73102

Differential Revision: https://phabricator.services.mozilla.com/D73103
2020-04-29 17:53:08 +00:00
Paul Adenot d4a6eabc5d Bug 1610437 - Only hard-pan the audio on older macbook pro. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D72821
2020-04-29 10:38:53 +00:00
Alex Chronopoulos 1fb9641c89 Bug 1630986 - Notify asynchronously when the audio device has started. r=padenot
The existing `MTGImpl::NotifyWhenGraphStarted()` has been enhanced to work with a MediaTrack instead of AudioNodeTrack. In addition to that, an option has been added about resolving the retuned promise in the audio thread instead of the fallback thread when the Graph has just started. Also, a unit test has been added to verify the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D71339
2020-04-21 16:14:00 +00:00
Andreas Farre 36eaf82163 Bug 1620594 - Part 2: Use SchedulerGroup::Dispatch instead of SystemGroup::Dispatch. r=nika
Depends on D67631

Differential Revision: https://phabricator.services.mozilla.com/D67632

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:33 +00:00
Paul Adenot 0aeec7fcf2 Bug 1627905 - Add uses of WavDumper to AudioCallbackDriver. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D69972

--HG--
extra : moz-landing-system : lando
2020-04-07 14:33:57 +00:00
Paul Adenot 19ff390e1c Bug 1627905 - Rename mOutputChannels to mOutputChannelCount to match the input name. r=achronop
Differential Revision: https://phabricator.services.mozilla.com/D69982

--HG--
extra : moz-landing-system : lando
2020-04-07 14:33:57 +00:00