63 Commits

Author SHA1 Message Date
Glenn Kasten
845b4712f0 Use audio_channel_mask_t more consistently
In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(),
input parameter is channel mask instead of channel count.

Change-Id: I22a1c492113f3e689173c5ab97b2567cff3abe2b
2012-07-03 08:40:46 -07:00
Chia-chi Yeh
e66950506c RTP: refactor a little bit and fix few minor bugs.
Change-Id: I063644507f26996ded462972afcb550a4528dac8
2012-03-30 13:32:16 -07:00
James Dong
ba4d043331 frameworks base Android.mk file changes
Change-Id: I7459b9e959a60751b8fa6e0d893cb2c820c064ce
2012-03-28 11:03:25 -07:00
Glenn Kasten
32d72b2f53 Merge "Whitespace" 2012-03-21 07:22:40 -07:00
Glenn Kasten
f743e1f6ab Whitespace
Fix indentation, and add blank lines in key places for clarity

Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
2012-03-19 17:53:33 -07:00
Glenn Kasten
ae75f994cc Add libmedia_native
Change-Id: Ib8cff8abd73723b793f08da99ad59549f219e0e7
2012-03-16 11:51:30 -07:00
Glenn Kasten
4e42c5f41f Remove dependency on audio_* location
Change-Id: I4bc66115fcb9ba22b057bd72db3f561dcb18a0d8
2012-03-14 16:44:34 -07:00
Glenn Kasten
597f8282ee Fix build warnings
Change-Id: I543e730aff2d03c18c26b116c9fe9419259808af
2012-01-17 11:57:27 -08:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Steve Block
71f2cf116a Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2011-10-26 09:57:54 +01:00
Chia-chi Yeh
6d8b9b84ac Merge "RTP: Update parameters for larger packet intervals." 2011-09-13 21:21:18 -07:00
Chia-chi Yeh
be57bfe853 RTP: Update parameters for larger packet intervals.
Also remove some duplicated code.

Change-Id: I64576e5442a962eb4b0dfa83b52a8127567ba597
2011-09-09 16:08:12 -07:00
Chia-chi Yeh
81a5ec5b94 Merge "RTP: support payloads with larger packetization interval." 2011-09-08 14:07:00 -07:00
Chia-chi Yeh
35d05dcba1 RTP: support payloads with larger packetization interval.
RFC 3551 section 4.2 said that a receiver should accept packets
representing between 0 and 200ms of audio data. Now we add the
ability to decode multiple frames in a payload as long as the
jitter buffer is not full. This change covers G711, GSM, and
GSM-EFR. AMR will be added later.

Bug: 3029736
Change-Id: Ifd194596766d14f02177925c58432cd620e44dd7
2011-09-06 14:34:44 -07:00
Eric Laurent
74e0a990ae VoIP JNI: Force AEC on for tuna board
Force AEC on for tuna board because of the strong feedback
of Rx audio path, even when playing over earpiece or headset.

Change-Id: I9c14257d56103ba82d6cdb0b7d5a3f315638136e
2011-09-02 12:10:45 -07:00
Eric Laurent
5fb3ba60af Issue 3370834: No Echo canceler for SIP
Added detection of platfrom AEC in AudioGroup. If an AEC
is present, the SIP stack will use it, otherwise the echo suppressor
of the stack will be used.

Change-Id: I4aa45a8868466120f5f9fae71b491fe4ae1162c2
2011-07-27 09:33:22 -07:00
Dima Zavin
34bb419e59 update for new audio.h header location
Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
2011-05-12 14:09:57 -07:00
Andreas Huber
4b3913a3e4 Squashed commit of the following:
commit c80992e419ed567abef451042f09c4958534b90d
Author: Andreas Huber <andih@google.com>
Date:   Wed May 11 14:00:07 2011 -0700

    Support for the mp3 audio decoder as a software OMX component.

    Change-Id: I66e10c4d0be4c3aecdef1c21b15a2c7359ceb807

commit a358d0e1bf2a88897887445f42ccdda0f5f2f528
Author: Andreas Huber <andih@google.com>
Date:   Wed May 11 13:11:23 2011 -0700

    Support for G.711 alaw and mulaw decoders as software OMX components

    Change-Id: Ia5c76c02cb83a9f94ce39a27b2251e5880218f03

