History log of /frameworks/av/include/media/AudioSystem.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
baac183f3808d7b68f184647a97bd381620415fe 02-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: binder calls for dynamic audio policy mixes

Add binder calls to register and unregister dynamic mixes
to AudioPolicyManager.

Bug: 16009464.

Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
/frameworks/av/include/media/AudioSystem.h
caf7f48a0ef558689d39aafd187c1571ff4128b4 26-Nov-2014 Eric Laurent <elaurent@google.com> AudioRecord: use audio attributes instead of audio source.

Added AudioRecord constructor with audio attributes.
Replaced AudioPolicymanager::getInput() by getInputForAttr().

No new functionality for now.

Also:

- Fixed warnings in AudioPolicyManager
- Allocate audio session ID before calling getOutputForAttr() in
AudioTrack.

Bug: 16006090.
Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
/frameworks/av/include/media/AudioSystem.h
e83b55dc29ca16092ba02f36f55fa6e0e37fd78c 14-Nov-2014 Eric Laurent <elaurent@google.com> audio policy: new getOutputForAttr() prototype.

Update getOutputForAttr() prototype and group all logic
dealing with audio attributes to stream type conversion in
audio policy manager.

getOutputForAttr():
- specifies the audio session (for future use)
- returns a status code
- receives either stream type (for legacy) or audio attributes
- returns an updated streamtype

Remove logic dealing with legacy stream types to attributes conversion
from AudioTrack.

Use correct type for audio sessions in other APIs (startOutput() ...).

releaseOutput() specifies the audio session (for future use).

Bug: 18067208.

Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
/frameworks/av/include/media/AudioSystem.h
0ebd5f95b68a3a5c9e5509f21938c9e51e74d71b 20-Nov-2014 Eric Laurent <elaurent@google.com> AudioSystem: fix cross deadlock

Do not hold gLockAPS when calling
AudioPolicyService::registerClient() in get_audio_policy_service().
registerClient() will need to acquire the AudioPolicyService mutex and
if at the same time a method called from AudioPolicyService
(with mutex held) calls back into AudioSystem and get_audio_policy_service()
a cross deadlock occurs.

Same preventive fix for get_audio_flinger().

Use a separate mutex for notification client list in AudioPolicyService.
This prevents deadlocking if registerClient() is called as a consequence of
AudioFlinger calling back into AudioPolicyManager while executing a method
with AudioPolicyService locked

Bug: 18403952.
Bug: 18450065.
Change-Id: Ia832e41aede8bc6c843fc615508fbdd74e0863b5
/frameworks/av/include/media/AudioSystem.h
f6778fd0c72ab54328f0e9f5ecf0017b73e99dd8 19-Nov-2014 Eric Laurent <elaurent@google.com> AudioSystem: Add mutex for output cache

Fix cross deadlock with AudioFlinger by adding
a dedicated mutex to protect access to cached output list
and parameters.

Bug: 18410728.
Change-Id: Ia31283b1972d8865a46e84e63695173c187eb781
/frameworks/av/include/media/AudioSystem.h
0d6db582f2ccc9f8943c5f3965e2994b7d137158 13-Nov-2014 Eric Laurent <elaurent@google.com> remove AudioSystem::getOutputSamplingRateForAttr()

It is safer to query the output sampling rate once the output
have been acquired by calling getOutputForAttr().

Bug: 16009464.
Change-Id: Ib561facd19fba5359a6b837d75f1a1cd2dc51b29
/frameworks/av/include/media/AudioSystem.h
e662cd5cdbe1312d6b74754d2945fffe99e4fe2c 07-Nov-2014 Glenn Kasten <gkasten@google.com> Merge "Improve AudioTrack recovery from mediaserver death" into lmp-mr1-dev
a36060891425c4ce0621e40344ac473ec14924dd 07-Nov-2014 Eric Laurent <elaurent@google.com> AudioSystem: remove obsolete method.

Bug: 18067208.
Change-Id: I9bbf9088485f5162c765ca504d9b784b956234c6
/frameworks/av/include/media/AudioSystem.h
d2d089fc86c62843992e7d5b371ee9227189a1e6 05-Nov-2014 Glenn Kasten <gkasten@google.com> Improve AudioTrack recovery from mediaserver death

1. Fix race condition in handling of binder death notifications.

AudioSystem has a mixture of APIs for both ordinary app clients,
and the AudioFlinger and AudioPolicy services within mediaserver.
Due to this mix of uses, it is possible for there to be "surprising"
sequences of calls on the call stack.

Previously, we used a single mutex for all global variables, but
this caused a deadlock. To avoid the deadlock, we unlocked the mutex
during the critical sequence of calls. But this was a a
crucial place where it should have stayed locked;
see Change-Id I315c1c5066f62b05e1c13b04fae1272b5fbce977

Now we use separate mutexes for the AudioFlinger, AudioPolicy, and audio port
related global variables. This allows us to correctly hold each mutex
throughout the atomic region, even when AudioFlinger calls AudioPolicy
via AudioSystem, or vice-versa.

2. AudioSystem::clearAudioConfigCache now clears the IAudioFlinger reference.

3. Make AudioSystem::get_audio_policy_service more like get_audio_flinger.

Bug: 18242291
Change-Id: I9761443d8337df5bf66d4ca2316a9fd0bd11be94
/frameworks/av/include/media/AudioSystem.h
bb6c9a05840d924b502ce0f1868fca4881ada1ed 25-Sep-2014 Eric Laurent <elaurent@google.com> audio: fix stream type for accessibility usage

Make sure that accessibility prompts are heard when
a ringtone is active by forcing stream type
to AUDIO_STREAM_RING when phone state is AUDIO_MODE_RINGTONE.

Bug: 17558149.
Change-Id: Ia3bead8052fca5cbf282c267f7b9b06014fef628
/frameworks/av/include/media/AudioSystem.h
93c3d41bdb15e39dac0faea9c5b60f1637cd477c 01-Aug-2014 Eric Laurent <elaurent@google.com> AudioSystem: add API to query audio HW sync source

Add a method to query from the audio HAL the HW sync
source used for a given audio session.
Modify audio policy to select a direct output with HW sync
when requested.

Bug: 16132368.

Change-Id: I03038f9188f2d389f8a5fd76a671854013a4513e
/frameworks/av/include/media/AudioSystem.h
df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871 28-Jul-2014 Eric Laurent <elaurent@google.com> Add sound trigger control by audio policy

Audio policy:
- Added active capture indication to sound trigger service:
recognition stops if concurrent capture is not supported.
- Added generation of reserved I/O handle and session ID for
utterance capture.

