History log of /frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
00a2096f3bd6f938216b3691c0b581d64df52999 26-May-2016 Jean-Michel Trivi <jmtrivi@google.com> Audio policy: volume computation improvement on A2DP for notifications

When playing STRATEGY_SONIFICATION* streams, or system sounds or
enforced sounds on A2DP during media playback, ensure the
difference between the media volume and the notification
is no more than 12dB

Bug 28288132

Change-Id: If5cb7979dd76a0d624e8aeff9126ff56bfd7366b
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
634b71478742310960f3fdb4241e70a0735712c4 20-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: fix regression in getDeviceConnectionState().

Fix problem in DeviceVector() device search logic causing
failure to report connection of devices when no address is provided
(e.g when called from AudioManager.isBluetoothA2dpOn()).

Bug: 28286051
Change-Id: I7ca732e195d2ddcdc1a93b78aed21523b3461aa9
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
8111860ba116d84034b2aa21445feec71c65a9d4 19-Apr-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: support platforms with no audio devices" into nyc-dev
5a2b62984c7cecd1761fe272c078dd814c167942 15-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: support platforms with no audio devices

Remove requirement to declare an AUDIO_DEVICE_OUT_SPEAKER device
for platforms without audio output.

By convention:
- platforms without audio output should declare a single output
device of type AUDIO_DEVICE_OUT_STUB also declared as default
output device
- platforms without audio input should declare a single input
device of type AUDIO_DEVICE_IN_STUB

Platforms with no audio at all can use stub audio policy configuration
file and audio HAL with the following instructions in device.mk file:

USE_XML_AUDIO_POLICY_CONF := 1
PRODUCT_PACKAGES += \
audio.stub.default
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/audio_policy_configuration_stub.xml:system/etc/audio_policy_configuration.xml

Bug: 25075342
Change-Id: Id700978559427edd3c7cc38d98f2fd52928367ed
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
3f5eba440fa87637211f1d3b3f0061fc37065636 19-Apr-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: modify ringone volume attenuation over headset." into nyc-dev
d3926fe68ffd8d156e7c019277bbeb32ca786d8e 16-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: fix call volume regression

Commit 1fd372e4 caused a regression preventing to
change in call volume.

Bug: 28223472
Change-Id: I31bd220ebdde1175c2f0a5ef1e874e86c6615ff8
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
6af1c1dc8954a555c6c6ef07d4f93e243d7f08cf 14-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: modify ringone volume attenuation over headset.

Do not limit ringtone volume over headseet when combined with speaker and
no music is playing.

bug: 26769982

Change-Id: I5309bf0d672cca67c69a15b73ee2ef34a220d42a
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
8c808a220fc155cc7bbe94e43125f2a25a4441a5 14-Apr-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: fix dynamic audio policy device address forwarding" into nyc-dev
c40d96943ddebd31578f30517457f88e6e894eb1 14-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: fix dynamic audio policy device address forwarding

Make sure the device address is passed to audio HAL when opening
the output stream or changing device selection.

This is needed for dynamic audio policies with MIX_ROUTE_FLAG_RENDER.

Bug: 25448664
Change-Id: Iff7f733f6cad54753b0b5b0166303e97ea24e284
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
8ae73129e7e79d826b293238c2f037f723d0e6e8 12-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: fix call audio over 24 bit USB device

Take into account voice RX source device properties when
configuring the audio patch bridging the voice RX device
to the USB output device.

Bug: 25643110

Change-Id: I06f282d3cc12493f21500bf9ab35a3ceb93f14af
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
1fd372e40ef40643fa9d036a0c9db043475b1b02 06-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: fix volume burst on user switch.

Fix two main problems in setStreamVolumeIndex():

1) the conventional initialization or user switch behavior consisting in first
applying volume for AUDIO_DEVICE_OUT_DEFAULT device which resets all volumes
and then apply device specific volumes is problematic: if this is done while
a stream is active, it will temporarily reset the volume to its default
(usually loud) and then back causing an audible glitch.

2) The logic consisting in applying the requested volume to all outputs with a
device selected by the routing strategy corresponding to the requested stream
is problematic: it will cause device specific volumes for other devices than
current one to be applied to active streams.
Restrict the logic to cases of multiple device selections including the
requested device.

Bug: 27557733

Change-Id: Ia14cd51766a7516c42221abff76843d47699105f
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7c6a1621ef253989ab44cf68904531b35ae8b0b1 01-Apr-2016 Phil Burk <philburk@google.com> Merge "AudioPolicyManager: remove 5.1 channels for Surround Settings NEVER" into nyc-dev
0709b0aba2adb719d347341ff58441347a1c1582 31-Mar-2016 Phil Burk <philburk@google.com> AudioPolicyManager: remove 5.1 channels for Surround Settings NEVER

This allows people with TOSLINK to hear the correct stereo PCM
when listening to movies.

Bug: 25144047
Change-Id: I88401c016dd5a3a469becb019540c04befe78bba
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
e85b9da2b3b8461724067cb927d20666ab09e3fd 01-Apr-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: fix in call volume over USB" into nyc-dev
18fba84019d778b3c20875d93f9f36c2410ecf33 31-Mar-2016 Eric Laurent <elaurent@google.com> audio policy: fix in call volume over USB

Do not consider only primary output for voice volume control as
sometimes the output device selected for a call can be connected to
another output stream (e.g USB)

Bug: 27108587
Change-Id: I8ec3db272f87d49f57044a771019672050f63d32
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
00eeb32846df81288f12fe4c83e61d7db2842226 31-Mar-2016 Phil Burk <philburk@google.com> AudioPolicyManager: only modify surround formats for HDMI devices

USB devices were getting modified by mistake.

Bug: 27938796
Change-Id: Ib62f6df804f8e578a702aba93439ff7cbfe3347a
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
a13cde98a880341f0a56d91da6364b093fb5d24e 29-Mar-2016 Glenn Kasten <gkasten@google.com> Use audio_module_handle_t and audio_patch_handle_t consistently

Bug: 27814144
Change-Id: I54b7a73ec318779fd3addb060998f4d94141152d
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
fd7dc4c764e6ec1136439188f75839094ff01917 28-Mar-2016 Phil Burk <philburk@google.com> Merge "AudioPolicyManager: always force AC3 on for TVs" into nyc-dev
07ac114c3965e16fe523f88c913e701602604589 25-Mar-2016 Phil Burk <philburk@google.com> AudioPolicyManager: always force AC3 on for TVs

Most TVs support AC3 but they do not report it in their EDID.
This changes forces support for AC3 unless turned off by Settings.
This change allows broadcast TV to work by default.