commit 79088b9c9a5c8b8c97ea66cb4f90a2b0f0d34553
Author: Andreas Huber <andih@google.com>
Date:   Thu May 5 15:43:32 2011 -0700

    Instead of using an RGB surface and conversion yuv420->rgb565

    convert from OMX_COLOR_FormatYUV420Planar to HAL_PIXEL_FORMAT_YV12 instead.

    Change-Id: I8c4fc3c54c963f0d4ba6377f3c4ab4e0013152e5
    related-to-bug: 4394005

commit 69469d3bd84425777b11b9fc938c5e0c61af26a7
Author: Andreas Huber <andih@google.com>
Date:   Tue May 10 15:46:42 2011 -0700

    voip mustn't link against libstagefright.so

    Change-Id: I4d0ba9a8b9dc9380b792a1bd04bcda231964862c

commit 2a9a9eeeeeb36ae3a9e680469c3016d509ff08c3
Author: Andreas Huber <andih@google.com>
Date:   Tue May 10 14:37:10 2011 -0700

    Remove most non-OMX software decoders by default

    Change-Id: Ic56514bc1b56b8fa952e8c4a164ea7379ecb69d0

commit a4de62c37b335c318217765403a9fb282b20a216
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 16:50:02 2011 -0700

    Conditionally build the old-style software decoders.

    Change-Id: I5de609e1d76c92d26d6eb81d1551462258f3f15f

commit 5d8b039f9449dc3dad1e77c42c80cc0b54b0c846
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 16:13:12 2011 -0700

    Support for MPEG4 and H.263 video decoders as soft OMX components.

    Change-Id: I5e3a4835afab89f98e3aa128d013628f5830eafe

commit b25a1bfbeb0ff6e62e1cc694ce2599c91489c7d0
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 11:49:10 2011 -0700

    Boost Soft OMX thread priority, fix timestamp handling in vorbis Soft OMX decoder.

    Change-Id: I68d26d4999f06fcc451d69e5303663fab0cba9e8

commit c0574362f8dc3319ce84d981097867062a698527
Author: Andreas Huber <andih@google.com>
Date:   Mon May 9 11:28:53 2011 -0700

    Support for the AMR decoders (NB and WB) as Soft OMX components.

    Change-Id: Ia565f59833fb52653e23f26536e7e41fc329a754

commit 3e5575a8f0e27a490cb7bde77bd9456087837f08
Author: Andreas Huber <andih@google.com>
Date:   Wed May 4 13:41:25 2011 -0700

    Signal an error if the aac decoder failed to initialize from codec specific data.

    Change-Id: I01da7831bdf722edd7d6dc5974486daa2cf2b209
    related-to-bug: 4272179

commit f94aeaa9886e772ff4823e671ed237096649f4af
Author: Andreas Huber <andih@google.com>
Date:   Tue May 3 13:07:38 2011 -0700

    Software OMX nodes don't (yet?) support native_window mode.

    Change-Id: I7d9ca9164ef4abf66b573ca21dba12d672f8b12d

commit eefdfabac8dc659e00daa56da69aea705c49cb67
Author: Andreas Huber <andih@google.com>
Date:   Tue May 3 12:57:16 2011 -0700

    Fixing the OMX tests to refer to appropriate files from test content.

    Change-Id: I5b61c3498749bfb876abbd3946a5132356e3f6ff

commit f31b7326aef14b6a1b7946520a9688f092e844d5
Author: Andreas Huber <andih@google.com>
Date:   Tue May 3 11:08:38 2011 -0700

    Soft OMX components are now dynamiclly loaded/unloaded, not directly linked against.

    Change-Id: I1e2ecfbfab67a8869886f738eaf0c7b3c948b6d9

commit b7f0343879e4df06f0a1c9bfece24df557954e2f
Author: Andreas Huber <andih@google.com>
Date:   Mon May 2 15:58:36 2011 -0700

    Support for the AVC software decoder as an OMX component.

    Change-Id: I13c12df435ba4afbd968a9fc659f66b91c818bc2

commit 5bb9e616d6c8e1b13d531fe996b9a9affdfb2977
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 12:05:37 2011 -0700

    Fix Vorbis OMX decoder's component role.

    Change-Id: I5e871e5e11b3f951c93590210e63fd7987c467b5