Sound trigger service
- Added sound model update callback handling.
- Added service state callback
- Simplified callback shared memory allocation.

Bug: 12378680.

Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
/frameworks/av/include/media/AudioSystem.h
4dc680607181e6a76f4e91a39366c4f5dfb7b03e 29-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: pass session ID to capture activity methods

Indicate the audio session ID when calling getInput(),
startInput(), stopInput(), releaseInput().

Bug: 12378680.
Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
/frameworks/av/include/media/AudioSystem.h
de3f8392fbf380ba6f09d009b00d7172477389a2 28-Jul-2014 Eric Laurent <elaurent@google.com> rename AudioSystem::newAudioSessionId()

Rename AudioSystem::newAudioSessionId() to
AudioSystem::newAudioUniqueId() as it can be used
also for I/O handles.

Bug: 12378680.
Change-Id: I611ea3b5eb57a4b0774437f477ee87dc4ccc2cc2
/frameworks/av/include/media/AudioSystem.h
b3b1660ecb67f61f9da54efced8677fa3a6f4863 16-Jul-2014 Glenn Kasten <gkasten@google.com> Add audio_input_flags_t to IAudioPolicyService::getInput

Change-Id: I9f37be05f8dc7b85a8827a94e76ca0f45453e170
/frameworks/av/include/media/AudioSystem.h
665470b36f202bcc8ee2f7417f68fd2608dd07c1 04-Jul-2014 Eric Laurent <elaurent@google.com> audio: deprecate audio_stream_frame_size()

Bug: 15000850.
Change-Id: I955a6efa620b8f70fa5193c7853cbe88e879c9c3
/frameworks/av/include/media/AudioSystem.h
5bd3f38638acab633d181359cc9ec27b80f84d43 14-Jun-2014 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: return output for audio attributes

In AudioPolicyManager, support querying an output
or playback strategy for audio attributes,
instead of a stream type,
In AudioTrack creation, use the output returned
for the track's attributes.

Change-Id: I0fef05845ba676404775e2e338c10e6a96237268
/frameworks/av/include/media/AudioSystem.h
b7f24b101d43139b4c747129bfbc4ecf5c468b86 11-Jun-2014 Jean-Michel Trivi <jmtrivi@google.com> AudioSystem: remove unused stream type

The audio stream type is not used in the getSampleRate() and
getFrameCount() methods.

Change-Id: I3d065ae272bd039204cd323cdab9b60460034f2d
/frameworks/av/include/media/AudioSystem.h
b52c152d553556b2d227ffc943489de0c60b4b02 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: add routing update client interface

Added IAudioPolicyServiceClient client binder interface
for client process to receive notifications from AudioPolicyService
when audio ports are added/removed or audio patches created/released.

The audio patches owned by a given client are automatically released when
this client binder dies.

Bug: 14815883.

Change-Id: I6013f6aec03b50565cffb1ad2cd1f0f8852032c5
/frameworks/av/include/media/AudioSystem.h
203b1a18a806e2c56c701aac49cda963bccfad5b 01-Apr-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - IAudioPolicyService interface extension for patch panel

Change-Id: I0a62e5416edc41c3a0e816275085ab18a23066f1
/frameworks/av/include/media/AudioSystem.h
b8f8d231685afdec472136b45c527a71bfb8bcc4 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Remove stream type from AudioSystem::getRenderPosition()"
73ec11738cd4399c55d4905665a14a7c4cd42cbf 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Fix uses of KeyedVector"
8c7b9fb41585fccb06573252823b929c82a40999 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Remove streamType parameter from AudioSystem::getLatency()"
0ed19594452c901c3c8665d06610fffe46895d06 26-Mar-2014 Glenn Kasten <gkasten@google.com> Remove stream type from AudioSystem::getRenderPosition()

The I/O handle is never equal to AUDIO_IO_HANDLE_NONE,
so the stream type is not needed.

Change-Id: I1ab134a2fa379d6dd0b6167345a856a192d478f9
/frameworks/av/include/media/AudioSystem.h
241618f1b286f9e7e02fe61e96d9194e2e1e8a7a 26-Mar-2014 Glenn Kasten <gkasten@google.com> Remove streamType parameter from AudioSystem::getLatency()

Change-Id: Ie7346e93436ddc215cad7d16be555dcb6c277d54
/frameworks/av/include/media/AudioSystem.h
9ea65d0f4a564478343b1a722fae4ce5883670c3 17-Jan-2014 Glenn Kasten <gkasten@google.com> Fix uses of KeyedVector

Constructor for AudioFlinger::mAudioHwDevs was missing, and so
AudioFlinger::findSuitableHwDev_l() could return an undefined pointer
if a non-0 module wasn't found.

A KeyedVector of Plain Old Data (POD) element type must specify the
default value in the constructor, or else the default will be undefined.

Minor:
- Parameter had wrong type in constructor for AudioSystem::gOutputs.
- Remove obsolete AudioSystem::gStreamOutputMap.

Change-Id: I9841493e018440e559d8b8b0e4e748ba2b2d365b
/frameworks/av/include/media/AudioSystem.h
85d109a4b0eddd76a8c5cee170bc2bcc99d00118 17-Jan-2014 Glenn Kasten <gkasten@google.com> Document AudioSystem::newAudioSessionId() failures

Change-Id: Iaa168722f362c36bdfa87fe20dc0a59b43cf1ca3
/frameworks/av/include/media/AudioSystem.h
b42f318d9733f88c7eb9bedfd33b086b8ea5dff5 24-Feb-2014 Glenn Kasten <gkasten@google.com> Simplify and cleanup error handling in AudioRecord::getMinFrameCount

Change-Id: I8721ecedfb429c4e233453d1e768ddf69ecabbe4
/frameworks/av/include/media/AudioSystem.h
d457c970c8d08519cd77280a90b61ae1e342cfe3 11-Feb-2014 Marco Nelissen <marcone@google.com> Track pid for each session

so they can be properly freed.

Change-Id: I6f389035bc29e74e7c367c1c6d0252b180f666b3
/frameworks/av/include/media/AudioSystem.h
1d6fa7af1288b550faabe4ec2cf98684236723db 11-Feb-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 566be7c3 to master

Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
377b2ec9a2885f9b6405b07ba900a9e3f4349c38 03-Feb-2014 Kévin PETIT <kevin.petit@arm.com> Make frameworks/av 64-bit compatible