Bug: 24541671
Change-Id: I9e8cf194198db3811f91149014ef29e46972ad2c
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
fdb90f355b269737fe48a2da0593b37d5c2b83c1 25-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Merge "RENDER dynamic policies: fix address check" into nyc-dev
5ac8cd425e1a0c4287c0bb84f922fef4fa106411 25-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> RENDER dynamic policies: fix address check

Fix mix / output address comparison when registering dynamic
policy mixes with a MIX_ROUTE_FLAG_RENDER flag.
Fix mix registration code path where the matching output is
not found, but no error is reported.
Improve logs.

Bug 25448664

Change-Id: I3679aead00304b38f7cc42dd9083644450771a15
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
6b1255bdd3d8d941f4952a98eadf3b454f36a2a9 11-Mar-2016 Glenn Kasten <gkasten@google.com> Fix typos in use of %#

Change-Id: I5e49f89dc0e49bc3f5f2d3922d390982a3773384
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
a8d309df2f603767c0f0ad9248aef47a5b6ed5b8 17-Mar-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: fix HW A/V sync rerouting" into nyc-dev
14cbfcae68582eca97f1a8168c584254515879ee 17-Mar-2016 Eric Laurent <elaurent@google.com> audio policy: fix HW A/V sync rerouting

Do not allow HW A/V sync tracks to be attached
to a PCM mixer as those tracks carry time stamps in band.

Cherry pick of c576f6a0 from lmp-mr1-tv-dev.

Bug: 25293500.

Change-Id: I1f080232e439a410ded25ca8e461113a96687a3b
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7638ca29e8400a19524adb982e9d22c02786de82 05-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Dynamic policies: support for device selection

Dynamic policy mix: rename "registration" field to device address
as this reflects the true use of the field.
AudioPolicyManager: dynamic policy registration differs depending
on policy routing flags.
When register a mix with the RENDER flag, iterate over all outputs'
patches to find a matching device and address.

Bug 25448664

Change-Id: I71584081e7f1b2b5252fb6c4659fdeb464f7d282
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
794fde269478b50be873d9d93574b8aa2b6afc42 11-Mar-2016 Eric Laurent <elaurent@google.com> audio policy: fix volume control regression

commit 28d09f064 introduced regressions in volume control resulting
in changing some device/stream volumes unexpectedly.

The problem was in the logic consisting in considering streams equivalent for
volume control based on their associated strategy: The rule is wrong because it
causes a volume change on a given stream to cause the same change on all streams
sharing the same strategy. For instance stream SYSTEM and MUSIC share the same
strategy and changing SYSTEM stream volume would change MUSIC volume.

The new rule just considers the stream type when deciding if two stream share the
same volume control.

Also fixed possible calls to getStrategy() with stream PATCH causing asserts.

Bug: 27586382

Author: Eric Laurent <elaurent@google.com>
Date: Tue Mar 8 10:43:05 2016 -0800

audio policy: improve accessibility volume

Change-Id: I3fe2a25767319800b0db5fd1ed7c1bd751b04732
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
28d09f06422841b4274d7fed6ad3441dc97382b2 08-Mar-2016 Eric Laurent <elaurent@google.com> audio policy: improve accessibility volume

Fix some regressions caused by the introduction of accessibility
stream type and strategy in M.

- change the way ACCESSIBILITY usage maps to a given strategy: always map
to strategy ACCESSIBILITY but implement a specific device selection for
strategy ACCESSIBILITY in getDeviceForStrategy(). This makes sure that
accessibility prompts always use ACCESSIBILITY stream type.

- optimize getDeviceForStrategy() to avoid reloading the list of outputs
and devices from the observer when called recursively.

- make sure that all volume APIs also take into account ACCESSIBILITY stream
when called for MUSIC stream. Generalize the concept of matching strategies
for straqegies that should be considered equivalent for volume control.
Modifications in:
- initStreamVolume()
- setStreamVolumeIndex()
- isStreamActive()
- getDevicesForStream()

Bug: 25067903
Bug: 25616373
Change-Id: Id8c7dd3231f79572b278407bc73186fc42dcc028
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
0494ebbeda158681dbe0c7cf68abfd475a19d139 03-Mar-2016 Phil Burk <philburk@google.com> Merge "AudioPolicyManager: remove unnecessary device reconnection" into nyc-dev
62b5c0c28becab95727739889ee762f727c2a462 03-Mar-2016 Eric Laurent <elaurent@google.com> Merge "audio flinger: fix offload track underrun" into nyc-dev
1e3acb84fcab8f00dba0a78ad4badaef4ba3869e 03-Mar-2016 Eric Laurent <elaurent@google.com> Merge "AudioPolicy: capture sample rate 0 is route-specific default" into nyc-dev
517161856d74f5fe39cce131f29b977bc1745991 01-Mar-2016 Eric Laurent <elaurent@google.com> audio flinger: fix offload track underrun

Fix offload track underrun detection causing early disabling
of offloaded audio tracks.

Optimize sleep time in case of underrun to avoid spinning while
waiting for new data.

Re-enable offload when streaming

Bug: 26668110

Change-Id: I874728c69647ac05e1effb84c48700a6d0ac7435
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
878e32d7cefc19d86cd0602eda6101961edad6fa 03-Mar-2016 Phil Burk <philburk@google.com> AudioPolicyManager: remove unnecessary device reconnection

This is now handled by a device reconnection in the AudioService.

Bug: 27434478
Change-Id: I2182b205c2b72cebff657a7bbee95df97f97eb55
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
702b105b290d9a3c8b23f3c809a79086d784c9be 03-Mar-2016 Phil Burk <philburk@google.com> AudioPolicyManager: fix device enumeration

The AudioDeviceInfo only had PCM_FLOAT because the device enumeration was
stopping because of an error. The error was detected by new code
in the AudioFlinger.

The root error was not clearing a variable after a close.

Bug: 27457547
Change-Id: I529a26c8c0a688863bcf316ad365feddc303fe43
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
05ddca504ce8e0e61b41e5c1aebea72086eea57b 11-Feb-2016 Glenn Kasten <gkasten@google.com> AudioPolicy: capture sample rate 0 is route-specific default

Bug: 25641253
Bug: 21019153
Change-Id: I7d193640572c08ab5e5f1ecfc8ad6d31635967dd
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
e8158ffea27c9526547a7340dc5a085b8582033e 01-Mar-2016 Glenn Kasten <gkasten@google.com> Merge "Add use for audio_unique_id_t" into nyc-dev
eeecb980ff4c202d0a3c4b0bfe040dce2f73336d 26-Feb-2016 Glenn Kasten <gkasten@google.com> Add use for audio_unique_id_t

