History log of /frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a8ee996bc065d6938c0e0a5904df7fff5d946fea 01-Feb-2018 Aniket Kumar Lata <alata@codeaurora.org> audiopolicy: Check if A2DP playback happens via primary output

Audio policy implementation assumes A2DP playback to happen
via HW module other than the primary HAL. This need not be true
always, since primary audio HAL can support A2DP playback too.
Add an API to check if A2DP playback is supported via primary HAL,
and if it is supported avoid suspendOutput.

Bug: 63932139
Bug: 68824150
Test: A2DP offload verified on supported codecs
Change-Id: Ic5546bc2df632462dcc28442af561d05ba2d7c58
(cherry picked from commit 68364ffbd312cdc28dd44e66c4d80ce5a6ec49ba)
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
5babc4f104885c16a3dcfdfb5d99903c27ff2bd9 15-Feb-2018 Eric Laurent <elaurent@google.com> audio policy: fix regression with duplicated output handle

Commit fe2311274 made that IO Handle for duplicated outputs
were not allocated properly causing volume commands to be sent
with an invalid IO handle to audio flinger.
We then hit another problem with a legacy behavior which broadcasts volume
commands to all output threads if received with IOHandle 0.

Bug: 70332110
Test: manual test.
Change-Id: Ib133abab1575e3c90ba235f0a52d5ab845514719
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
61309523e6332addbd648c0d1bf25d35d6fd7b90 23-Jan-2018 Jean-Michel Trivi <jmtrivi@google.com> Notifications are not duplicated over multiple devices

Sonifications follow media routing, except for speaker playback
where they follow the "safe" path when available in the
absence of media playback.

Test: 1/ plug headphones on phone, play notification, verify it
comes only from headset
2/ mirror device and play media, then notification, verify
it only comes from the speaker

Change-Id: I762ad0688e879ad1e5565b4b77a7393fa7ce7ac5
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
766fb020a50b64bf9a808bd80df60c54c2ca8cc3 06-Jan-2018 Nadav Bar <nadavbar@google.com> Support routing audio playback to telephony uplink

This change enables phone apps to play audio to the uplink stream
during a call.
This change maks the AUDIO_OUTPUT_FLAG_INCALL_MUSIC_UPLINK flag to be added to the flags that are sent to the HAL when an ongoing call is active, the chosen output device is the TX telephony device, the stream type is music, and the calling app has the MODIFY_PHONE_STATE permission.
For this change to take place, the following changes were made to the signature of getOutputForAttr in IAudioPolicyService:
1. Add pid (process id) parameter to getOutputForAttr.
2. Make the flags parameter a pointer so changed value can be
examined by calling function.

Bug: 69973354.
Test: tested manually.
Change-Id: I74cef3f8b66de6e0e8f87b6235130c2cdf423da7
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
bcbcb1bdda4f1970830fa4924e3a5f24171ae005 13-Dec-2017 Mikhail Naganov <mnaganov@google.com> audiopolicy: Add more tests, fix issues found

Added tests that ensure correct initialization of APM.

Fixed issues:

-- UB in VolumeCurvesForStream::volIndexToDb due to not
checking that the pointer is non-null;

-- AudioInputDescriptor::open and SwAudioOutputDescriptor::open
were not checking that the returned IO handle is valid,
this was causing an infinite loop in
AudioPolicyManager::selectOutputForMusicEffects, added an
assertion.

-- Memory leak of VolumeCurves collection in APM.

Test: audiopolicy_tests
Change-Id: Ia4ecca1dd03b74d7f93720f042da05d5a0c74a6b
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
733ce945741b1fc12cee92d8133c3136b4e6e0e0 07-Dec-2017 Eric Laurent <elaurent@google.com> audio policy: fix HAL stream activity ref counting

commit f05fc906 did not take into account the specificities of duplicated
outputs causing a crash when accessing the profile (null for duplicated outputs)
and not counting activity resulting from duplicated output activity.
Also account for HW source activity when connected to an output mix.