Contains the necessary changes to make frameworks/av build and work
on a 64-bit machine.

Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
/frameworks/av/include/media/AudioSystem.h
9a2a29ce9ea69382aafd8b895b80f7bbd028cb00 17-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Document the reference count rules for I/O handles"
d631d962a831de8b7614b14d7368eae60c816893 16-Jan-2014 Glenn Kasten <gkasten@google.com> Document the reference count rules for I/O handles

Change-Id: Ia7cd27ad84bbd7bf2657011057f89386f938a807
/frameworks/av/include/media/AudioSystem.h
5f972c031d4061f4f037c9fda1ea4bd9b6a756cd 13-Jan-2014 Glenn Kasten <gkasten@google.com> AudioRecord::getInputFramesLost() cleanup

Fixed bug that if the binder call failed (for example if the
IAudioFlinger binder is dead), then getInputFramesLost was returning
garbage. Now it correctly returns zero, which is the error value for
this method.

The type declarations for getInputFramesLost were inconsistent:
a mixture of unsigned int, size_t, and uint32_t. Now it returns uint32_t
everywhere, which is what the underlying HAL API returns.

Added a FIXME about the side effect behavior. This will need review
for multi-client.

Change-Id: Ifa2e117a87dbd0c1f2c892a31d1c3dd919bf1a0a
/frameworks/av/include/media/AudioSystem.h
f94006ca0f30c27868c284e553f57bf467ae92bc 08-Jan-2014 Glenn Kasten <gkasten@google.com> Cleanup error handling in AudioSystem get methods

Don't return zero sample rate or frame count without an error.

Change-Id: I052d841080ed33e4f081ae9825a2f33dff444fb9
/frameworks/av/include/media/AudioSystem.h
4d973f3894a50413f21e7db284e96afc87f57698 08-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Remove unnecessary defaults for parameters in AudioSystem"
6a5e79733c760d7555aacec53c8bd21e8516c0a1 20-Dec-2013 Glenn Kasten <gkasten@google.com> Remove unnecessary defaults for parameters in AudioSystem

Change-Id: I0ee7bc13cf64f50b1ea780f4d99899aed20421a0
/frameworks/av/include/media/AudioSystem.h
c23885ebb142b9da31543789ecc3f7cf7111bc67 20-Dec-2013 Glenn Kasten <gkasten@google.com> Add versions of get/SetParameters without I/O handle

This is a step towards hiding I/O handles from application level,
as much as possible.

Change-Id: I30f4171d5dcf77f8e8eb332ce2e9245b30f5f2e1
/frameworks/av/include/media/AudioSystem.h
d6a2f3f03197998f44374e68ba1d838a7ebb180d 20-Aug-2013 Eric Laurent <elaurent@google.com> am 9f178e70: am 99ad37a4: Merge "AudioSystem: new audioflinger restart detection" into klp-dev

* commit '9f178e705836d9ac8de64487929732c302644bee':
AudioSystem: new audioflinger restart detection
46291616486979986cba3ab83e894728ef53063f 18-Jul-2013 Eric Laurent <elaurent@google.com> AudioSystem: new audioflinger restart detection

Add a specific method to AudioSystem for AudioService to poll
for AudioFlinger service restart instead of relying on current
callback mechanism which is flaky.

Bug: 9693068.
Change-Id: Ie88bc9d25033503bc5cd2fa9d8c754d0f8045b8f
/frameworks/av/include/media/AudioSystem.h
6d238e5ecb4c4266bc865a067072a30187e55f97 06-Aug-2013 Glenn Kasten <gkasten@google.com> Line length 100

Change-Id: I8ad58a961cefd0b0c2b041e04fd78669917453d1
/frameworks/av/include/media/AudioSystem.h
eced2daaa6c91a3731eef978ce65c6ec319c5e6a 17-Jul-2013 Glenn Kasten <gkasten@google.com> Use correct type for OutputDescriptor::format

Change-Id: Ide608ef452d57da29b708180d90470361c123d1d
/frameworks/av/include/media/AudioSystem.h
fad226abd12435dbcd232f7de396f1a097b2bd5f 17-Jul-2013 Glenn Kasten <gkasten@google.com> Use standard name and type for channel mask

Former name 'channels' was ambiguous with respect to channel count.

Change-Id: I716f792d95a7e0c787d27514ad6e93dbcef8a415
/frameworks/av/include/media/AudioSystem.h
4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61 15-Jul-2013 Glenn Kasten <gkasten@google.com> Use AudioSystem::setLowRamDevice() to configure memory

Bug: 9798886
Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
/frameworks/av/include/media/AudioSystem.h
1ab85ec401801ef9a9184650d0f5a1639b45eeb9 31-May-2013 Glenn Kasten <gkasten@google.com> Include what is needed

Remove old includes.
Header files only include other header files that they directly need themselves.

Change-Id: Ic471386808d9f42ea19ccbd59cb50a5f83a89dd0
/frameworks/av/include/media/AudioSystem.h
ad3af3305f024bcbbd55c894a4995e449498e1ba 25-Mar-2013 Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Public API changes for audio offload support.

NOTE: this does _not_ include all private member variables added
to classes as part of offload support. Only public/protected functions
and stubs functions/variables needed to make the changes buildable.

- isOffloadSupported() added to audio policy service
A stub implementation is required to build, this always returns false
- setParameters() added to IAudioTrack
A stub implementation is required to build, this always returns
INVALID_OPERATION

- CBlk flag for stream end

- Change AudioSystem::getRenderPosition() to take an audio_output_t
so caller can specify which output to query

- Add AudioSystem::isOffloadSupported()
This is fully implemented down to the AudioFlinger function
AudioPolicyServer::isOffloadSupported() which is just a stub
that always returns false.

- Add EVENT_STREAM_END to AudioTrack interface.
STREAM_END is used to signal when the hardware has actually finished
playing all the data it was sent.

- Add event type enumeration to media player interface AudioSink callbacks
so that the same callback can be used to handle multiple types of
event. For offloaded tracks we also have to handle STREAM_END and
TEAR_DOWN events

- Pass audio_offload_info_t to various functions used for opening outputs,
tracks and audio players. This passes additional information about the
compressed stream down to the HAL when using offload.
For publicly-available APIs this is an optional parameter (for some of
the internal and low-level APIs around the HAL interface it is mandatory)

- Add getParameters() and setParameters() API to AudioTrack
Currently dummy implementations.

- Change AudioPlayer contructor so that it takes a set of bitflags defining what
options are required. This replaces the original bool which only specified
whether to use deep buffering.

- Changes to StageFright class definition related to handling tearing-down of
an offloaded track when we need to switch back to software decode

- Define new StageFright utility functions used for offloaded tracks
Currently dummy implementations.