commit 089c91f2333062e196c7afd5fb0ca914878aa474
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 12:05:18 2011 -0700

    Support vorbis_decoder OMX testing.

    Change-Id: I1985be178a12ae3f8768bc72067d9236238be170

commit 56e241fa36fc37219bc536b823bdc2ab82dc1fad
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 12:01:46 2011 -0700

    SoftVorbis OMX component now respects the number of valid frames per page.

    Change-Id: I82a117a064d9b083fc58a54ad900a987a763ef03

commit fcd618ec520c376fdb78f4cbb44b8d9f5d213e2b
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 10:59:38 2011 -0700

    Support for the vorbis audio decoder as a soft OMX component.

    Change-Id: Iaeb057e58ca306d3dce205c0445b74d5aefef492

commit d1fcc3203fc8003ad79c6e96b3a1fc4261743f16
Author: Andreas Huber <andih@google.com>
Date:   Fri Apr 29 10:07:50 2011 -0700

    VPX decoder now properly resizes buffers after a port settings change.

    Change-Id: I110749a31b6cba087891d8e5dfe420830bdbf831

commit 35c7168243cb69849d88911144a2c7fdfed5c54e
Author: Andreas Huber <andih@google.com>
Date:   Thu Apr 28 13:23:34 2011 -0700

    Support for the VPX video decoder as a Software OMX component.

    Change-Id: Ic345add2d6d768d4af631160153f2e9b97fcea71

commit 923b2534b4211fc5405377b5190bfa6f2dd27f32
Author: Andreas Huber <andih@google.com>
Date:   Thu Apr 28 11:34:40 2011 -0700

    Table-based registration of soft omx components.

    Change-Id: I7f45f0fa5b3a7950776e69c66349731f7674e937

commit 04a88f3edb2266a463da9c4481b80178be460902
Author: Andreas Huber <andih@google.com>
Date:   Thu Apr 28 11:22:31 2011 -0700

    Apparently OMX_GetParameter is valid in any state other than OMX_StateInvalid

    OMX_SetParameter is still constrained to OMX_StateLoaded or a disabled port.

    Change-Id: I1032d7cf4011982d306aa369d4158a82830d26fb

commit 9d70ca68445e7c40f5c9b2d12466e468f514de88
Author: Andreas Huber <andih@google.com>
Date:   Wed Apr 27 15:03:18 2011 -0700

    Use the new soft OMX aac decoder for HTTP live playback.

    Change-Id: Ifbcfb732a9edb855cb46b49f6d0ac942170ee28f

commit 213fe4a10ea93cce08e8622dc3908053f29878a1
Author: Andreas Huber <andih@google.com>
Date:   Tue Apr 12 16:39:45 2011 -0700

    Foundation for supporting software decoders as OMX components

    Change-Id: I7fdab256563b35d1d090617abaea9a26b198d816

Change-Id: I83e9236beed4af985d10333c203f065df9e09a42
2011-05-11 14:24:58 -07:00
Dima Zavin
24fc2fb1c5 audio/media: convert to using the audio HAL and new audio defs
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-27 13:10:10 -07:00
Eric Laurent
d8cbd16659 am 7a492a9a: am b7a76e84: am a482d83c: Merge "Issue 4157048: mic gain for VoIP/SIP calls." into gingerbread
* commit '7a492a9ad42947a3a7b777b0eb6eec56f5bb942b':
  Issue 4157048: mic gain for VoIP/SIP calls.
2011-04-05 10:27:06 -07:00
Eric Laurent
7a492a9ad4 am b7a76e84: am a482d83c: Merge "Issue 4157048: mic gain for VoIP/SIP calls." into gingerbread
* commit 'b7a76e84fde7fe534d46aaaa71e3224798354009':
  Issue 4157048: mic gain for VoIP/SIP calls.
2011-04-04 17:44:50 -07:00
Eric Laurent
d7a724e6d8 Issue 4157048: mic gain for VoIP/SIP calls.
Herring board exhibits a strong echo even in non speakerphone modes.
To compensate the lack of AEC or AES when not in speakerphone, the mic gain
had been reduced in the ADC. But this has an adverse effect on other VoIP applications
that have their own AEC and are penalized by the weak mic gain.