Bug: 70319466
Test: CTS tests for AudioTrack and AudioRecord
Test: audio smoke tests

Change-Id: Id0364170794302e42212a90e1b40e28c1e7193fe
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
447d53631b7560eace6016b2711a75533339cbcc 08-Dec-2017 Eric Laurent <elaurent@google.com> Revert "Revert "audio policy: fix regression in A2DP playback""

This reverts commit 460451e5d7b9813926fe8fc17283e77b63adaee7.
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
3974e3b22856ef35dd73760056ff38b7a4062176 08-Dec-2017 Eric Laurent <elaurent@google.com> Revert "Revert "audio policy: add open and active count for IO profiles""

This reverts commit 7b0e95327267f08e36b38fdd8fb2624e251b8e97.
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
53b810ead5b726994fe6a28c6fa955e7b8799aaa 11-Dec-2017 Eric Laurent <elaurent@google.com> audio policy: fix device address passed when opening HAL streams

Commit fe231127 caused a regression where the device address is
not passed properly to audio HAL by openInputStream() or
openOutputStream(). The address must be read from available
device descriptors, not supported devices in profiles which do not
have the current device address for removable devices.

Bug: 70321528
Test: audio smoke tests,CTS AudioRecordTest
Change-Id: I83211a31f86391b80c3c244b436a2e36923ccea0
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
7b0e95327267f08e36b38fdd8fb2624e251b8e97 07-Dec-2017 Eric Laurent <elaurent@google.com> Revert "audio policy: add open and active count for IO profiles"

Bug: 70319466

This reverts commit f05fc9061254a3329bf0a3b40e27cac87b51b4cc.
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
460451e5d7b9813926fe8fc17283e77b63adaee7 07-Dec-2017 Eric Laurent <elaurent@google.com> Revert "audio policy: fix regression in A2DP playback"

Bug: 70319466

This reverts commit 995ba712ed77e36129485f5ac811cf328d0a27f6.
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
995ba712ed77e36129485f5ac811cf328d0a27f6 06-Dec-2017 Eric Laurent <elaurent@google.com> audio policy: fix regression in A2DP playback

commit f05fc906 introduced a regression preventing playback over A2DP
to resume after the second time an A2DP device is connected.

Bug: 70245910
Test: Audio smoke test, CTS test for AudioTrack.
Change-Id: Ic6b5da96debf62be08ae12efec27ad36854fe3c5
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
f05fc9061254a3329bf0a3b40e27cac87b51b4cc 21-Nov-2017 Eric Laurent <elaurent@google.com> audio policy: add open and active count for IO profiles

Remove the hardcoded limit of one open output stream per IO profile
and add a max open count per IO profile.
Same thing for maximum number of active input streams per IO profile.

Now both the maximum number of opened streams and active streams for
a given profile is stored in that profile.

For now only defaults are set corresponding to legacy behavior,
but these values will be loaded form the audio policy configuration file.

Test: AudioTrack and AudioRecord CTS tests

Change-Id: I5ebcc7f8a06b3f0a52815d241c561bb65e036026
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
fe23112742eeb6199c3aa1f3dfcf800fc2aa0e26 18-Nov-2017 Eric Laurent <elaurent@google.com> audio policy: refactor output and input opening

Refactor the way input and output streams are open so that common
logic is centralized in AudioOutputDescriptor and AudioInputDescriptor
classes.

This is in preparation of adding reference counting for ouputs and inputs
opened for a given profile.

Test: Manual
Change-Id: Id806e23077eb41f6398400ab40aeaa694c7d5603
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
5cd72d8b4f07ced237eaaa24c24ca90c5832bac7 24-Aug-2017 Mikhail Naganov <mnaganov@google.com> audiopolicy: Fix null port handling in AudioOutputDescriptor

AudioOutputDescriptor can be created with a null port
for a duplicated output descriptor (see
AudioPolicyManager::checkOutputsForDevice). There used to be
a check for null port in getModuleHandle method prior to
ag/Ie90943ee3102cdb8adf89fdd2addd2c279b1e5bf. Restoring
the null check to prevent crash in getModuleHandle.