- AudioFlinger changes to use extended audio_config_t.
Fills in audio_offload_info_t member if this info is passed in when
opening an output.

- libvideoeditor changes required to add the new event type parameter
to AudioSink callback functions

- libmediaplayerservice changes required to add the new event type parameter
to AudioSink callback functions

Change-Id: I3ab41138aa1083d81fe83b886a9b1021ec7320f1
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Eric Laurent <elaurent@google.com>
/frameworks/av/include/media/AudioSystem.h
272ab546940054ad7991bef4b3a36f15175721cd 05-Feb-2013 Jean-Michel Trivi <jmtrivi@google.com> Add support for querying if a stream is active remotely

Bug 7485803

Change-Id: I0744374f130fd2dd0714102354cffed2fa915361
/frameworks/av/include/media/AudioSystem.h
e33054eb968cbf8ccaee1b0ff0301403902deed6 14-Nov-2012 Glenn Kasten <gkasten@google.com> Use size_t for frame counts

Also fix typo: bufferCount should be frameCount.

Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
/frameworks/av/include/media/AudioSystem.h
3b16c766d1ae2cfd8487e8ffb2b23936fc0a8e17 14-Nov-2012 Glenn Kasten <gkasten@google.com> Use uint32_t for sample rate

Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
/frameworks/av/include/media/AudioSystem.h
a552d6049ccf674b083d011ce7b8a443a9cd68a4 14-Nov-2012 Glenn Kasten <gkasten@google.com> Remove deprecated AudioSystem methods

Change-Id: I952d504e03af9a1d3e1e0aa379c82dfb00197d9f
/frameworks/av/include/media/AudioSystem.h
85ab62c4b433df3f1a9826bed1c9bec07a86c750 01-Nov-2012 Glenn Kasten <gkasten@google.com> Line length 100

Change-Id: Ib28fd7b9ce951a6933f006e7f8812ba617625530
/frameworks/av/include/media/AudioSystem.h
d7086030fcf731e4bcef6c033cc6418cd04e6b91 10-Oct-2012 Jean-Michel Trivi <jmtrivi@google.com> Support querying active record sources

Add support for querying whether there is currently a recording
underway from the specified audio source.

Bug 7314859

Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
/frameworks/av/include/media/AudioSystem.h
cc0f1cfb69ce8b8985fc2c0984847a06a13ad22d 24-Sep-2012 Glenn Kasten <gkasten@google.com> Implement android.media.AudioManager.getProperty()

Bug: 6635041
Change-Id: I3386a4a6c226bc4eceaf65556119e4fb15f73224
/frameworks/av/include/media/AudioSystem.h
58e5aa34f01d663654d8bafad65db1dda42161ff 20-Jun-2012 Glenn Kasten <gkasten@google.com> effect_descriptor_t const correctness

Change-Id: Iad008f20d35a18acf500f773900164552fd0c19e
/frameworks/av/include/media/AudioSystem.h
bf04a5d7f287fc712e0ed91849dc85c90c1e182d 12-Jul-2012 Glenn Kasten <gkasten@google.com> Simplify AudioRecord::getInputFramesLost()

This also fixes a benign race in reading mActive without a lock.

Change-Id: I19e953d4f275e5c266ca1ca3fece7b6c02ad1707
/frameworks/av/include/media/AudioSystem.h
254af180475346b6186b49c297f340c9c4817511 03-Jul-2012 Glenn Kasten <gkasten@google.com> Use audio_channel_mask_t more places

Use it in AudioSystem::getOutput(), AudioSystem::getInput(),
IAudioPolicyService::getOutput(), IAudioPolicyService::getInput(),
and various other places in AudioFlinger.

Not done: AudioTrack and OutputDescriptor.

Change-Id: I70e83455820bd8f05dafd30c63d636c6a47cd172
/frameworks/av/include/media/AudioSystem.h
dd8104cc5367262f0e5f13df4e79f131e8d560bb 02-Jul-2012 Glenn Kasten <gkasten@google.com> Use audio_channel_mask_t more consistently

In IAudioFlinger::createTrack() and IAudioFlinger::openRecord(),
declare input parameter to use correct type audio_channel_mask_t.

In IAudioFlinger::getInputBufferSize(), input parameter is now channel mask
instead of channel count.

Remove unused IAudioFlinger::channelCount(audio_io_handle_t).

In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(),
input parameter is channel mask instead of channel count.

Change-Id: Ib2f1c29bea70f016b3cfce83942ba292190ac965
/frameworks/av/include/media/AudioSystem.h
20010053daabfa43fcfe781bbf004473b4c08538 22-Jun-2012 Glenn Kasten <gkasten@google.com> Remove acoustics from AudioSystem::getInput()

Change-Id: I29fb3ee5664c1f0ee0409c1bb2be087ecca637db
/frameworks/av/include/media/AudioSystem.h
2986460984580833161bdaabc7f17da1005a8961 09-May-2012 Eric Laurent <elaurent@google.com> Fix issues with synchronous record start.

- Added a timeout in case the trigger event is never fired.
- Extend AudioRecord obtainBuffer() timeout in case of
synchronous start to avoid spurious warning.
- Make sure that the event is triggered if the track is
destroyed.
- Reject event if the triggering track is in an incompatible state.

Also fix a problem when restoring a static AudioTrack after
a mediaserver crash.

Bug 6449468.

Change-Id: Ib36e11111fb88f73caa31dcb0622792737d57a4b
/frameworks/av/include/media/AudioSystem.h
0ca3cf94c0dfc173ad7886ae162c4b67067539f6 18-Apr-2012 Eric Laurent <elaurent@google.com> rename audio policy output flags

Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
/frameworks/av/include/media/AudioSystem.h
1a9ed11a472493cac7f6dfcbfac2064526a493ed 21-Mar-2012 Eric Laurent <elaurent@google.com> audio policy: add configuration file

removed outputs to stream mapping cache in audio system: the output for a
given stream type must always be queried from audio policy manager as the cache
is not always updated fast enough by audioflinger callback.

removed AudioFlinger::PlaybackThread::setStreamValid() not used anymore if
stream to output mapping is not cached.

Change-Id: Ieca720c0b292181f81247259c8a44359bc74c66b
/frameworks/av/include/media/AudioSystem.h
a011e35b22f95f558d81dc9c94b68b1465c4661d 30-Mar-2012 Eric Laurent <elaurent@google.com> implemented synchronous audio capture