Bug: 25641253
Bug: 21019153
Change-Id: I65dc128e760c245f3d90559635a8981b186c87d7
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
09bc4612bdd5874d744c5da1183d96fbd2ad0235 25-Feb-2016 Phil Burk <philburk@google.com> AudioPolicyManager: force encoded surround setting

Bug: 26373761
Change-Id: I0f7a486bf1aa7a27f15cf220e2c75ef23f8f8536
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
ff155c642fe7d342a3110444c6103f788230af53 26-Feb-2016 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicy: AudioOutputDescriptor set/get for patch handle

For symmetry with AudioInputDescriptor: no direct access to the
field for the patch handle.

Change-Id: I5bffecf7a157ec042d749064208bc6c279008542
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
8c7cf3b7d0d7bccb9affbc34ae2ab2d6b332f972 26-Feb-2016 Jean-Michel Trivi <jmtrivi@google.com> Send audio patch in recording callback

Remove direct access to patch handle in AudioInputDescriptor, replace with
set / get functions.
Add interface for AudioSession to query configuration from enclosing
input descriptor.
When input descriptor's patch handle changes during a recording, propagate
the change through the recording notification callback.

Bug 26798796

Change-Id: Ia1395d44da7ccfe69ca46877638d1eb49b3935ad
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
232f26f8b673973ffa463f80b08b731ffacc8785 18-Feb-2016 Eric Laurent <elaurent@google.com> DO NOT MERGE - audio policy: disable concurrent capture

This reverts commit 4342335fb84bfa4ec5b99e3ef82f186820c2275f.
This reverts commit 56afc7a5cc0f0bfc8021f6413b2e2267050bdc8a.
This reverts commit 313d1e7dfb4bf8e0a2f09a9adb287062dd64410c.
This reverts commit fb66dd9f95a1168698f072c4e5c2a2cf8c49a80f.

Bug: 22702906

Change-Id: I9085918f1f7b12e28430958cceb768bb29c12bdb
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
b74dc56b2fd3ec872383544d4b6d4950c206259b 18-Feb-2016 Wei Jia <wjia@google.com> Merge "AudioPolicyManager: add comment for disabling offload when streaming." into nyc-dev
4ca44d77ede74eda712fbae80700dc92d5922e02 18-Feb-2016 Wei Jia <wjia@google.com> AudioPolicyManager: add comment for disabling offload when streaming.

Bug: 23499384
Change-Id: I74214c9cb444b10a6f50ffe499938945c063afca
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
de223b40b81450703980667ffffc766a16c3447c 18-Feb-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: select output with best sample format match" into nyc-dev
e693002b0fb25099540588245892ed98103749ba 11-Feb-2016 Eric Laurent <elaurent@google.com> audio policy: select output with best sample format match

Add rules allowing selection of the output stream with the sample
format offering the best match to the client track sample format
when more than one output is compatible with a request.

Bug: 27210844

Change-Id: I31981940be5d1c06d713d52187cfb0a7bf355773
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7b8d434379e486ff32d43875676f423ce9ee1c05 17-Feb-2016 Wei Jia <wjia@google.com> AudioPolicyManager: disable offload mode when streaming.

This is a temporary work around until the root cause is fixed in offload
playback path.

Bug: 23499384
Change-Id: I1ee8197ba8995084287ef9385a0f6a30e4bb9351
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
b0a144d705a021994628d136a170a6d2bd4282e7 12-Feb-2016 Phil Burk <philburk@google.com> Merge "AudioTrack: support ENCODING_IEC61937" into nyc-dev
fdb3c07db5d44535eb8c3ec46dc78ad8446c01eb 09-Feb-2016 Phil Burk <philburk@google.com> AudioTrack: support ENCODING_IEC61937

Set DIRECT flag.
Use audio_has_proportional_frames() instead of audio_is_linear_pcm()
where appropriate.

Bug: 24541671
Bug: 20891646
Bug: 26373761
Change-Id: Ia32036b18683b084d6c9887593df87397ea0afd9
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
e8decedb429ed76dfa84cdb3e80ab3b969e77298 11-Feb-2016 Jean-Michel Trivi <jmtrivi@google.com> Dynamic audio policies on UID

When looking for an output, take attributes and UID into account.
To find the matching mix: for each mix
- inspect which rules are used
- find a candidate mix for usage
- check UID compatibility
Rename AttributeMatchCriterion to AudioMixMatchCriterion to be consistent
with the fact that now mixing rules are not always about audio attributes.

Bug 26798796

Change-Id: I1520b0df190a98f197ea8e0144b770e1e6d97888
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
52785f3df24fe817af4f1c3c2cddfb30ab5450ee 10-Feb-2016 Chris Thornton <thorntonc@google.com> Call SoundTrigger::setCaptureState in AudioPoilcyManager::closeAllInputs

closeAllInputs wasn't informing the sound trigger service that all
inputs were closed. This meant that the service could get stuck in a
state where it was disabled because it thought there was some active
capture, even though there was nothing listening. (This was particularly
common when a bluetooth device disconnected).

BUG: 26970013,26450651
Change-Id: I613434ecacce3ef03a657008fd94c314948ba2b8
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
62e4bc53be19e96f8e37e850b9c8a9e15b9e2ba6 03-Feb-2016 Eric Laurent <elaurent@google.com> audio policy: strengthen dynamic audio profile intialization

Add some robustness to getParameters() reply parsing
in AudioPolicyManager::updateAudioProfiles().
Some audio HALs may respond with more than just the parameters requested.

Change-Id: Id9327604f521f9fb5636ff93cb6a7c3c23c86778
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
56afc7a5cc0f0bfc8021f6413b2e2267050bdc8a 03-Feb-2016 Jean-Michel Trivi <jmtrivi@google.com> Fix connection of OUT_REMOTE_SUBMIX device on APM startInput

Fix a regression in AudioPolicyManager::startInput() where
the OUT_REMOTE_SUBMIX audio device was never made available
due to the test on the input descriptor, which was already
active by the time it is tested, as the activity on the
session has already been updated.

Add methods to AudioInputDescriptor and AudioSessionCollection
to query the number of active sessions. Use the new method
to optimize AudioSessionCollection::hasActiveSession()

Bug 26798796

Change-Id: I2de4e47970505e64c4c78a148a80a9f0ec19e821
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
2e5408ac3e51cb459160b9cd392f1809b0758316 01-Feb-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: fix set volume with explicit audio patch"
706de969169a8f651726ab7de7302a3d35b39768 01-Feb-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: fix loss of audio patch client UID"
e04e62bc05316d9682688f87053be5cf47e9c707 30-Jan-2016 Eric Laurent <elaurent@google.com> audio policy: fix set volume with explicit audio patch