This workaround enables an acceptable mic gain for other VoIP apps while offering a
SIP call experience which is not worse than it was with the residual echo that was
present even with mic gain reduction.

Change-Id: I33fd37858758e94e42ef5b545d3f0dc233220bf1
2011-03-29 18:44:03 -07:00
Carl Shapiro
3f9e08973f Include strings.h instead of string.h for the strcasecmp prototype.
Change-Id: I6b0ddc2408c30851edcffb36f1bc74245403ffc7
2011-03-21 20:21:40 -07:00
Iliyan Malchev
3070af0882 frameworks/base: remove LOCAL_PRELINK_MODULE
Change-Id: I54dd62ebef47e7690afa5a858f3cad941b135481
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-03-14 14:25:59 -07:00
Jean-Michel Trivi
2ba92c71b5 do not merge bug 3370834 Cherrypick from master
Cherripick from master CL 79833, 79417, 78864, 80332, 87500

Add new audio mode and recording source for audio communications
 other than telelphony.

The audio mode MODE_IN_CALL signals the system the device a phone
 call is currently underway. There was no way for audio video
 chat or VoIP applications to signal a call is underway, but not
 using the telephony resources. This change introduces a new mode
 to address this. Changes in other parts of the system (java
 and native) are required to take this new mode into account.
The generic AudioPolicyManager is updated to not use its phone
 state variable directly, but to use two new convenience methods,
 isInCall() and isStateInCall(int) instead.

Add a recording source used to designate a recording stream for
voice communications such as VoIP.

Update the platform-independent audio policy manager to pass the
 nature of the audio recording source to the audio policy client
 interface through the AudioPolicyClientInterface::setParameters()
 method.

SIP calls should set the audio mode to MODE_IN_COMMUNICATION,
 Audio mode MODE_IN_CALL is reserved for telephony.

SIP: Enable built-in echo canceler if available.
1. Always initialize AudioRecord with VOICE_COMMUNICATION.
2. If echo canceler is available, disable our echo suppressor.

Note that this CL is intentionally not correcting the
 getAudioSourceMax() return value in MediaRecorder.java as the
 new source is hidden here.

Change-Id: Ie68cd03c50553101aa2ad838fe9459b2cf151bc8
2011-01-26 11:20:01 -08:00
Chia-chi Yeh
d87be273aa Enable built-in echo canceler if available.
1. Always initialize AudioRecord with VOICE_COMMUNICATION.
2. If echo canceler is available, disable our echo suppressor.

Change-Id: Idf18d3833189a8478c1b252ebe6ce55e923280b3
2011-01-06 17:43:24 +08:00
Chia-chi Yeh
d0da380796 am dc78e3fe: am 3cf71376: RTP: Send silence packets on idle streams for every second.
* commit 'dc78e3fe7f2ffbc810cd54e86e3a83e279d74984':
  RTP: Send silence packets on idle streams for every second.
2011-01-04 17:41:16 -08:00
Chia-chi Yeh
3cf7137642 RTP: Send silence packets on idle streams for every second.
Originally a stream does not send packets when it is receive-only or there is
nothing to mix. However, this causes some problems with certain firewalls and
proxies. A firewall might remove a port mapping when there is no outgoing
packet for a preiod of time, and a proxy might wait for incoming packets from
both sides before start forwarding. To solve these problems, we send out a
silence packet on the stream for every second. It should be good enough to
keep the stream alive with relatively low resources.

Bug: 3119690
Change-Id: Ib9c55e5dddfba28928bd9b376832b68bda24c0e4
2011-01-04 19:54:49 +08:00
Chia-chi Yeh
4c7cc83827 Merge "RTP: Prepare to unhide the APIs." 2010-11-30 19:45:47 -08:00
Chia-chi Yeh
53aa6ef70d RTP: Prepare to unhide the APIs.
Polish things a little bit.

Change-Id: I2c3cea8b34b9c858879bc722ea1f38082ba22b8d
2010-12-01 11:35:51 +08:00
Chia-chi Yeh
342a9be009 am e843dfa8: am bd399b0b: Merge "RTP: Pause echo suppressor when far-end volume is low." into gingerbread
* commit 'e843dfa8dcd0a7bfa956b75424bb5db834975a64':
  RTP: Pause echo suppressor when far-end volume is low.