Added the infrastructure to support the synchronization of playback and
capture actions on specific events.
The first requirement for this feature is to synchronize the audio capture
start with the full rendering of a given audio content.
The applications can further be extended to other use cases
(synchronized playback start...) by adding new synchronization events and
new synchronous control methods on player or recorders.

Also added a method to query the audio session from a ToneGenerator.

Change-Id: I51f1167290d9cafdf2fbcdf9e4785156973af44c
/frameworks/av/include/media/AudioSystem.h
a19ffb656616feec70613ba67ddfe15a504a4e76 09-Mar-2012 Eric Laurent <elaurent@google.com> Merge "audio policy: use audio_devices_t when appropriate"
6374252107fd6539397598195ea6defd5870fafb 08-Mar-2012 Eric Laurent <elaurent@google.com> audio policy: use audio_devices_t when appropriate

Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
/frameworks/av/include/media/AudioSystem.h
b81cc8c6f3eec9edb255ea99b6a6f243585b1e38 01-Mar-2012 Glenn Kasten <gkasten@google.com> IAudioFlingerClient::ioConfigChanged param2 const

The 3rd parameter (param2) to AudioFlingerClient::ioConfigChanged
is used as an input. So changed it from void * to const void *.
It is then cast to const OutputDescriptor *
or const audio_stream_type_t * depending on the event.

Change-Id: Ieec0d284f139b74b3389b5ef69c7935a8e5650ee
/frameworks/av/include/media/AudioSystem.h
3030fcefcfcfc48789612659206b957cd0489a54 01-Mar-2012 Eric Laurent <elaurent@google.com> renamed audio policy output flag.

Renamed AUDIO_POLICY_OUTPUT_FLAG_INDIRECT to AUDIO_POLICY_OUTPUT_FLAG_NONE
which is more appropriate.

Change-Id: Ia14d60397df0f2dcd9bea0186400a09da35bc104
/frameworks/av/include/media/AudioSystem.h
99e53b86eebb605b70dd7591b89bf61a9414ed0e 19-Jan-2012 Glenn Kasten <gkasten@google.com> Update comments

We no longer put the filename at start of file.

Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
/frameworks/av/include/media/AudioSystem.h
72ef00de10fa95bfcb948ed88ab9b7a177ed0b48 17-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_io_handle_t consistently instead of int

Other:
- add a comment to nextUniqueId
- made ThreadBase::mId const, since it is only assigned in constructor.

Change-Id: I4e8b7bec4e45badcde6274d574b8a9aabd046837
/frameworks/av/include/media/AudioSystem.h
211eeaf17e5565b68447d29799dbf158a33cf4cf 20-Jan-2012 Glenn Kasten <gkasten@google.com> More audio_stream_type_t

Change-Id: I1260259efe0aa3fc1ef13de69758aaa592e1f815
/frameworks/av/include/media/AudioSystem.h
eba51fb3a361f67a6a64d5a16eba6084fe27d60e 23-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_source_t consistently

Was a mix of audio_source_t, uint8_t, and int.

Related fixes:
- fix comments in MediaRecorder.java
- AudioPolicyService server side was not checking source parameter at
all, so if the client wrapper was bypassed, invalid values could be
passed into audio HAL
- JNI android_media_AudioRecord_setup was checking source for positive
values, but not negative values. This test is redundant, since already
checked at Java and now checked by AudioPolicyService also, but might
as well make it correct.

Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
/frameworks/av/include/media/AudioSystem.h
58f30210ea540b6ce5aa6a46330cd3499483cb97 12-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_format_t consistently, continued

Was int or uint32_t.

When AudioFlinger::format can't determine the correct format,
return INVALID rather than DEFAULT.

Init mFormat to INVALID rather than DEFAULT in the constructor.
Subclass constructors will set mFormat to the correct value.

Change-Id: I9b62640aa107d24d2d27925f5563d0d7407d1b73
/frameworks/av/include/media/AudioSystem.h
ea3cc3bca949139e401b77f2ac0cce7ac6e76f8f 20-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Remove dead setRingerMode(mode, mask)"
0b07b8085d7b837b4dd5f09e0c8c39408f6bdbf7 18-Jan-2012 Glenn Kasten <gkasten@google.com> Remove dead setRingerMode(mode, mask)

Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
/frameworks/av/include/media/AudioSystem.h
c813985abd8ba61e999b3505f6a332574f87a1be 18-Jan-2012 Andreas Huber <andih@google.com> Temporarily restore AudioSystem/AudioTrack APIs with their former signatures

until we get updated prebuilts from vendor.

Change-Id: I8aae81d2513edca0ab268053a11c8c4206879e61
/frameworks/av/include/media/AudioSystem.h
63ad6aacc6ce6b729bf25f41376cfea731a2c1eb 18-Jan-2012 Eric Laurent <elaurent@google.com> Merge "audio framework: manage stream volume per device"
83844cc2f95dc279015b47fd1e18c7cb4eabe9a1 19-Nov-2011 Eric Laurent <elaurent@google.com> audio framework: manage stream volume per device

Improve volume management by keeping track of volume for each type
of device independently.
Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained
per device.

The main changes are:
- AudioService now keeps tracks of stream volumes per device:
volume indexes are kept in a HashMap < device , index>.
active device is queried from policy manager when a volume change request
is received
initalization, mute and unmute happen on all device simultaneously
- Settings: suffixes is added to volume keys to store each device
volume independently.
- AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument
to setStreamVolumeIndex() and getStreamVolumeIndex() to address each
device independently.
- AudioPolicyManagerBase: keep track of stream volumes for each device
and apply volume according to current device selection.

Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
/frameworks/av/include/media/AudioSystem.h
0696400a6bb9abbed62b3b9c6aa105495dc600a2 17-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Use audio_mode_t consistently"
fff6d715a8db0daf08a50634f242c40268de3d49 13-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_stream_type_t consistently

At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t. Java is still int. Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.

Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
/frameworks/av/include/media/AudioSystem.h
f78aee70d15daf4690de7e7b4983ee68b0d1381d 04-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_mode_t consistently

It was int or uint32_t.
Also make getMode() const.

Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
/frameworks/av/include/media/AudioSystem.h
9f6530f53ae9eda43f4e7c1cb30d2379db00aa00 30-Aug-2011 Eric Laurent <elaurent@google.com> 226483: A2DP connected, but music out to speaker

When the A2DP headset is connected, there is a possible
race condition when the audio tracks are moved from
the mixer thread attached to the speaker output to the thread
attached to A2DP output.
As the request to clear the stream type to output mapping cache in
the client process is asynchronous, it is possible that the flag
indicating to the client audio track to re-create the IAudioTrack
on the new thread is processed before the cache is invalidated.
In this case, the track will be attached to the old thread and
music will continue playing over the device speaker instead of being
redirected to A2DP headset.