setStreamVolumeIndex() receives both a stream and a device as inputs.
When an explicit audio patch is requested on an output mix, it
is possible that the active device does not match the strategy
derived from the stream, in which case the function would not update
current volume.
This patch makes sure that the device explicitly passed to
setStreamVolumeIndex() is always taken into acount.

Change-Id: Ie496ff70f059166af6c81c8f8445a9a9c7548a72
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
bacd9d7ae33d831f9b8b3a0bc7ba8d367164a1d0 30-Jan-2016 Eric Laurent <elaurent@google.com> audio policy: fix loss of audio patch client UID

If an explicit audio patch is present on an output mix,
its client UID should not be reset by default when the device is updated
on this output mix.

Bug: 26423115
Change-Id: I87973e62d6eeb6f8fef3780bd67f58ae52d07812
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
313d1e7dfb4bf8e0a2f09a9adb287062dd64410c 29-Jan-2016 Eric Laurent <elaurent@google.com> audio policy: fix input device selection

Make sure session activity count is incremented before
selecting device in startInput().

Bug: 26841909
Change-Id: I0b4867b9ad4c7a98e5eddb4f1f23c4cf075f074e
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
fb66dd9f95a1168698f072c4e5c2a2cf8c49a80f 29-Jan-2016 Eric Laurent <elaurent@google.com> Revert "Revert "audio policy for concurrent capture.""

This reverts commit 84332aaa807037baca05340875f2d94fcc519ac4.

Bug:26841909
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
84332aaa807037baca05340875f2d94fcc519ac4 28-Jan-2016 Eric Laurent <elaurent@google.com> Revert "audio policy for concurrent capture."

This reverts commit 4b2fcd8abf90b1bd95539f9f4ef2ac39ce9e2df1.

Bug:26841909

Change-Id: Ifc74b195394b9fb3f73d33455ad061bd896d5331
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
4b2fcd8abf90b1bd95539f9f4ef2ac39ce9e2df1 16-Jan-2016 Eric Laurent <elaurent@google.com> audio policy for concurrent capture.

First implementation of concurrent capture policy:
Initially, only capture for HOTWORD or FM TUNER sources or
re-route submix is allowed at the same time as any other capture.
Several capture clients can share the same input stream. In this case
active clients are sorted by audio source priority level and the input
path configuration and routing is driven by the highest priority
active source.

Bug: 22702906

Change-Id: Icbedfe001c6243ecad7a7b57ab78d893b2b97402
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
a03910b23a31058eea178e8d3f5e84fcf852d5c2 27-Jan-2016 Eric Laurent <elaurent@google.com> Merge "audio policy: fix merging error for commit 112b0af8."
20eb3a4340a1f1f6e978a23527daff080140db1a 27-Jan-2016 Eric Laurent <elaurent@google.com> audio policy: fix merging error for commit 112b0af8.

Wrong patch set was merged from partner gerrit.

Change-Id: I850d61b1cc8682e0a82ee64bc8cb022b7512de1c
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
d1ab2bd4f1ea166a7e9e81cfd7f3e5dd47135d4d 02-Dec-2015 François Gaffie <francois.gaffie@intel.com> audio policy: move volume table to XML file

This patch allows to store in XML file volume tables.
The compatibility is maintained for legacy conf file.
Configurable Engine is only compatible with new XML conf.
This patch removes from configurable engine Structure / Settings the volume
table but keep the configurabllity of switching volume profiles from
one another according to criteria like phone state...
(ex: DTMF stream type is following Voice Profile in call)

Change-Id: I78c91bc3378b6c47202abe7b5c1c1e011ff62eed
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
f4ad6e5637b6deccdac4b60615383f290b3806cf 19-Nov-2015 François Gaffie <francois.gaffie@intel.com> Audio policy: implement configuration file in XML

This patch introduces configuration file of the policy in XML.
Legacy configuration file is used by default and
compilation flag USE_XML_AUDIO_POLICY_CONF must be defined to
use XML file format.

Change-Id: I352b788b5829d42ed82c851a4faef0e526be582e
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
c16bf1d9e8ccdd27327e988d50f5b9640e5406f8 13-Jan-2016 Jean-Michel Trivi <jmtrivi@google.com> Merge "AudioPolicy: callback for recording configuration change"
2f4fe9f7df8f22c6bc8745407d19df73128810ec 05-Dec-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicy: callback for recording configuration change

Each AudioSession tracks start / end of recording, and sends
a callback to AudioSystem.
AudioSystem tracks a single recording callback tracking
input source and audio session number.

Change-Id: Ic065751d9ba013e03f2a6ad8dde02542e5465ec0
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
2ddee19245641e86bca436dda23a0f5089bf2ab5 19-Dec-2015 Andy Hung <hunga@google.com> Add setMasterMono and getMasterMono

Bug: 15283594
Bug: 22700363
Change-Id: I32dc1fcecf285967a61bd508af3bb299595db57d
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
112b0af826aeca45855690b9c105b2cdf9938bbe 19-Nov-2015 François Gaffie <francois.gaffie@intel.com> audio policy: introduction of AudioProfile

In order to be able to declare the possible sample
specifications for an Audio Port (a given format, a list of
sample rates, a list of channels), a new object AudioProfile is
introduced.

Change-Id: Ie3ca3400f05984e7b4132fc7ba90020eb4d998c7
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
599c758b258cc5da0dba9b530425381facc37d77 08-Dec-2015 Eric Laurent <elaurent@google.com> audio policy: audio sessions on input descriptors

In preparation for concurrent capture, add support for multiple
audio sessions per input stream.

Each session keeps its own properties, open and active reference
counting.

No functional change for now: still one session per input and one active
input at a time.

Bug: 18815985.
Bug: 22702906.

Change-Id: I915a65989a7fd0d3cbe2fcf5a0aee2ea0df5f4f5
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7b279bbc24139ee1e01b58055ca94926ec18e2e9 14-Dec-2015 Eric Laurent <elaurent@google.com> audio policy: remove compilation warnings

Change-Id: I4d41ca903dfbe37066ef20a13ebabaff1e5b7326
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
65bfe916ca972b95f41d7f6cc2566c2e12a3eada 05-Dec-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: AudioInputDescriptor open ref count cleanup

Always initialize the mOpenRefCount field.
Add functions for management for open ref count.