2010-11-30 16:23:17 -08:00
Chia-chi Yeh
0c7d30660c RTP: Pause echo suppressor when far-end volume is low.
Bug: 3136725
Change-Id: Ieeedd2836d3028045aacac963f44285491708cc3
2010-10-27 18:15:26 +08:00
Chia-chi Yeh
39df5331c7 am 044fcd64: am 703aae06: Merge "RTP: Fix non-zero DC in EchoSuppressor caused while aggregating samples." into gingerbread
Merge commit '044fcd64fe999dca0f986dfce9cb3b5b1da77f44'

* commit '044fcd64fe999dca0f986dfce9cb3b5b1da77f44':
  RTP: Fix non-zero DC in EchoSuppressor caused while aggregating samples.
2010-10-21 16:08:47 -07:00
Chia-chi Yeh
8a68b52b98 RTP: Fix non-zero DC in EchoSuppressor caused while aggregating samples.
Rewrite using integer arithmetic to get full 32-bit precision instead
of 23-bit in single precision floating-points.

Bug: 3029745
Change-Id: If67dcc403923755f403d08bbafb41ebce26e4e8b
2010-10-22 03:47:02 +08:00
Chung-yih Wang
2473f94718 am 4b7ff734: am 4483232f: Suppress harder for echo without affecting the volume of real voice.
Merge commit '4b7ff734611666a68471c97fabb6f516efab25cd'

* commit '4b7ff734611666a68471c97fabb6f516efab25cd':
  Suppress harder for echo without affecting the volume of real voice.
2010-10-10 12:54:13 -07:00
Chung-yih Wang
7ff6f97f84 resolved conflicts for merge of 4790a2e2 to master
Change-Id: I659ccd9a51e24f217f715178a98eaf6592c258d7
2010-10-09 08:07:55 +08:00
Chung-yih Wang
4483232f57 Suppress harder for echo without affecting the volume of real voice.
Change-Id: Ia3ce98eedd487a9e879ff0a4907b8c15b5707429
2010-10-08 06:09:07 +08:00
Marco Nelissen
fd1e4ad52c Fix simulator build, part 1/n
Change-Id: If0a42ab262ee6aa6381ce95bd49baf232adb01c5
2010-10-06 12:23:02 -07:00
Chung-yih Wang
fb116fbea3 Misc fixes for sim-eng build.
Change-Id: I0c5dac1097abc924e66dab92d7d03d5051b4fd29
2010-10-06 16:46:59 +08:00
Chia-chi Yeh
a8a10096a1 RTP: Add a baseline echo suppressor.
Change-Id: I832f1f572f141fd928afe671b12d0b59f2a8e0b1
2010-10-05 02:47:00 +08:00
Chia-chi Yeh
67ecb5b90c RTP: Start AudioRecord before AudioTrack to avoid being disabled.
Change-Id: I96be89fda41d77e2cf5bfc1c2f14e2b109001b57
2010-10-01 08:20:09 +08:00
Chia-chi Yeh
21ae1ad6a6 RTP: Minor fixes with polishing.
Change-Id: I50641373989e512fb489b5017edbcfd7848fe8b9
2010-09-30 16:07:44 +08:00
Chia-chi Yeh
3520bd4313 RTP: Adjust the jitter buffer to 512ms.
Change-Id: Ia91c1aa1a03b65dbd329ea98383f370844e2b0c0
2010-09-30 13:51:26 +08:00
Chia-chi Yeh
f88fc1fa90 RTP: Enable AMR codec.
Change-Id: I49e6bdc1b67306b44173f2f346f8372a50264870
2010-09-30 08:55:12 +08:00
Chia-chi Yeh
f4ae94229d RTP: Enable GSM-EFR codec.
Change-Id: I9d84009e4557a0a82c1f9d7d543922741be97c77
2010-09-30 03:07:57 +08:00
Chia-chi Yeh
fe5298992a RTP: Revise the workaround of private addresses and fix bugs.
Change-Id: Ie654b569f47049aa452eca8d3e6d4a98ac18469c
2010-09-30 02:43:48 +08:00
Chia-chi Yeh
e006e4d2c9 Merge changes Iae1913fb,I38dbefef into gingerbread
* changes:
  RTP: Enable GSM codec.
  RTP: Refactor out G711 codecs into another file.
2010-09-28 19:40:59 -07:00