Change-Id: Ib2ce1eb5320eaff83287b93779061bf4e7a330df
/frameworks/av/include/media/AudioSystem.h
db7c079f284f6e91266f6653ae0ec198b1c5006e 10-Aug-2011 Eric Laurent <elaurent@google.com> Audio effects: track CPU and memory use separately

Before this change, CPU and memory usage for an audio effect were
registered and checked against the limit by audio policy manager
upon effect instantiation. Even if an effect was not enabled
it would prevent another effect to be created if the CPU load budget
was exceeded, which was too restrictive.

This change adds a method to register/unregister CPU load only when
an effect is enabled or disabled.
It also adds a mechanism to place all effects on the global output mix
in suspend state (disabled) when an effect is enabled on a specific session.
This will allow applications using session effects to have the priority
over others using global effects.

Also fixes some issues with suspend/restore mechanism:
- avoid taking actions when an effect is disconnected and was not enabled.
- do not remove a session from the suspended sessions list when corresponding
effect chain is destroyed.

Change-Id: I5225278aba1ae13d0d0997bfe26a0c9fb46b17d3
/frameworks/av/include/media/AudioSystem.h
3a34befc6fb04a4945a849e8bda8b84e4bf973fe 02-Aug-2011 Marco Nelissen <marcone@google.com> Keep effects sessions active when the caller dies.

Don't remove effects until the session they are in goes away or all
AudioEffects have been explicitly released. This allows the control
panel process to die without stopping the effects.

Change-Id: I4496e5df080230ca1af149dec95c1309ab8ea888
/frameworks/av/include/media/AudioSystem.h
7c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745 18-Jun-2011 Eric Laurent <elaurent@google.com> Audio framework: support for audio pre processing

Audio effect framework is extended to suport effects on
output and input audio path.

AudioFlinger: Support for audio effects and effect chains is
moved from PlaybackThread class to ThreadBase class so that
RecordThread can manage effects.
Effects of type pre processing are allowed on record thread
only. When a pre processing is enabled, the effect interface handle is
passed down to the input stream so that the audio HAL can call the
process function. The record thread loop calls the effect chain process
function that will only manage the effect state and commands and skip the
process function.

AudioRecord: The audio session is allocated before calling getInput() into
audio policy serice so that the session is known before the input theead is
created and pre processings can be created on the correct session.

AudioPolicyService: default pre processing for a given input source are
loaded from audio_effects.conf file.
When an input is created, corresponding effects are created and enabled.

Change-Id: Id17119e0979b4dcf189b5c7957fec30dc3478790
/frameworks/av/include/media/AudioSystem.h
7394a4f358fa9908a9f0a7c954b65c399f4268e6 14-Jun-2011 Dima Zavin <dima@android.com> audio: update for audio/audio_policy header names/locations

Change-Id: I36c49352eee57559403cd1597f56a8485a360289
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/av/include/media/AudioSystem.h
64760240f931714858a59c1579f07264d7182ba2 11-May-2011 Dima Zavin <dima@android.com> update for new audio.h header location

Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/av/include/media/AudioSystem.h
fce7a473248381cc83a01855f92581077d3c9ee2 20-Apr-2011 Dima Zavin <dima@android.com> audio/media: convert to using the audio HAL and new audio defs

Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/av/include/media/AudioSystem.h
db5cb14318bb24cd6ea14ff7ceea0d5e1f83d903 20-Apr-2011 Dima Zavin <dima@android.com> libmedia: move AudioParameter out of AudioSystem

Change-Id: I9eb7e002d141936258050d4fa4f0ccd8202bfc54
Signed-off-by: Dima Zavin <dima@android.com>
/frameworks/av/include/media/AudioSystem.h
4bcae82f9b07d1a39956c45a6f5bec0b696c4dd1 04-Apr-2011 Glenn Kasten <gkasten@google.com> Miscellaneous code cleanup in audio framework

Changes:
- Move declaration of kClassPathName to top of file so it can be used
in more than one place, instead of "android/media/AudioSystem".
- Make private methods static.
- Add comment to stream_type, audio_mode, force_use types that they must match
values in AudioSystem.java.
- Add comment about unused types mp3_sub_format and vorbis_sub_format.
- Fix typos.
- Use @ in javadoc comments.
- Delete dead APIs setMode, getMode, setRouting, getRouting in AudioSystem.java
(they are all hidden, deprecated, and unused by rest of framework)
- Delete unused private log method.
- Fix pathname for android_media_AudioSystem.cpp.
- Improve code formatting for space after == and !=.
- Add logging of delta for changing audio policy manager ref count.

Change-Id: I18037c7beb8ab76d1fda08c11e589f6e591d36e1
/frameworks/av/include/media/AudioSystem.h
6b2718c67aa7b1a8e3b0f25a73a0d5f72c59ffc3 04-Feb-2011 Glenn Kasten <gkasten@google.com> Bug 3352047 Wrong message when adjusting volume

Add hidden AudioManager.getDevicesForStream and output device codes.

Change-Id: I4d1c1d3b6a077cd117720817d1f733dda557b947
/frameworks/av/include/media/AudioSystem.h
eda6c364c253ba97ee45a3adeb8c2b45db1f81db 02-Feb-2011 Eric Laurent <elaurent@google.com> Fix issue 3371080

Modified default volume control logic in AudioService:
1 IN_CALL volume if in video/audio chat
2 NOTIFICATION if notification is playing or was playing less than 5s ago.
3 MUSIC

Modified silent mode:
- now also affect MUSIC stream type
- entering silent mode when VOL- hard key is pressed once while selected
stream volume is already at 0 (except for VOICE_CALL stream).
- exiting silent mode when pressing VOL+ hard key while in silent mode

Play sound FX (audible selections, keyboard clicks) at a fixed volume.

Modified audio framework:
- isStreamActive() method now implemented in AudioPolicyManagerBase (previously AudioFlinger)
- iStreamActive() now specifies a time window during which the stream is considered
active after it actually stopped.

Change-Id: I7e5a0724099450b9fc90825224180ac97322785f
/frameworks/av/include/media/AudioSystem.h
f1fb01a7f00b8da90a36268aba8584a872e99175 15-Nov-2010 Jean-Michel Trivi <jmtrivi@google.com> Add new audio mode 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.