Change-Id: I0bbd021283047abfebbc108ced68c79e29297f25
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
a8ecc2c72ca26389bd6b0162181d60aaeaca8149 09-Nov-2015 François Gaffie <francois.gaffie@intel.com> audio policy: remove deserialization from policy objects

This patch removes the responsability of the deserialization of all
objects managed by the policy by:
-adding required accessors
-moving deserialization function to Config parser helper
-adds a TypeConverter to associate string to / from values of all
audio enumeration shared between HALs and policy.

Change-Id: I1ce798848f4657b37e47446c9fbdc63f7ed0390e
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
d60560af7cb559762593161c8202459cc01fb0f5 10-Apr-2015 Eric Laurent <elaurent@google.com> audio policy: add support for external audio sources

Add support for activity on external audio sources.
An external source reflects activity on an input audio device
that must be controlled (both routing and volume) by the
audio policy manager.
First, the input device must be connected with setDeviceConnectionState().
Then, the source activity is indicated with startAudioSource() and
stopAudioSource() APIs.
startAudioSource() indicates the source device with an audio port configuration
and the use case by the audio attributes.

Once a source is active, its routing and volume are controlled by the policy manager
as it would for a software source (AudioTrack).

Change-Id: If5805d58a4356b2f681f1aabf54375f62b55b98a
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
d90d042269d174104cbcddb078f835296571cf87 16-Oct-2015 Eric Laurent <elaurent@google.com> am adf760b9: am fba67941: am 0eb5a270: Merge "audio policy: fix transition from VoIP to voice call on USB" into mnc-dr-dev

* commit 'adf760b98f22597bd0133c67af40d983a3e014c6':
audio policy: fix transition from VoIP to voice call on USB
9690bf3690c9b720656cebf6da390800e7395213 15-Oct-2015 Eric Laurent <elaurent@google.com> am 27d07a9a: am 26639898: am 0926aab4: Merge "audio policy: fix USB mic selection for VoIP" into mnc-dr-dev

* commit '27d07a9a0366bab299a4b08c24e9bc4e94d14ac0':
audio policy: fix USB mic selection for VoIP
c0a889f766953b657a5e997bc1362661806d3a19 14-Oct-2015 Eric Laurent <elaurent@google.com> audio policy: fix transition from VoIP to voice call on USB

Make sure no active capture takes place while in call and the
capture device is the same as the call TX device.

Bug: 23977713.

Change-Id: Ia379d5e626c150ea49f0cdd581c881dbf0b8399d
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
c171c7c47d099a52ade95c3c8d8907bf09bb88fa 25-Sep-2015 Eric Laurent <elaurent@google.com> audio policy: fix USB mic selection for VoIP

When transitioning from speaker phone to normal mode and a USB
headset is connected, we must force a teardown of active input
as the new input device cannot be reached via current input stream.

Bug: 24406915.
Change-Id: I9f7c1d3f3cba285c25a6da1d54a3d15a5c1f378a
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
f63ae125ca8fc9e430694413b701d3667f3fd63a 24-Sep-2015 Eric Laurent <elaurent@google.com> am 3d036a8f: am 8c8d9779: am 45fd99a3: Merge "audio policy: fix preemtible capture race" into mnc-dr-dev

* commit '3d036a8f4ce9ba2a07593b21ef63d83c8a43816e':
audio policy: fix preemtible capture race
64265b2fb8f5be63b6c2ad4fcbec9acf74705bc4 19-Sep-2015 Eric Laurent <elaurent@google.com> audio policy: fix preemtible capture race

Because a preemtible capture session can preempt another one,
we end up in an endless loop situation were each session is allowed to restart
after being preempted, thus preempting the other one which restarts and so on.

To avoid this situation, we store which audio session was preempted when
a particular input started and prevent preemption of this active input by this session.
We also inherit sessions from the preempted input to avoid a 3 way preemption loop etc...

Bug: 24007220.
Change-Id: I0eab5299440ef3ab9e987635dc9a300cf42f2c79
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
4137d521e2be255ee109a6c59a1cd273b9029a4c 16-Sep-2015 Jean-Michel Trivi <jmtrivi@google.com> am 373c7621: am d3fa3c14: am 20baac2a: Merge "AudioPolicy: don\'t always change ACCESSIBILITY volume" into mnc-dr-dev

* commit '373c7621e21f8f15b4514e719030eb9ca7ebcfe6':
AudioPolicy: don't always change ACCESSIBILITY volume
af20bc26704458eac0ddc23f12b637939b0df7a4 15-Sep-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicy: don't always change ACCESSIBILITY volume

Only change the volume for AUDIO_STREAM_ACCESSIBILITY when
changing the media volume.

Bug 23366575

Change-Id: Ic42c726ec4d47615c20500c20e4d43cef159b3c6
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
b367f5b2de343bfd9040028b00acb96567f30bea 25-Aug-2015 Ravi Kumar Alamanda <ralama@codeaurora.org> audiopolicy: do not update channelMask for voice input source

It's not needed to update the channel mask based on source because
the source is sent to audio HAL through set_parameters() and if source
equal to VOICE_CALL does not mean that two channels need to capture.
If recorder app selects AMR as encoding format but source as RX+TX means
both RX and TX are captured in ONE channel. So use channels set by the app
and use source for the type of capture (RX only, TX only, or RX+TX).

Bug: 23484531

Change-Id: Iedf23318356480ba939fc06df4ae4f12906322b3
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
a09f8cf8c76fa946c4b91be059b420941abcdc3b 14-Aug-2015 Eric Laurent <elaurent@google.com> Merge "audio policy: refine TTS stream mute management" into mnc-dr-dev
9459fb087c97c3cad66221821eb32755fdb9c9f5 13-Aug-2015 Eric Laurent <elaurent@google.com> audio policy: refine TTS stream mute management

Do not mute the TTS stream if a dedicated output for
TTS is available.

Bug: 22100304.
Change-Id: Ic126100ce1144f765bc0ae42c8ea87fa47cfb822
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
82db269d4797cb9909988b723d91fa2094a74b38 07-Aug-2015 Eric Laurent <elaurent@google.com> audio policy: protect capture from telephony RX path.

Add permission check if the capture device selected is telephony
RX path.

Bug: 23017158.
Change-Id: Iaa34d836e6cf46b7cbbf2483fcd4306dcd27ce90
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
45aabc3578f2362b82f5a425d44e75d4266b1c8c 06-Aug-2015 Eric Laurent <elaurent@google.com> audio policy: populate attributes for attached capture devices

Populate supported sampling rates, channel masks and formats when enumerating
attached build in capture devices.

Having this information for build-in mic is important for some applications.

