There is no point in returning an error when Free() fails. In fact it can only happen if we have a null pointer as object. There is further no place where the return value is used.
Affected components are
- aec
- aecm
- agc
- ns
BUG=441
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/50579004
Cr-Commit-Position: refs/heads/master@{#8966}
If built-in Echo Cancellation is available on a device it is automatically enabled. The reason is that it in most cases performs better than the WebRTC software echo control for mobile. The drawback is that we can not develop, test and rollout the delay agnostic AEC (DA-AEC) on Android as for desktops.
This CL includes
- adding a media constraint to enable/disable DA-AEC.
- automatically turning on echo cancellation if DA-AEC is enabled.
- a fix in the AEC that enables delay estimation when DA-AEC is enabled, but delay metrics is disabled.
- sets the Config struct ReportedDelay, which controls DA-AEC internally in the AEC.
The test code to verify that it works in AppRTCDemo can be found here:
https://webrtc-codereview.appspot.com/50479004/
BUG=4472
TESTED=locally on N7, N6, Android One
R=glaznev@webrtc.org, perkj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/48699004
Cr-Commit-Position: refs/heads/master@{#8861}
The known clients (GetStats and UMA histogram in Chrome) use at least 5 second aggregation window. There is no particular value in calculating the metrics more often.
The CL also includes a small refactoring moving a declaration inside an if statement.
BUG=2994
TEST=N/A
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/40219004
Cr-Commit-Position: refs/heads/master@{#8619}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8619 4adac7df-926f-26a2-2b94-8c16560cd09d
There exist devices with runtime checks for NEON, but where the device is not NEON. One such device is Tegra2 on which currently NEON code is running.
This fix adds a missing feature check when initializing the AEC.
BUG=4304
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/42159004
Cr-Commit-Position: refs/heads/master@{#8559}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8559 4adac7df-926f-26a2-2b94-8c16560cd09d
To more easily determine if for example the AEC is not working properly one could monitor how often the estimated delay is out of bounds. With out of bounds we mean either being negative or too large, where both cases will break the AEC.
A new delay metric is added telling the user how often poor delay values were estimated. This is measured in percentage since last time the metrics were calculated.
All APIs have been updated with a third parameter with EchoCancellation::GetDelayMetrics() giving the option to exclude the new metric not to break existing code.
The new metric has been added to audio_processing_unittests with an additional protobuf member, and reference files accordingly updated.
voe_auto_test has not been updated to display the new metric.
BUG=4246
TESTED=audioproc on files
R=aluebs@webrtc.org, andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/39739004
Cr-Commit-Position: refs/heads/master@{#8230}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8230 4adac7df-926f-26a2-2b94-8c16560cd09d
Previously, the delay estimate history was reset every time the metrics were pulled. This required all clients to be on the same thread and make use of one call.
Now we use a fixed aggregation window of one second and when a client pulls the metrics you get the latest value.
Under certain circumstances like tests you would like to have the aggregation window set to the recording length. We therefore turn on the fixed aggregation window after the first call.
BUG=2994
TESTED=locally on Mac and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38759004
Cr-Commit-Position: refs/heads/master@{#8170}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8170 4adac7df-926f-26a2-2b94-8c16560cd09d
Doing something similar for the band 16-24kHz to what is done for the band 8-16kHz. The only difference is that there is no comfort noise added in this band. Could not test how this sounds because there are no aecdumps with 48kHz sample rate as nfar as I know.
Tested for 32kHz sample rate and the output is bitexact with how it was before this CL.
BUG=webrtc:3146
R=andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/28319004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8080 4adac7df-926f-26a2-2b94-8c16560cd09d
On non-Android the delay estimator in audio_processing/aec has solely been used for logging purposes. The maximum possible observed delay has been 236 ms. We have seen longer delays for which the delay estimate at best ends up at 236 ms, but can also be 'random'. reported delays are clamped to 500 ms.
This cl extends the delay estimation window to match that.
BUG=4086, 3504, 4113
TESTED=locally on Linux and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/36569004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7989 4adac7df-926f-26a2-2b94-8c16560cd09d
These optimizations were originally committed in r6860, but reverted in r6861, since it broke a bitexactness test (ApmTest.Process) in modules_unittests. That test has now been updated in r7149, hence this CL now pass the test.
BUG=3767
TESTED=manually on linux and trybots
TBR=aluebs@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/25539004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7189 4adac7df-926f-26a2-2b94-8c16560cd09d
When writing to wav files in the low level flag aec_debug_dump incorrect sample rates were used for recordings using rates from 32 kHz and above. This since internally inside the AEC we process the data using 16 kHz. Any upper band is processed and combined later on.
This CL adds the correct sample rate to the recording.
BUG=3359
TESTED=locally on 44.1 kHz recordings on Linux
R=aluebs@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23649004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7182 4adac7df-926f-26a2-2b94-8c16560cd09d
These global arrays are shared amongst all AEC instances, and were at
serious risk of data races. A Chromium TSAN bot recently caught this.
Also move the function pointer selection for optimization to
create-time. (Ideally this would only be done once.)
BUG=chromium:404133,1503
R=bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/19069004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6922 4adac7df-926f-26a2-2b94-8c16560cd09d
audio_processing did not compile when aec_untrusted_delay_for_testing=1 was set. The constant kDelayDiffOffsetSamples was declared only for Mac when WEBRTC_UNTRUSTED_DELAY was automatically turned on.
Moving the declaration outside the ifdef makes it build with the flag on for any platform.
BUG=3673
TESTED=locally and trybots
R=andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/22049004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6866 4adac7df-926f-26a2-2b94-8c16560cd09d
With GCC 4.9, the MIPS NDK toolchain has been changed to only support 16 spregs by default - the even-numbered ones. This has been changed to support the R6 MIPS architecture. While the old behaviour could be restored by adding "-modd-spreg", this would come with a performance hit because the kernel would emulate odd-numbered spregs and missing R2 instructions.
As a result of this change, the functions removed in this CL no longer compile as there are no longer enough spregs for the compiler to assign. So we are removing these functions and they will use the C implementation until the MIPS code is rewritten.
R=andrew@webrtc.org, ljubomir.papuga@gmail.com, pasko@chromium.org
Review URL: https://webrtc-codereview.appspot.com/16159005
Patch from Fabrice de Gans-Riberi <fdegans@chromium.org>.
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6797 4adac7df-926f-26a2-2b94-8c16560cd09d
Was causing warnings in Chromium such as:
warning C4742: 'WebRtcAec_overDriveCurve' has different alignment in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 4 and 16
warning C4744: 'WebRtcAec_overDriveCurve' has different type in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 'array (260 bytes)' and '__declspec(align(16)) array (260 bytes)'
warning C4742: 'WebRtcAec_weightCurve' has different alignment in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 4 and 16
warning C4744: 'WebRtcAec_weightCurve' has different type in 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core_sse2.c' and 'E:\src\buildbot\build\slave\fake_slave\build\src\third_party\webrtc\modules\audio_processing\aec\aec_core.c': 'array (260 bytes)' and '__declspec(align(16)) array (260 bytes)'
BUG=https://code.google.com/p/chromium/issues/detail?id=336620R=andrew@webrtc.org, cd@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/15869004
Patch from Sebastien Marchand <sebmarchand@chromium.org>.
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6525 4adac7df-926f-26a2-2b94-8c16560cd09d
Several tests were disabled in r6325 and r6326. Also, see issue 3445. This CL fixes the remaining four of the audio_processing related ones. Affects the tests:
- SystemDelayTest.CorrectDelayAfterStableBufferBuildUp
- SystemDelayTest.CorrectDelayDuringDrift
- SystemDelayTest.ShouldRecoverAfterGlitch
- ApmTest.EchoCancellationReportsCorrectDelays
The tests assumes reported delays are used, which now is explicitly set.
BUG=3445
TESTED=trybots
R=aluebs@webrtc.org, kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/19769004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6489 4adac7df-926f-26a2-2b94-8c16560cd09d