Change-Id: Id744cd26520ea1d1a4795eabe6a1f0c58789af76
/frameworks/av/include/media/AudioSystem.h
56ecd20263d7f63476f756fc5d8b043b325c7bfb 09-Nov-2010 Jean-Michel Trivi <jmtrivi@google.com> Add support for audio recording source in generic audio policy mgr.

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.

Change-Id: I6b4fd0f8a3acea0d7d30bbad98edd1977dc012bf
/frameworks/av/include/media/AudioSystem.h
b235dee7be544a6c990ba4f8d89ab03e38c826f8 06-Oct-2010 Praveen Bharathi <pbharathi@motorola.com> Added support for dock headset observer

Change-Id: I06b2e65e3bfa10735e6c7fd3349afa9ae7d45292
Signed-off-by: Praveen Bharathi <pbharathi@motorola.com>
/frameworks/av/include/media/AudioSystem.h
de070137f11d346fba77605bd76a44c040a618fc 13-Jul-2010 Eric Laurent <elaurent@google.com> Audio policy manager changes for audio effects

Added methods for audio effects management by audio policy manager.
- control of total CPU load and memory used by effect engines
- selection of output stream for global effects
- added audio session id in parameter list for startOutput() and stopOutput().
this is not used in default audio policy manager implementation.

Modifications of audio effect framework in AudioFlinger to allow moving and reconfiguring
effect engines from one output mixer thread to another when audio tracks in the same session
are moved or when requested by audio policy manager.
Also fixed mutex deadlock problem with effect chains locks.

Change-Id: Ida43484b06e9b890d6b9e53c13958d042720ebdb
/frameworks/av/include/media/AudioSystem.h
ffe9c25ce85e1af55d58ec025adc6367d70db7e8 24-Jun-2010 Eric Laurent <elaurent@google.com> Various fixes and improvements in audio effects implementation

Effect API:
- Use different definitions for audio device, channels, formats... in AudioSystem and EffectApi:
Removed media/AudioCommon.h file created for initial version of EffectApi
- Indicate audio session and output ID to effect library when calling EffectCreate(). Session ID can be useful to optimize
the implementation of effect chains in the same audio session. Output ID can be used for effects implemented in audio hardware.
- Renamed EffectQueryNext() function to EffectQueryEffect() and changed operating mode:
now an index is passed for the queried effect instead of implicitly querying the next one.
- Added CPU load and memory usage indication in effects descriptor
- Added flags and commands to indicate changes in audio mode (ring tone, in call...) to effect engine
- Added flag to indicate hardware accelerated effect implementation.
- Renamed EffectFactoryApi.h to EffectsFactoryApi.h for consistency with EffectsFactory.c/h

Effect libraries:
- Reflected changes in Effect API
- Several fixes in reverb implementation
- Added build option TEST_EFFECT_LIBRARIES in makefile to prepare integration of actual effect library.
- Replaced pointer by integer identifier for library handle returned by effects factory

Audio effect framework:
- Added support for audio session -1 in preparation of output stage effects configuration.
- Reflected changes in Effect API
- Removed volume ramp up/down when effect is inserted/removed: this has to be taken care of by effect engines.
- Added some overflow verification on indexes used for deferred parameter updates via shared memory
- Added hardcoded CPU and memory limit check when creating a new effect instance

Change-Id: I43fee5182ee201384ea3479af6d0acb95092901d
/frameworks/av/include/media/AudioSystem.h
be916aa1267e2e6b1c148f51d11bcbbc79cb864c 02-Jun-2010 Eric Laurent <elaurent@google.com> Issue 2667801: [Audio Effect Framework] AudioFlinger, AudioMixer AudioTrack modifications.

First drop of audio framework modifications for audio effects support.

- AudioTrack/AudioRecord:
Added support for auxiliary effects in AudioTrack
Added support for audio sessions
Fixed left right channel inversion in setVolume()

- IAudioFlinger:
Added interface methods for effect enumeraiton and instantiation
Added support for audio sessions.

- IAudioTrack:
Added method to attach auxiliary effect.

- AudioFlinger
Created new classes to control effect engines in effect library and manage effect connections to tracks or
output mix:
EffectModule: wrapper object controlling the effect engine implementation in the effect library. There
is one EffectModule per instance of an effect in a given audio session
EffectChain: group of effects associated to one audio session. There is one EffectChain per audio session.
EffectChain for session 0 is for output mix effects, other chains are attached to audio tracks
with same session ID. Each chain contains a variable number of EffectModules
EffectHandle: implements the IEffect interface. There is one EffectHandle object for each application
controlling (or using) an effect module. THe EffectModule maintians a list of EffectHandles.

Added support for effect modules and effect chains creation in PlaybackThread.
modified mixer thread loop to allow track volume control by effect modules and call effect processing.

-AudioMixer
Each track now specifies its output buffer used by mixer for accumulation
Modified mixer process functions to process tracks by groups of tracks with same buffer
Modified track process functions to support accumulation to auxiliary channel

Change-Id: I26d5f7c9e070a89bdd383e1a659f8b7ca150379c
/frameworks/av/include/media/AudioSystem.h
135ad07e33d30e5202deb21061a0e3ecf0ffad35 21-May-2010 Eric Laurent <elaurent@google.com> Fix issue 2667796: [Audio Effect Framework] Effect factory and libraries.

First effect factory and effect library API implementation.
Also added default effect libraries for reverb and equalizer effects.
These libraries are for functional test only and are not fine tuned with
regard to audio quality. They will probably be replaced by other implementations
before the release.

Change-Id: I6868f8612146ae282c64052765c61a52ec789ec8
/frameworks/av/include/media/AudioSystem.h
05bca2fde53bfe3063d2a0a877f2b6bfdd6052cf 26-Feb-2010 Eric Laurent <elaurent@google.com> Issue 2071329: audio track is shorter than video track for video capture on sholes

Add API to retrieve number of frames dropped by audio input kernel driver.

Submitted on behalf of Masaki Sato <masaki.sato@motorola.com>
/frameworks/av/include/media/AudioSystem.h
342e9cf388cceb807def720e40e8b0a217f4bcaa 20-Jan-2010 Eric Laurent <elaurent@google.com> Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync

Added getRenderPosition() API to IAudioFlinger to retreive number of audio frames
written by AudioFlinger to audio HAL and by DSP to DAC.

Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames
written by DSP to DAC.

Exposed AudioTrack::getPosition() to AudioSink() to make it available to media player.

Removed excessive log in AudioHardwareGeneric.
/frameworks/av/include/media/AudioSystem.h
b72a396826da8bd934b9531bbd40f86d7509e71c 25-Jan-2010 Eric Laurent <elaurent@google.com> Fix issue 2378022: AudioService should direct volume control to STREAM_VOICE_CALL stream when STREAM_VOICE_CALL stream is active.