Bug: 22729461.
Change-Id: I93f03296447a87c10f2615fa1b1c45e9879b4aa7
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
5de234b29141334c1bb5e40bc19c11836848841b 21-Jul-2015 Jean-Michel Trivi <jmtrivi@google.com> Prevent notifications from muting accessibility prompts

When evaluating on which device a sound is to be played, the policy
must consider which current routing strategy, if any, has priority
for overriding the choice. Here the playback of notifications,
when duplicated over speaker and headphones, was causing the
accessibility prompt to be muted because the it was of a higher
priority, and incompatible with the accessibility routing.
The fix consists in assigning a higher priority to the accessbility
routing strategy over the notification routing strategy.

Bug 18834451

Change-Id: I8228b30a7d80bd61d1c223afb030d9421d4f33cf
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7c1ec5f038e63a5eb8b04434577c25bc23f5f410 09-Jul-2015 Eric Laurent <elaurent@google.com> audio: several fixes in audio routing callbacks

- audio policy:
Force device change to ensure new audio patch creation
upon first track activity on a given output.
Fix function device_distinguishes_on_address() which could mistake
some output device with remote submix input device.

- audio flinger:
Reduce number of binder calls upon new client registration by only
sending ioConfigChanged() callbacks to newly registered client.
Fix first patch after output thread creation not triggering an
ioConfigChanged() callback.

-audio system:
Force client registration upon routing callback installation to force
new ioConfigChanged() callback from audio flinger.

Bug: 22381136.

Change-Id: Ieb0d9f92f563a40552eb31bc0499c8ac65f78ce4
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
54c0659b9efa72d11997c590c4d377c44789c7fd 08-Jul-2015 François Gaffie <francois.gaffie@intel.com> audio policy: session route: move SessionRoute to common

Move the SessionRoute and SessionRouteMap inner class from policy
manager to common policy pillars as initiated by the refactor.

This code was added at teh wrong place by commit aa981194.

Bug: 22376521.

Change-Id: I29aca21614e409c59aae4b7b14163552fb0bffb1
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
63dea1d5334acf3baa9448086dd504ead57d814b 03-Jul-2015 Eric Laurent <elaurent@google.com> audio policy: fix regression in incall notification management

Commit 2110e04c introduced a regression preventing ongoing alarms to
be restored when exiting a call and leaving the replacement tone
playing for ever.

Also add missing management of accessibility prompts when entering a
call.

Bug: 21857005.
Change-Id: I4295c791c003db42c0fba9f618e51f60438158d1
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
cc750d3604b33a92374253b12dd739dc06440aad 25-Jun-2015 Eric Laurent <elaurent@google.com> audio policy: fix several device descriptor issues.

- checkOutputsForDevice() should only clear device descriptor attributes
if the device is digital.
- checkInputsForDevice() did not clear device descriptor attributes at all.
- AudioPort::clearCapabilities() and importAudioPort() should not
manage gains as these are device specific.
- importAudioPort() should load a default port config.

Bug: 21990937.
Change-Id: Ida762ed8f9baaabae392cb4291eff1a8d3009751
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
9080a4cd8c4e22ddae0350c0c51a20cea1a41016 18-Jun-2015 Paul McLean <pmclean@google.com> Fixing no rates, chans & encodings on input devices for device enum API.
Filtering digital attributes for non-digital audio devices.

Bug: 21876072
21903975

Change-Id: Ia5c81a8160f4b4ebf5941dd0c5dfb68d01699ca6
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
3fc792fe36b0b9100f74185665221b37f650ff65 18-Jun-2015 Eric Laurent <elaurent@google.com> Merge "audio policy: fix explicit routing and accessibility" into mnc-dev
439e4ed408c21bd65711d279bd5251cef7e83440 03-Apr-2015 Ravi Kumar Alamanda <ralama@codeaurora.org> audiopolicy: use deep buffer output by default for music streams

Default disabled. This is enabled by

adb shell setprop audio.deep_buffer.media 1

Applications that use AudioTrack java interface for audio rendering
defaults to primary output as flags indicated as FLAG_NONE. If the
primary output is low latency output, it results higher power
consumption than deep-buffer path if used.
Make the deep buffer output as default option for music streams if
flags are not specified.

It may also be used for testing audio glitches from heavy CPU
or DRM which may cause issues with the FastMixer.

Bug: 21198655
Bug: 21785618
Change-Id: I909c296ddcf4484b9a877ef1c0230ea58537e06a
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
093a20cbe70d0033c085ef7be90b9f1bbacb3335 11-Jun-2015 Eric Laurent <elaurent@google.com> audio policy: fix explicit routing and accessibility

If a session has an active explicit routing request, this routing
must also be applied to accessibility prompts if accessibility
usage is currrently remapped to the strategy used by this session.

Bug: 20873151.
Change-Id: I97c6ece98cf1af9c64c2d2eb1fe382c7c0d657b4
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
72249d5b2f9f42a96c0e0825431e8f3f49b82644 08-Jun-2015 Eric Laurent <elaurent@google.com> audio policy: fix very verbose log build.

Change-Id: I94a69207059d8010ded14bce5d6e39c3f3074649
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
08945c44a97d3749cc48f860eb4e01e57183ad90 01-Jun-2015 Andy Hung <hunga@google.com> Add property to control audio offload with video content

Property audio.offload.video normally disabled (set to 1 to enable)

Bug: 21198655
Change-Id: Ib1c457b1e3950f18d91b855424aa80bd23c723b0
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
6374077319a2d060eefe5f4bf425aed37f90c5d0 22-May-2015 Eric Laurent <elaurent@google.com> Merge "audio policy: add checks on primary output" into mnc-dev
87ffa39d29d1803b48237888a9fbf3d5f2c60c21 22-May-2015 Eric Laurent <elaurent@google.com> audio policy: add checks on primary output

Check if primary output has been initialized before using it.
The primary output may not be initialized either due to HAL failure or
on devices without telephony.

Bug: 19573336.
Change-Id: Id1fc3ed588268e1232b43d1e6235254d2f1a71d0
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
861a628adbcbe7c3baa6eab1b765b87b480ff4a2 19-May-2015 Eric Laurent <elaurent@google.com> audio policy: fix direct output profile selection

Fix logic in AudioPolicyManager::getProfileForDirectOutput()
to select the direct output with most matching flags and not just
the first compatible one.

Also fixes issue 17783395 which was fixed by commit f7bc29b02
in lmp-tv-dev branch only but in a way that caused a regression
for HW A/V sync (issue 19384172).

Also removed duplicated code lines in getOutputForDevice()