Bug: 63715585
Change-Id: If3f9563c58cd44ac95c8e27e0560375a404e5db6
Test: make
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
169753cd5f71ba92560e993bb7cb461d2f094272 06-Mar-2017 Kevin Rocard <krocard@google.com> audiopolicy: Two session can not offload concurrently

Previously the patch I98a8913d6faf5092a1e43a0bdd0f1ce1482221a9
forbade two tracks from different application to be offloaded
concurrently.

Concurrent offload is only needed for back to back playback...
Detect this use case by checking the session id instead of the
PID.

Test: call & play music & assistant
Test: run new CTS testConcurentPlayAudio
Bug: 35841692
Change-Id: I2c09c54adedf12644205bef115f1a2e16b05de91
Signed-off-by: Kevin Rocard <krocard@google.com>
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
551061ab211e1da0f060d7c895617814618da5c2 07-Feb-2017 Kevin Rocard <krocard@google.com> audiopolicy: Two clients can not offload concurrently

If two application are playing a compatible offload stream at the same
time.
Eg: two games playing MP3. At least one not taking the audio
focus.

The audio policy was offloading both stream resulting in audio glitches
and one stream being dropped.

Concurrent offload streams is intended to be a transitioning state when
an application wants back to back playbacks.

It should not be allowed for two different applications to stream at the
same time.

Test: Play mp3 while mp3 is already offloaded.
Bug: 34012147

Change-Id: I98a8913d6faf5092a1e43a0bdd0f1ce1482221a9
Signed-off-by: Kevin Rocard <krocard@google.com>
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
e964d4e421e2d1ca937227a580c0c837091a11e3 09-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in audio and playerservice.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: I265f3b094e08d5705b506b3fbba51439c134af84
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
fc732a63bd8c8c62ce75f36f03088ca6727caece 30-Mar-2016 Glenn Kasten <gkasten@google.com> Merge "Use audio_module_handle_t and audio_patch_handle_t consistently" into nyc-dev am: 54b48c3
am: b9b9fa3

* commit 'b9b9fa3d28a0436bb5e267d8fc3626ebd820fe78':
Use audio_module_handle_t and audio_patch_handle_t consistently

Change-Id: I100c4795ec6d0d9e9c23d6e850303a23f3bfb603
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/common/managerdefinitions/src/AudioOutputDescriptor.cpp
dd9c82ae89985ca87a087e86c7f632a29f86601b 17-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> resolve merge conflicts of 9462ca1 to master

Change-Id: I7643b8dd1a4ec40b6e8fd8c824bf03afbbeac170
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/common/managerdefinitions/src/AudioOutputDescriptor.cpp
f4d98ed31f2150cc8ad707c6a2cfae8ecf26975e 27-Feb-2016 Jean-Michel Trivi <jmtrivi@google.com> Merge "AudioPolicy: AudioOutputDescriptor set/get for patch handle" into nyc-dev am: b3e06a7592
am: 51f453aac3

* commit '51f453aac3ebcb0de4036acc9b829f58d27c3ff5':
AudioPolicy: AudioOutputDescriptor set/get for patch handle
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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.cpp
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/common/managerdefinitions/src/AudioOutputDescriptor.cpp
de80105c3f2db0eabd47640c49387ea3b44d4782 15-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: notification of dynamic policy mix activity

Implement non-stream type specific ref counting in output
descriptors to keep track of mix activity.
Notify audio policy client of mix activity changes.

Bug 20226914

Change-Id: Iec939cb640c58056f88947b611d23b4bb6d8a11b
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.cpp
aa9811945f575614b3482d09e4d969792701cebb 21-Mar-2015 Paul McLean <pmclean@google.com> Adding explicit routing API to AudioTrack

Change-Id: I40c048c7644c46f4e4f7103875206c0785c4b1dc
/frameworks/av/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.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/common/managerdefinitions/src/AudioOutputDescriptor.cpp