This change fixes two cases of encountered mutex re-entries.
Bug: webrtc:11821
Change-Id: Iaef730e4233a79b0d1b2bf6a17fe3f14e2558e98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180800
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31831}
GN recently added support for Apple frameworks to link, rather than
overloading the libs lists. This pulls .frameworks out of the libs
lists, so that GN can stop supporting .frameworks in libs in the
future.
Bug: chromium:1052560
Change-Id: I263230ddd3c468061584423bba9e1f887503bcaa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178601
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#31632}
Previously a histogram was added to track the requested buffer size,
this CL adds a histogram for the actually used buffer size.
Bug: b/157429867
Change-Id: I04016760982a4c43b8ba8f0e095fe1171b705258
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176227
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31385}
The Android native audio code asks the OS to provide an appropriate
buffer size for real-time audio playout. We should add logging for this
value so we can see what values are used in practice.
Bug: b/157429867
Change-Id: I111a74faefc0e77b5c98921804d6625cba1b84af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176126
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreasson <henrika@chromium.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31368}
Pulse related code should still be disabled unless
WEBRTC_ENABLE_LINUX_PULSE is defined but it will always be
compiled.
Bug: None
Change-Id: If8a03aae445a8c73c3c347e275c5996368fe3088
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171513
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30886}
This CL renames the internal macros LINUX_ALSA and LINUX_PULSE and adds
the prefix WEBRTC_. Since these macros are internal to WebRTC, it is
better to use a prefix.
Bug: None
Change-Id: I2a07fa569a4da168006cc36f32e4dbb98a75814b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171514
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30885}
`gn format` recently [1] changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.
Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.
CL generated with:
$ git ls-files | grep BUILD.gn | xargs gn format
$ gn format build_overrides/build.gni
$ gn format build_overrides/gtest.gni
$ gn format modules/audio_coding/audio_coding.gni
$ gn format webrtc.gni
$ gn format .gn
Plus a few manual changes to add exceptions for
"public_deps" (after changing these lines the presubmit
started to complain).
[1] - https://gn-review.googlesource.com/c/gn/+/6860
Bug: webrtc:11302
Change-Id: Iac29d23c1618ebef925c972e2891cd9f4e8cd613
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166882
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30334}
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format
After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.
This primary benefit of this change is a small reduction in binary size.
Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
Replace all usages of java_files with sources in gn files, and
automatically format.
This is in preparation for java_files being completely removed upstream
in favor of sources.
NOPRESUBMIT=true
Bug: chromium:1035074
Change-Id: Ib9a698740b7ad26a127031d90321c7ae2feb59bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163161
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Natalie Chouinard <chouinard@google.com>
Cr-Commit-Position: refs/heads/master@{#30135}
This removes some code in the AudioDeviceWindowsCore::CoreAudioIsSupported function that was checking that every audio input and output device was functional. There are legitimate cases where some, or all, audio devices may not be accessible, and that was causing CoreAudioIsSupported to return false.
If CoreAudioIsSupported returns false, a subsequent RTC_CHECK call fails, which causes the entire app to exit.
After this change, the CoreAudioIsSupported() function simply checks if the Core Audio APIs are supported and no longer tries to do extra stuff unrelated to checking if the APIs are supported.
Note that Core Audio is actually supported in all versions of Windows after Windows XP. There were log messages in the code saying that if CoreAudioIsSupported() returns false, WebRTC will use the Wave Audio APIs instead. But this is no longer the case. The Wave Audio APIs would only be needed for Windows XP, and this code appears to have already been removed from WebRTC.
It is tempting to simply make CoreAudioIsSupported() do a "return true;" but for now I only removed the part of the logging messages that mentioned the Wave Audio APIs.
I understand that there is a new Audio Device Module (ADM) called WindowsCoreAudio2, which is now recommended for use by apps. Apps are supposed to instantiate WindowsCoreAudio2 and pass it in to WebRTC. When the app supplies its own ADM, CoreAudioIsSupported() does not get invoked, which avoids the bug. To help make it clearer that using WindowsCoreAudio2 is an acceptable solution, I am removing a comment that says that kWindowsCoreAudio2 is "experimental".
Bug: webrtc:11081
Change-Id: I7ed1684a276799f4c83006b45629e48814f0b18b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161463
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30025}
Some ErrorProne warnings have been enabled by [1], that broke the
Chromium Roll into WebRTC, this CL should have taken care of all the
problems.
[1] - https://chromium-review.googlesource.com/c/chromium/src/+/1935889
Bug: None
Change-Id: I2670e948c320984a122fdb774b891c98e05f582e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160862
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29933}
Summary of changes/improvements and fixes:
Changes container for list of devices from std::vector to std:deque to
allow fast insertion and deletion at both its beginning and its end. This
approach makes it easier to first build a list of all available devices
and then check the size of the list. If size > 0 => two more devices are
added at the front (Default and Default Communication). The old solution
contained a risk of adding invalid Default and Default Communication
devices in cases where not physical device could be found.
Adds usage of |device_index_| in CoreAudioBase to ensure that the selected
device is unique. The previous version used only an ID but that ID is not
unique when e.g. only one device exists since it can have up to three
different roles.
Improves logging and comments.
No-Try: True
Tbr: thaloun@chromium.org
Bug: webrtc:11107
Change-Id: I9a09f7716ed8d8858dcc6a5354b038fc06496166
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160050
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29874}
Fix signed/unsigned mismatch.
Protect against NumberOfEnumeratedDevices and Get[In|Out]putDeviceNames returning inconsistent results.
It's possible for an device to be counted but getting its name fails, in which case the utility function returns true but would continue from its loop filling the AudioDeviceNames vector, leading to a smaller output than the later code expects.
Bug: b/144382120
Change-Id: Iab008c28f03023c830011d229b1f1c7e3e7bb5ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160226
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29871}
ADM2 for Windows is based on the CoreAudioUtil class in Chrome.
CoreAudioUtil in Chrome does not use a special string to identify
the Default Communication device but instead a combination of a
string (Default) and a role parameter [1].
When CoreAudioUtil was ported to WebRTC, I accidentally added an
invalid usage of a unique string to identify the default comm device
and it can lead to errors since there are then two different ways to
identify this device. It will also complicate life when we want to
merge changes from Chrome into WebRTC.
This CL removes usage of AudioDeviceName::kDefaultCommunicationsDeviceId
in WebRTC to reduce the risk of errors.
[1] https://cs.chromium.org/chromium/src/media/audio/win/core_audio_util_win.cc?q=core_audio_ut&sq=package:chromium&g=0&l=464
Excluding flaky bot win_x86_msvc_dbg and using Tbr.
Tbr: thaloun@chromium.org
No-Try: True
Bug: webrtc:11107
Change-Id: Ie6687adbe9c3940a217456e4025967f71d86214c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160047
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29848}
It's possible for an device to be counted but getting its name fails, in which case the utility function returns true but would continue from its loop filling the AudioDeviceNames vector, leading to a smaller output than the later code expects.
No-Try: True
Bug: b/144729866
Change-Id: If902cada4ef2911bc24fbec0f169da75ff6e6a83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160020
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29840}
New tests are:
- AudioDeviceTest.StartStopPlayoutWithRealDevice
- AudioDeviceTest.StartStopRecordingWithRealDevice
(the comments below only affects ADM2 on Windows):
When adding these tests it was found that we could hit the same known issue
as in https://bugs.chromium.org/p/chromium/issues/detail?id=803056 and the
same solution as in Chrome was therefore ported from Chrome to WebRTC.
Hence, this change also adds support for core_audio_utility::WaveFormatWrapper
to support devices that can return a format where only the WAVEFORMATEX parts is
initialized. The old version would only DCHECK for these devices and that could
lead to an unpredictable behavior.
Tbr: minyue
Bug: webrtc:11093
Change-Id: Icb238c5475100f251ce4e55e39a03653da04dbda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159982
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29824}
LogMessage::streams_ is a global and thus should have trivial destructor
Bug: None
Change-Id: Ie6a8029602f50b2bc5bab546ffc0365ef0954024
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157042
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29552}
Since rtc_base/ignore_wundef.h doesn't have any dependency, it is easy to
move it to its own target and allow its dependant to avoid to take a
dependency rtc_base:on rtc_base_approved.
Bug: webrtc:9419
Change-Id: I17f205b0cb2b21cad388b04e60082df9398dffdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157428
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29548}
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).
Source sets always pass all the object files to the linker.
On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.
See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set
Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
Both the tests and the code under test are very old, unstaffed and not
a part of webRTC stack.
Here sanitizers make the tests hang, without providing useful report.
So we are just disabling them, without intention to re-enable them.
Bug: webrtc:10951
Change-Id: I40e97208606ba3f0eb5b19d404f7d038e6cc2bdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152487
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29157}
Some of the macros in format_macros.h follow the C standard and try to fill holes in it (on Windows). But this one has no direct equivalent in the standard and is just mimicking the naming convention. That's not nice.
References:
https://devblogs.microsoft.com/cppblog/c99-library-support-in-visual-studio-2013/https://stackoverflow.com/a/2524673
Change-Id: I53f3faca2976a5b5d4b04a67ffb56ae0f4e930b2
Bug: webrtc:10852
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147862
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28794}
Some of the constants and structure definitions used are only available with
specific and recent versions of the windows SDK. This change allows this
to build with a toolchain targeting WINVER 0x0601 (Windows 7)
Bug: None
Change-Id: I3339f7c44c375fb7d583b78aa137f748c9776a07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147440
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Paul Roberts <pacaro@google.com>
Cr-Commit-Position: refs/heads/master@{#28730}
The code was doing nothing except for triggering thread sanitizer,
since concurrent writes weren't guarded:
* ReadRecordedData() through webrtc_audio_module_rec_thread
* InitPlayout() through main thread
Bug: webrtc:9751
Change-Id: I7ecf4fa436ff0695e5b998d7e3f159fb6c7e9214
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146216
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28636}
Lifetime issue: "webrtc_audio_module_rec_thread" was still accessing
AudioTransport mock at and after its destruction.
Bug: webrtc:9751
Change-Id: I24308077cdeb77e570b8ec74098f1ae3397b7155
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146217
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28635}
Rationale:
* More explicit (you won't miss that when glancing at the code).
* More consistent (see MAYBE_* in other tests).
* Allow to re-activate tests via CLI (--gtest_also_run_disabled_tests).
* Tests won't wrongly show up as PASSING (bug/webrtc:10819),
since they won't show up at all.
Bug: webrtc:9778
Change-Id: Ic32e18cb8ee2352def95206c2aa66e1dea0cc1e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146200
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28617}
Landing with TBR given vacation times and the fact that none of this
code is active "in production". The ADM2 implementation can be seen
as experimental (non-default) code and it takes some work to enable it
and replace the existing ADM. Hence, extremely low risk to break
anything.
TBR: henrik.lundin
Bug: webrtc:9265
Change-Id: Ibc9a57f4851bf4b890b77b9eaef1dfbe3ca86f83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146084
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28601}
Landing with TBR given vacation times and the fact that none of this
code is active "in production". The ADM2 implementation can be seen
as experimental (non-default) code and it takes some work to enable it
and replace the existing ADM. Hence, extremely low risk to break
anything.
TBR: henrik.lundin
Bug: webrtc:9265
Change-Id: Ia5cfb2aaa8eaf9537b916b3375f55d8df6287071
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145921
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28600}
Marking test as skipped is more honest than pretending it is successful!
Prevent confusion like in the following scenario for one given test:
- ubsan: launched and sometimes failing.
- tsan: never launched but always flagged OK.
Bug: webrtc:9778
Change-Id: Ie0be0759347eabd3c9d29dd5ea2de809511d1b97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145980
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@google.com>
Cr-Commit-Position: refs/heads/master@{#28597}