136 Commits

Author SHA1 Message Date
Sami Kalliomaki
d3235f0cd9 Re-order and remove unused Java imports.
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/2203723002 .

Cr-Commit-Position: refs/heads/master@{#13608}
2016-08-02 13:44:19 +00:00
henrika
c62ff86023 Adds periodic volume-level logging for Android.
The goal of this change is to log the volume level for the
current audio stream so we can keep track of what volume the
user selects during a call.

BUG=b/30376577
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/2182043005 .

Cr-Commit-Position: refs/heads/master@{#13555}
2016-07-28 13:46:32 +00:00
Max Morin
2c332bb682 Simplify logging statements.
BUG=NONE
R=henrika@webrtc.org

Review URL: https://codereview.webrtc.org/2115603004 .

Cr-Commit-Position: refs/heads/master@{#13375}
2016-07-04 07:03:54 +00:00
Max Morin
84cab205f5 UMA log for audio_device Init and Start(Playout|Recording). Make Init return a more specific error code, if possible.
BUG=webrtc:5761
R=asapersson@webrtc.org, henrika@webrtc.org

Review URL: https://codereview.webrtc.org/2103863004 .

Cr-Commit-Position: refs/heads/master@{#13361}
2016-07-01 11:35:31 +00:00
Max Morin
098e6c5d0a Logging and tracing of audio devices on Andriod.
Replaced invokations of WEBRTC_TRACE with LOG, which is
visible in the android system log.

BUG=NONE
R=henrika@webrtc.org

Review URL: https://codereview.webrtc.org/2091803002 .

Cr-Commit-Position: refs/heads/master@{#13308}
2016-06-28 07:36:39 +00:00
skvlad
880ffeb6c0 Optimize the repeated calls to AudioEffect.queryEffects() on Android
This CL eliminates repeated calls to AudioEffect.queryEffects() on Android when configuring the audio device. Each of these calls was taking 5-10 milliseconds on the devices I was testing (Nexus 4, Nexus 5), and setting up the audio device involved around 10 of these calls.

This change adds a method that checks the cached list of effects before calling the underlying operating system API; this eliminated about half of these calls. The other half happened inside static methods such as NoiseSuppressor.isAvailable(), which are just convenience wrappers for searching through the list of effects. These calls have been replaced with searching through the cached list of effects, reducing the time to configure audio processing effects from 60-80 ms to 5-10. This results in a similar improvement in call setup time.

BUG=

Review-Url: https://codereview.webrtc.org/2051323002
Cr-Commit-Position: refs/heads/master@{#13115}
2016-06-13 19:05:30 +00:00
Alex Glaznev
c88f558135 Fix Android audio playback mute.
TBR=henrika@webrtc.org

BUG=b/29066336

Review URL: https://codereview.webrtc.org/2040653002 .

Cr-Commit-Position: refs/heads/master@{#13051}
2016-06-06 17:33:55 +00:00
Alex Glaznev
080be51294 Make WebRTCAudioTrack class public.
To access its public API.

TBR=henrika@webrtc.org

Review URL: https://codereview.webrtc.org/2042523002 .

Cr-Commit-Position: refs/heads/master@{#13044}
2016-06-03 22:33:39 +00:00
henrika
b50e84509f Adds WebRtcAudioTrack.setSpeakerMute() API
BUG=NONE

Review-Url: https://codereview.webrtc.org/2025423003
Cr-Commit-Position: refs/heads/master@{#13029}
2016-06-03 09:56:26 +00:00
henrika
521f7a8db7 Moves ownership of OpenSL engine object to Android audio manager with the goal of adding support for OpenSL ES based audio capture.
BUG=webrtc:5925

Review-Url: https://codereview.webrtc.org/2019223004
Cr-Commit-Position: refs/heads/master@{#12975}
2016-05-31 14:03:26 +00:00
henrika
1f0ad1085d Adds support for detection of pro-audio support on Android.
A new API is added which enables detection of support of pro-audio on
Android. This is part of a larger change and the new API is not used yet.
Most likely it will only be used for logging purposes.

BUG=webrtc:5925

Review-Url: https://codereview.webrtc.org/2015483002
Cr-Commit-Position: refs/heads/master@{#12890}
2016-05-25 12:15:19 +00:00
sakal
c00687ff5d Add an option to disable built-in AEC to AppRTC Android Demo
BUG=webrtc:5923

Review-Url: https://codereview.webrtc.org/2002093002
Cr-Commit-Position: refs/heads/master@{#12885}
2016-05-25 07:09:50 +00:00
Peter Boström
4adbbcfe7a Move ADM Create() method to public interface.
ADMs were previously created by CreateAudioDeviceModule which was
removed in previous refactoring without a replacement added.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1944883002 .

Cr-Commit-Position: refs/heads/master@{#12613}
2016-05-03 19:51:31 +00:00
henrika
7d4a6c3208 Adds timeout for audio record thread in Java layer
BUG=b/28448866
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1933123002 .

Cr-Commit-Position: refs/heads/master@{#12590}
2016-05-02 09:01:02 +00:00
kwiberg
1c7fdd86eb Remove calls to ScopedToUnique and UniqueToScoped
They're just no-ops now, and will soon go away.

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1914153002

Cr-Commit-Position: refs/heads/master@{#12510}
2016-04-26 15:18:13 +00:00
henrika
9d7e8dd44e Adds Moto G 3rd Generation to HW AEC blacklist
BUG=b/27447146

Review URL: https://codereview.webrtc.org/1866943002

Cr-Commit-Position: refs/heads/master@{#12278}
2016-04-07 11:56:08 +00:00
henrika
ef38b564ea Improves error handling for playout initialization on Android.
We no longer crash when initialization fails.

BUG=

Review URL: https://codereview.webrtc.org/1858213002

Cr-Commit-Position: refs/heads/master@{#12241}
2016-04-05 14:20:35 +00:00
Alex Glaznev
4aee2a928f Add android specific audio mute function.
R=henrika@webrtc.org

Review URL: https://codereview.webrtc.org/1759503002 .

Cr-Commit-Position: refs/heads/master@{#11849}
2016-03-02 21:02:11 +00:00
kwiberg
f01633e667 Replace scoped_ptr with unique_ptr in webrtc/modules/audio_device/
BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1722083002

Cr-Commit-Position: refs/heads/master@{#11740}
2016-02-24 13:00:45 +00:00
henrika
e78765bd4b Removes Nexus 5 from AEC and NS blacklists
BUG=b/27086464
R=tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1695713002 .

Cr-Commit-Position: refs/heads/master@{#11605}
2016-02-12 15:33:44 +00:00
Peter Kasting
6955870806 Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.

BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1316523002 .

Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-13 00:26:55 +00:00
kwiberg
0eb15ed7b8 Don't call the Pass methods of rtc::Buffer, rtc::scoped_ptr, and rtc::ScopedVector
We can now use std::move instead!

This CL leaves the Pass methods in place; a follow-up CL will add deprecation annotations to them.

Review URL: https://codereview.webrtc.org/1460043002

Cr-Commit-Position: refs/heads/master@{#11064}
2015-12-17 11:04:24 +00:00
Henrik Kjellander
c03bdf9ae9 Roll chromium_revision aa8e58a..664fe1e (361601:361806)
webrtc/modules/audio_device/android/ensure_initialized.cc needed to
be updated due to https://codereview.chromium.org/1407233017

Change log: aa8e58a..664fe1e
Full diff: aa8e58a..664fe1e

No dependencies changed.
No update to Clang.

NOTRY=True
CQ_EXTRA_TRYBOTS=tryserver.webrtc:win_baremetal,mac_baremetal,linux_baremetal
R=henrika@webrtc.org

Review URL: https://codereview.webrtc.org/1482443003 .

Cr-Commit-Position: refs/heads/master@{#10798}
2015-11-26 10:12:34 +00:00
henrika
76a31ca3d4 Avoids hitting DCHECK in OpenSL ES player
TBR=glaznev
BUG=NONE

Review URL: https://codereview.webrtc.org/1467433002 .

Cr-Commit-Position: refs/heads/master@{#10727}
2015-11-20 12:40:58 +00:00
henrika
b6755ab6df Revert of Adding thread timeout for audio recorer thread in Java (patchset #2 id:20001 of https://codereview.webrtc.org/1444313002/ )
Reason for revert:
Reverting since this fix might hide real issue and the reported root problem seems extremely rare.

Original issue's description:
> Adding thread timeout for audio recorer thread in Java
>
> BUG=NONE
>
> Committed: https://crrev.com/fd614c2149c7985bd83df809df71d0d60e5a8f74
> Cr-Commit-Position: refs/heads/master@{#10671}

TBR=magjed@webrtc.org,tommi@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=NONE

Review URL: https://codereview.webrtc.org/1459123002

Cr-Commit-Position: refs/heads/master@{#10707}
2015-11-19 10:43:19 +00:00
henrika
5c489c9d3e Add OpenSL ES enable setting to AppRTCDemo (part 2).
It is now possible to enable OpenSL ES on devices that supports it.

Fix for https://codereview.webrtc.org/1449083002/

Review URL: https://codereview.webrtc.org/1455563002

Cr-Commit-Position: refs/heads/master@{#10678}
2015-11-17 18:12:46 +00:00
henrika
fd614c2149 Adding thread timeout for audio recorer thread in Java
BUG=NONE

Review URL: https://codereview.webrtc.org/1444313002

Cr-Commit-Position: refs/heads/master@{#10671}
2015-11-17 12:28:33 +00:00
Patrik Höglund
68876f990e Introduces Android API level linting, fixes all current API lint errors.
This CL attempts to annotate accesses on >16 API levels using as
small scopes as possible. The TargetApi notations mean "yes, I know
I'm accessing a higher API and I take responsibility for gating the
call on Android API level". The Encoder/Decoder classes are annotated
on the whole class, but they're only accessed through JNI; we should
annotate on method level otherwise and preferably on private methods.

This patch also fixes some compiler-level deprecation warnings (i.e.
-Xlint:deprecation), but probably not all of them.

BUG=webrtc:5063
R=henrika@webrtc.org, kjellander@webrtc.org, magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1412673008 .

Cr-Commit-Position: refs/heads/master@{#10624}
2015-11-12 16:37:01 +00:00
henrika
e71b24e421 OpenSL ES stability improvements.
This CL does two things:

1) Improves stability in the existing OpenSL ES implementation for devices that
supports OpenSL ES. The cost is a slight increase in latency since the focus here
has been on avoiding audio glitches.

2) Adds a new Java API to exclude usage of OpenSL ES to enable comparisons between
OpenSL ES and Java based audio backends.

BUG=b/22452539

Review URL: https://codereview.webrtc.org/1440623002

Cr-Commit-Position: refs/heads/master@{#10618}
2015-11-12 09:48:36 +00:00
henrika
d6b9d3353d Moves logging of audio effects to when they are enabled
BUG=none
TBR=magjed

Review URL: https://codereview.webrtc.org/1411783011 .

Cr-Commit-Position: refs/heads/master@{#10516}
2015-11-05 11:44:40 +00:00
Henrik Kjellander
ff761fba82 modules: more interface -> include renames
This changes the following module directories:
* webrtc/modules/audio_conference_mixer/interface
* webrtc/modules/interface
* webrtc/modules/media_file/interface
* webrtc/modules/rtp_rtcp/interface
* webrtc/modules/utility/interface

To avoid breaking downstream, I followed this recipe:
1. Copy the interface dir to a new sibling directory: include
2. Update the header guards in the include directory to match the style guide.
3. Update the header guards in the interface directory to match the ones in include. This is required to avoid getting redefinitions in the not-yet-updated downstream code.
4. Add a pragma warning in the header files in the interface dir. Example:
#pragma message("WARNING: webrtc/modules/interface is DEPRECATED; "
                "use webrtc/modules/include")
5. Search for all source references to webrtc/modules/interface and update them to webrtc/modules/include (*.c*,*.h,*.mm,*.S)
6. Update all GYP+GN files. This required manual inspection since many subdirectories of webrtc/modules referenced the interface dir using ../interface etc(*.gyp*,*.gn*)

BUG=5095
TESTED=Passing compile-trybots with --clobber flag:
git cl try --clobber --bot=win_compile_rel --bot=linux_compile_rel --bot=android_compile_rel --bot=mac_compile_rel --bot=ios_rel -m tryserver.webrtc

R=stefan@webrtc.org, tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1417683006 .

Cr-Commit-Position: refs/heads/master@{#10500}
2015-11-04 07:32:04 +00:00
henrika
1ba936a807 Revert of Fix for "Android audio playout doesn't support non-call media stream" (patchset #3 id:40001 of https://codereview.webrtc.org/1419693004/ )
Reason for revert:
Causes issues on some phones, e.g. Sony mobiles.
See b/25385046 for details.

Original issue's description:
> Fix for "Android audio playout doesn't support non-call media stream"
>
> BUG=webrtc:4767
> R=magjed@webrtc.org
>
> Committed: https://crrev.com/6408174cdc4040528dd87ff7e5c76be91cdbafbe
> Cr-Commit-Position: refs/heads/master@{#10435}

TBR=magjed@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4767

Review URL: https://codereview.webrtc.org/1415603008

Cr-Commit-Position: refs/heads/master@{#10492}
2015-11-03 12:28:03 +00:00
Henrik Kjellander
98f53510b2 system_wrappers: rename interface -> include
BUG=webrtc:5095
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1413333002 .

Cr-Commit-Position: refs/heads/master@{#10438}
2015-10-28 17:17:50 +00:00
henrika
6408174cdc Fix for "Android audio playout doesn't support non-call media stream"
BUG=webrtc:4767
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1419693004 .

Cr-Commit-Position: refs/heads/master@{#10435}
2015-10-28 12:06:24 +00:00
henrika
edcbd5610b Adding the OnePlus 2 device to AEC and NS blacklists.
Reports show that we see full echo from the OnePlus 2 device.
Disabling hardware effects and revert to WebRTC-based
components instead as a test to see if it helps.

R=tommi@webrtc.org
TBR=tommi
BUG=b/25096456

Review URL: https://codereview.webrtc.org/1417093002 .

Cr-Commit-Position: refs/heads/master@{#10357}
2015-10-21 11:43:57 +00:00
phoglund
c671139ef2 Removing M API call for now to green up downstream.
BUG=None

Review URL: https://codereview.webrtc.org/1392903005

Cr-Commit-Position: refs/heads/master@{#10219}
2015-10-08 13:33:56 +00:00
Henrik Kjellander
9359b5b978 Disabling AudioDeviceTest.StartStopPlayout on Android.
BUG=5046
TBR=henrika@webrtc.org

Review URL: https://codereview.webrtc.org/1374963003 .

Cr-Commit-Position: refs/heads/master@{#10178}
2015-10-06 07:13:45 +00:00
henrika
95cd8ea31a Enable HW NS for N6 to fix HW AEC issue
TBR=magjed
BUG=b/24595150

Review URL: https://codereview.webrtc.org/1370413003 .

Cr-Commit-Position: refs/heads/master@{#10167}
2015-10-05 11:59:01 +00:00
henrika
d417523194 Minor fix for debug logging on Android
BUG=NONE

Review URL: https://codereview.webrtc.org/1372873002

Cr-Commit-Position: refs/heads/master@{#10088}
2015-09-28 11:50:18 +00:00
henrika
69984f0533 Fixes logging levels in WebRtcAudioXXX.java classes
BUG=NONE
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1363673005 .

Cr-Commit-Position: refs/heads/master@{#10082}
2015-09-28 07:24:16 +00:00
henrika
a323fd66de Removes Nexus 6 from OpenSL ES blacklist.
BUG=b/1370703002
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1370703002 .

Cr-Commit-Position: refs/heads/master@{#10077}
2015-09-25 14:25:40 +00:00
henrika
82e20554cb Modifies invalid DCHECK in AudioRecordJni::OnCacheDirectBufferAddress()
Ensures that we can restart audio recording on Android without hitting
a DCHECK. Also adds a symmetric design for the playout side.

BUG=webrtc:5000
TEST=modules_unittests --gtest_filter=AudioDevice*

Review URL: https://codereview.webrtc.org/1373443003

Cr-Commit-Position: refs/heads/master@{#10072}
2015-09-25 11:26:19 +00:00
henrika
8a88dd271e Stability improvement for audio recording on Android
BUG=NONE
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1363323002 .

Cr-Commit-Position: refs/heads/master@{#10056}
2015-09-24 14:45:14 +00:00
henrika
9236bb1e08 Minor fix for improving logging of supported platform effects
BUG=NONE
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1370443003 .

Cr-Commit-Position: refs/heads/master@{#10053}
2015-09-24 13:58:46 +00:00
henrika
c14f5ff60f Improving support for Android Audio Effects in WebRTC.
Now also supports AGC and NS effects and adds the possibility
to override default settings.

R=magjed@webrtc.org, pbos@webrtc.org, sophiechang@chromium.org
TBR=perkj
BUG=NONE

Review URL: https://codereview.webrtc.org/1344563002 .

Cr-Commit-Position: refs/heads/master@{#10030}
2015-09-23 12:09:40 +00:00
henrika
48c46dbad2 Reduces default sample rate from 44.1kHz to 16kHz to ensure
that we can open up audio in communication mode also on older
devices that only supports it in combination with 16kHz.

BUG=webrtc:4756
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1347243003 .

Cr-Commit-Position: refs/heads/master@{#9971}
2015-09-17 14:00:05 +00:00
henrikg
91d6edef35 Add RTC_ prefix to (D)CHECKs and related macros.
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.

Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.

BUG=chromium:468375
NOTRY=true

Review URL: https://codereview.webrtc.org/1335923002

Cr-Commit-Position: refs/heads/master@{#9964}
2015-09-17 07:24:51 +00:00
Jiayang Liu
7754285f7c Log to the webrtc log stream from webrtc/modules java code.
The purpose is to gather all webrtc logging in a single place and allow the app to redirect all webrtc logging to a single stream for offline debugging.

Moved Logging.java to webrtc/base to be shared by talk/ and modules/.

R=glaznev@webrtc.org, henrika@webrtc.org, magjed@webrtc.org, tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1335103004 .

Cr-Commit-Position: refs/heads/master@{#9959}
2015-09-16 23:20:48 +00:00
henrika
4ed3658b78 Avoids crashes in Java-based InitRecording().
This CL ensures that we return -1 in cases where InitRecording() fails. It ensures that we don't crash applications.

BUG=b/22849644
R=magjed@webrtc.org

Review URL: https://codereview.webrtc.org/1323243012 .

Cr-Commit-Position: refs/heads/master@{#9918}
2015-09-10 13:18:33 +00:00
henrika
86d907cffd Refactor the AudioDevice for iOS and improve the performance and stability
This CL contains major modifications of the audio output parts for WebRTC on iOS:
- general code cleanup
- improves thread handling (added thread checks, remove critical section, atomic ops etc.)
- reduces loopback latency of iPhone 6 from ~90ms to ~60ms ;-)
- improves selection of audio parameters on iOS
- reduces complexity by removing complex and redundant delay estimates
- now instead uses fixed delay estimates if for some reason the SW EAC must be used
- adds AudioFineBuffer to compensate for differences in native output buffer size and
  the 10ms size used by WebRTC. Same class as is used today on Android and we have unit tests for
  this class (the old code was buggy and we have several issue reports of crashes related to it)

Similar improvements will be done for the recording sid as well in a separate CL.
I will also add support for 48kHz in an upcoming CL since that will improve Opus performance.

BUG=webrtc:4796,webrtc:4817,webrtc:4954, webrtc:4212
TEST=AppRTC demo and iOS modules_unittests using --gtest_filter=AudioDevice*
R=pbos@webrtc.org, tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1254883002 .

Cr-Commit-Position: refs/heads/master@{#9875}
2015-09-07 14:10:10 +00:00