Bug: 20819715.
Bug: 17783395.
Bug: 19384172.

Change-Id: I7fc793b37f9b53fabd92cab6b884ef85cfdafee4
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
c36a8897ff877f4c5b2e0580830faef8b87dd74a 25-Apr-2015 Ravi Kumar Alamanda <ralama@codeaurora.org> audiopolicy: Use AUDIO_OUTPUT_FLAG_TTS for TTS stream

Use AUDIO_OUTPUT_FLAG_TTS by default for TTS stream to see
if the HW supports a dedicated output for the same. If not,
fallback to primary output as it is done currently.

Change-Id: Ifb2ef7066e75c61fe4c1b9783c12627386a00ea5
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7288ab87a7aa730ffe97d7dc7e118123107bfcea 07-May-2015 Eric Laurent <elaurent@google.com> audio policy: clarify use of mName field for audio devices

The audio port field mName was used for two different purposes
which caused a problem when exposing this information at the SDK API.

Create a new "mTag" field storing the audio_policy.conf device tag
if needed.
Field "mName" is now used to store any additional name associated to
a given device when available (e.g Manufacturer and model name for a USB device).

Change-Id: I17fa872e4a3a2e1b7cbb807c6f72e095a8a2c9c5
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
5f9bf49397b36ad4ebd838aef66b83e9e9fa42bc 30-Apr-2015 Eric Laurent <elaurent@google.com> Merge "audio policy: session routes continued." into mnc-dev
8c7e6dac6f5eb38cef627dab92eac8b38513450c 22-Apr-2015 Eric Laurent <elaurent@google.com> audio policy: session routes continued.

- Clear session routes when client process dies.
- Enforce the route only when the requesting session is active.
- Fix requested route not working if an output mix change is required
(e.g forcing to SPEAKER when the default route is USB or A2DP).
- Make sure all sessions sharing the strategy with a rerouted session
have the same route (needed for volume control consistency)

Change-Id: I0ab347a8fb97e73e2c5965374544c5f4fe509ef1
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
d641af3e9faf6c053ccbeea1bc20790021e57a11 30-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> Merge "AudioSystem callback for dynamic policy mix activity" into mnc-dev
f613d42b12389335b2ecf06df18d0d095d6bfd44 24-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioSystem callback for dynamic policy mix activity

Add method to AudioPolicyServiceClient for dynamic policy mix
activity notification.
Propagate notification to a dedicated callback.

Bug 20226914

Change-Id: I37928ed38e15ea2b8fed022cccadeca8c4d6c876
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
466dc8ed6ca6b7f585104806c48613dd34e608c9 17-Apr-2015 Paul McLean <pmclean@google.com> Explicit routing in AudioRecord

Change-Id: I9cc5d54883a3e5c75d553fabb619fc8e49f4f9e5
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
7d7ea036436320b03bef826d78c4c035b67edbd0 24-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> Merge "AudioPolicyManager: notification of dynamic policy mix activity (input)"
493404d8c396e15ed73455acd39aa0f1940996e2 22-Apr-2015 Eric Laurent <elaurent@google.com> audio policy: fix AudioTrack output device selection

Have AudioTrack::setOutputDevice() set CBLK_INVALID flag instead
of calling restoreTrack_l(). This allows restoreTrack_l() to be called in
a safe context.

Allow device change while the AudioTrack is active by forcing a new
device selection in startOutput() if the output route for this
session was changed.

Remove some warnings.

Change-Id: I2d921a63c9bfa0e122233645e2d6d39f95f5f17d
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
2b0c1fc0d0ad3744a32d48234f255d82a5c80ded 16-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: notification of dynamic policy mix activity (input)

Use ref counting on start/stop inputs to notify audio policy client
of mix activity changes.

Bug 20226914

Change-Id: Ic4f9c91301d0bcbc0ff749acebdc3b2300309c38
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
554a277d4e42a3d3df3d90ba0e7dfa2d31690e32 10-Apr-2015 Eric Laurent <elaurent@google.com> audio policy: add binder calls for audio source control

Add binder methods to IAudioPolicyService to control activity
of external audio sources (e.g FM tuner).

Change-Id: I2008308a6a996baeae502b68a790d87281efe2ff
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
f129b03fa583d4cc26fd9c9171b8fb3b0ed8d4f4 07-Apr-2015 Andy Hung <hunga@google.com> Enable 8 bit and float pcm record formats for AudioPolicyManager

Add capability for handling different record channel masks.

Change-Id: I63f6b029aca5cefff7adf26198a3b594a7ea2d71
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
b6347ac62b36b4d9578d181ba83bf8e6446298e8 09-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix AudioPolicyManager dynamic policy initialization"
dacc06f5e8d00ace9d16a149fc41ff65323ffbb3 09-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> Fix AudioPolicyManager dynamic policy initialization

AudioPolicyManager::getInputForAttr() is initializing the AudioMix
for the new AudioInputDescriptor.
The audio policy manager refactoring introduced a regression where
the association of an existing AudioMix (registered when the
associated AudioPolicy was registered) with the input descriptor
copied a value of local scope, instead of referencing the
AudioMix in the list of mixes.

Bug 20081375

Change-Id: Iddd57fed8525880afd1d4a5493f97130aabe4816
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
ffbc80f5908eaf67a033c6e93a343c39dd6894eb 19-Mar-2015 Eric Laurent <elaurent@google.com> audio policy: volume in dBs

Volumes are now stored and exchanged in dBs to be
consistent with the volume tables.

They are converted if needed when applied to the target
gain controller.

Change-Id: I916cbb0bbe65c916444b8c65a2bdca9645c58399
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
c75307b73d324d590d0dbc05b44bce9aa89b7145 17-Mar-2015 Eric Laurent <elaurent@google.com> audio policy: volume control reorganization

Output volume and routing control by AudioOutputDescriptor
is reorganized to prepare hardware source volume and routing
control.
AudioOutputDescriptor contains all volume, device and activity
state common to software (audio flinger mixers) and
hardware sources (tuners, A2DP, HDMI).
A new class SwAudioOutputDescriptor is derived from
AudioOutputDescriptor and is specific to software sources.

Low level routing and volume control methods receive an
AudioOutputDescriptor parameter instead of an IO handle.

mPrimaryOutput is now an AudioOutputDescriptor.

Change-Id: Ie90943ee3102cdb8adf89fdd2addd2c279b1e5bf
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
3bcf8597189c592713675ec58326ecbef0ac4ae9 03-Apr-2015 Eric Laurent <elaurent@google.com> audio flinger: improve device to device audio patches

Allow creation of audio patches between input and output
devices managed by the same audio HW module.