Modified AudioService.getActiveStreamType() so that STREAM_VOICE_CALL is selected when a track using this stream
type is playing.

Chanded isMusicActive() for a more generic isStreamActive(stream) method in AudioSystem, IAudioFlinger and AudioFlinger.
/frameworks/av/include/media/AudioSystem.h
492e666e47795326f4b12b87b150b550e6074bd8 10-Dec-2009 Eric Laurent <elaurent@google.com> Create base class for audio policy manager.

First implementations of audio policy manager in Eclair branch have shown that most code is common to all platforms.
Creating AudioPolicyManagerBase base class will improve code maintainability and readability.

Audio policy manager code for platforms using generic audio previously in AudioPolicyManagerGeneric is replaced by AudioPolicyManagerBase.
Audio policy manager test code previously in AudioPolicyManagerGeneric is moved to AudioPolicyManagerBase.

Also added a wake lock for delayed commands in AudioPolicyService.
/frameworks/av/include/media/AudioSystem.h
7ddd450f91dc508b26cc550f5b42fded8a731654 17-Dec-2009 Eric Laurent <elaurent@google.com> Fix issues 2333450 and 2333559:

Add new config values to AudioSystem::FOR_DOCK force usage to differenciate car and desk docks.
Use a receiver for the sticky Intent.ACTION_DOCK_EVENT in AudioService to detect the type
of dock and select force usage accordingly.
/frameworks/av/include/media/AudioSystem.h
48643f38c9e92dd0a3d4a31c293c954f3df4db1b 08-Dec-2009 Jean-Michel Trivi <jmtrivi@google.com> Partially fix bug 2111240 Detect docking / undocking event by reporting
to the AudioPolicyManager a new forced usage AudioSystem::FOR_DOCK
which can take the FORCE_NONE, FORCE_BT_DOCK or FORCE_WIRED_ACCESSORY
values. This CL is complemented by an update of the APM to take into
account the FOR_DOCK usage.
/frameworks/av/include/media/AudioSystem.h
0f2d1e2dd7601e06fdf834f3f942eeb5c8b33a15 12-Nov-2009 Eric Laurent <elaurent@google.com> Fix issue 2242614: Wired headset not recognized: bogus "state" in ACTION_HEADSET_PLUG broadcast.

The headset state indicated by HeadsetObserver in the broadcast intent ACTION_HEADSET_PLUG was not 0 or 1 as specified in the java doc but contained a bit field indicating the type of headset connected.

Modified HeadsetObserver to broacast a state conforming to java doc.
Added an extra to intent ACTION_HEADSET_PLUG to indicate if headset has a microphone or not.
Removed handling of non standard headset indications from HeadsetObserver.
Removed platform specific devices from output devices defined in AudioSystem.
Modified AudioService to use new ACTION_HEADSET_PLUG intent extra instead of bitfield in state.
/frameworks/av/include/media/AudioSystem.h
90b75fbd19571784c8ceee4841a28b8333a8198e 02-Nov-2009 Eric Laurent <elaurent@google.com> Fix 2194140: [Passion] Support Audience chip.

Added new input device DEVICE_IN_BACK_MIC.
Added new audio source AUDIO_SOURCE_CAMCORDER.
/frameworks/av/include/media/AudioSystem.h
f0ee6f4055e26fb35d9c526a596668a4dc9da5ba 21-Oct-2009 Eric Laurent <elaurent@google.com> Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.

Added setVoiceVolume() method to AudioSystem, AudioFlinger, IAudioFlinger, AudioPolicyService.
Removed call to AudioHardwareInterface::setVoiceVolume() from AudioFlinger::setStreamVolume().
/frameworks/av/include/media/AudioSystem.h
a9c322e398a1f5fdcace3b8b73967f010b1c31ca 27-Aug-2009 Eric Laurent <elaurent@google.com> Fix issue 2045911: Camera Shutter tone does not play correctly while listening to music.

Add the possibility to delay routing and volume commands in AudioPolicyClientInterface. The delay is not blocking for the caller.
/frameworks/av/include/media/AudioSystem.h
fa2877b9ea48baed934b866d2ab3658b69c4c869 28-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 2001214: AudioFlinger and AudioPolicyService interfaces should not use pointers as handles to inputs and outputs.

Use integers instead of void* as input/output handles at IAudioFlinger and IAudioPolicyService interfaces.
AudioFlinger maintains an always increasing count of opened inputs or outputs as unique ID.
/frameworks/av/include/media/AudioSystem.h
9a92037bd6477533062d635b676a6c9833aab96e 27-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 2001517: AudioTrack compatibility issue.

Modified enum values in AudioFormat.java and AudioSystem.h.
Added code for backward compatibility in AudioTrack.java and AudioRecord.java.
/frameworks/av/include/media/AudioSystem.h
c2f1f07084818942352c6bbfb36af9b6b330eb4e 17-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 1795088 Improve audio routing code

Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
/frameworks/av/include/media/AudioSystem.h
29a65006e517ae5bb164e973b2d805ebfa834a2e 28-Mar-2009 Eric Laurent <> AI 143327: am: CL 143177 am: CL 142889 Fix issue #1736153 Camera shutter sound can be muted by new AlarmClock setting.
Current implementation of Camera service plays the camera shutter sound over the ALARM stream so that it cannot be muted by silent mode in order to comply to some country specific requirement. A recent change made it possible for the user to mute the ALARM stream thus making this stream not suitable any more for the camera shutter sound.
The fix consists in creating a new stream type only accessible by native code and that cannot be muted and use it to play camera sounds.
Original author: elaurent
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...

Automated import of CL 143327
/frameworks/av/include/media/AudioSystem.h
89fa4ad53f2f4d57adbc97ae1149fc00c9b6f3c5 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/av/include/media/AudioSystem.h
15f767b960b38059a74a42a33e16d8df2aec8bc1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/av/include/media/AudioSystem.h
25658fd43d150a45fb37734a9f9f27f48bb5c133 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
/frameworks/av/include/media/AudioSystem.h
7a2146d5807030b2629f347736be5301b61e8811 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/av/include/media/AudioSystem.h
5e07b5774c8b376776caa4f5b0a193767697e97e 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/av/include/media/AudioSystem.h
7b5eb023f8d87cca6d830ae6c11c6aadbe02aca8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/av/include/media/AudioSystem.h
2729ea9262ca60d93047e984739887cfc89e82eb 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/av/include/media/AudioSystem.h