Change-Id: I4b83268a4d5c41f3d5905d7581202cf5193efd32
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
322b4d25387a04c9afebe998326d005bbdf17ede 04-Apr-2015 Eric Laurent <elaurent@google.com> audio policy: fix unique audio port ID.

Remove mId member from AudioPort as it was shadowed
by mId in DeviceDescriptor.

Add getters for Id, and HW module name and version to device,
output and input descriptors.

Fix DeviceDescriptor name initialization.

Change-Id: I4a69f385e40330954d9dad5f2926c521f60b2ec1
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
aa9811945f575614b3482d09e4d969792701cebb 21-Mar-2015 Paul McLean <pmclean@google.com> Adding explicit routing API to AudioTrack

Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
887a9ed4446cb451181c392a0e51a69914e58fbf 01-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> Updates to AudioPolicyManager refactor

Use protected access in AudioPolicyManager class for
- engine field
- querying phone state
- isStrategyActive

Fix inclusion of AudioPolicyManagerInterface header.

Use "APM_" prefix in audio policy conf parsing code to avoid
naming conflicts with some HALs.

DeviceDescriptor and its collection class are good friends now.

Change-Id: I236d62a2b8a4b6bf68dd515932650b912577c145
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
2110e04cdfbf9ad85ce154ce5f778ee5ccfc95eb 24-Mar-2015 François Gaffie <francois.gaffie@intel.com> Split ManagerDefault into manager and engine

This patch defines an interface for a new component: policy engine.
The APIs found under this interface are the one we may want to customize
and to configure easily.
This patch also split the current manager code into manager and engine to
provide a default version of the policy engine.

Change-Id: I97cf59760b53d248fe9efe466ae5e73bd7e5cc06
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
dfd7409c1b708f6c429aa43722ca8493a91d8df0 19-Mar-2015 François Gaffie <francois.gaffie@intel.com> Create StreamDescriptor and associated collection within common

Create StreamDescriptor and associated collection within common
common policy pillar elements.
It moves the code from managerdefault and creates helpers function within
the collection.
It also split the AudioGain in a common volume header and AudioGain class.

Change-Id: I1bb80e4219506f8c9042367085db328d317cb668
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
df37269852ea92bafd939fe793209d0581c4a574 19-Mar-2015 François Gaffie <francois.gaffie@intel.com> Create SoundTriggerSession and associated collection within common

This patch creates a SoundTriggerSession and associated collection within
common policy pillar elements.
It moves the code from managerdefault and creates helpers function within
the collection.

Change-Id: I83ea230573c05e8ab99f4489c20059ed27678221
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
45ed3b053d9af2250f5ece9ee4e826905c3763a7 19-Mar-2015 François Gaffie <francois.gaffie@intel.com> Add EffectDescriptor and associated collection to common elements

This patch adds EffectDescriptor and associated collection to common
policy pillar elements. It moves the code from the policy manager
and creates helpers function in the collection.

It also factorize the RoutingStrategy structure within a separated header
file.

Change-Id: I29964ff77564fadedf3237c8754240b21ae77297
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
036e1e9126dcd496203434aa69e52115d8e730cc 19-Mar-2015 François Gaffie <francois.gaffie@intel.com> Add AudioMix and AudioMixCollection to common policy element

This patch adds AudioMix and associated collection to the common
policy pillar elements library.
It removes the code from the manager and creates also helpers function
associated to the mix collection.

Change-Id: Ia3536fdef09da13734d2895030d736c701040237
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
53615e29c99c5e9d2ca77aaefd7bf5c770513120 19-Mar-2015 François Gaffie <francois.gaffie@intel.com> Migrate helper functions from managerdefault to common

This patch moves from manager to common:

-parse helper functions of the policy configuration file
-collection helper function on
-output / input descriptors
-DeviceDescriptor
-AudioPatch / Audio Port
-IO Profile
-HwModule

Change-Id: If45e53418db75af1af198f43c4ef27884499055f
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
98cc191247388132b6fd8a4ecd07abd6e4c5a0ed 18-Mar-2015 François Gaffie <francois.gaffie@intel.com> Split ManagerDefault into Manager and ManagerDefinitions

This patch splits the managerdefault into a manager and a manager
defintion library that contains all pillar elements of a policy manager.

It renames the file with the name of the main class they contains.

It splits the AudioPort into AudioPort and AudioPatch.

Change-Id: I992cf0b8aed895805cc003ba0980d2c9e92c985b
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
ad3183e2d4cecd02f6261270a7ea1c68be0efa0f 18-Mar-2015 François Gaffie <francois.gaffie@intel.com> Audio Policy Refactor: reorganise headers inclusion

This patch reoganises the headers inclusion in order to prepare
the split of managerdefault into a manager and a separated lib
of pillar policy elements.

It also moves back the isStrategyActive to the manager to avoid
any dependancies from this pillars to the manager.

Change-Id: I1a35c45d86db7a3878a40dc7d6858dfea37c5ac9
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
acc930d104534dff89d5e336d22d2310069ca7c2 04-Mar-2015 Eric Laurent <elaurent@google.com> audiopolicy: Do not route VoIP call to HDMI

getDeviceForStrategy is returning AUDIO_DEVICE_OUT_AUX_DIGITAL
even when setForceUse is called with FORCE_NONE(earpiece)
during VOIP call.
Actual Intention is to route audio for phone strategy to AUX
device even after setForceUse is called with FORCE_NONE when not
in voice call. It is supposed to exclude VOIP call too.

Bug: 19522164.

Change-Id: I88d515c351f066305f9eed240b1fe5f60ef34f85
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
56ec4ffcbae8aeac6c5245fc7b825d02e2e6cefd 24-Jan-2015 Jean-Michel Trivi <jmtrivi@google.com> Refactor AudioPolicyManager

AudioPolicyManager implementation is now split into the
following files:

files managerdefault/Gains.*
class AudioGain
class VolumeCurvePoint
class StreamDescriptor

files managerdefault/Devices.*
class DeviceDescriptor
class DeviceVector

files managerdefault/Ports.*
class AudioPort
class AudioPortConfig
class AudioPatch

files managerdefault/IOProfile.*
class IOProfile

files managerdefault/HwModule.*
class HwModule

files managerdefault/AudioInputDescriptor.*
class AudioInputDescriptor

files managerdefault/AudioOutputDescriptor.*
class AudioOutputDescriptor

All files for libaudiopolicyservice are moved under service/

All files for libaudiopolicymanager are moved under manager/

Change-Id: I43758be1894e37d34db194b51a19ae24461e066e
/frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp