When a new device is attached to hardware module, query the HAL to get
the supported encapsulation modes and metadata types.
Test: atest EnumDevicesTest, manually
Test: atest audiofoundation_parcelable_test
Bug: 155799506
Change-Id: I903e46e35a44416c9f2d206c128face8a6c61dcb
Add management of audio effects applied to a specific input
or output audio device.
A new class DeviceEffectProxy derived from Effectbase is added
to represent an effect attached to a particular audio device type and
address. This proxy manages one or more actual EffectModule instances
automatically added to a playback or capture thread or directly to the
audio HAL when the targeted audio device is used by an audio patch.
A new DeviceEffectManager class is added to manage creation and release
of DeviceEffectProxy instances and monitor creation and release of audio
patches and create or release actual effect instances accordingly.
Bug: 136294538
Test: make
Change-Id: I23b9f9db4459136039c5ee327cf3b1aefa7db5af
Audio policy engine supports receiving a preferred device to use
for a given strategy (Engine superclass). Use of the preferred
device intervenes at the level of the each engine implementation,
here in the default engine in getDevicesForProductStrategy() method
so it is saved in the routing cache, and respects existing routing
priorities.
Refactor the loops for call and output rerouting into a new
updateCallAndOutputRouting() method.
Bug: 144440677
Test: atest AudioServiceHostTest#testPreferredDeviceRouting
Change-Id: Ic4c690e1b0d8020c4335979e40e14e6df5887879
As audio device type can not be used as bit mask any more, refactoring
audio device type usages in conversion from/to HAL. Use a set of audio
device types instead of bit mask.
Bug: 135621476
Test: atest AudioPlaybackCapture
Test: play and capture audio with BT and usb headset
Change-Id: If4a5c5002d6d4ccb7aaf823111b371d417784b19
As audio device type must not be used as a bit mask, there is a
requirement to refactor the code in audio flinger. This CL includes:
1. Use DeviceTypeSet for recording output devices in Threads. The input
and output device types in Threads will only be updated when creating
an audio patch.
2. Use helper functions in audio flinger for checking whether an audio
device type is a certain category.
3. Use DeviceDescriptorBaseVector as vector of DeviceDescriptorBase.
DeviceDescriptorBaseVector will be used in RecordThread to record output
devices, which will be used in audio effect.
4. Do not use set parameters when communicating output devices to
RecordThread. Instead, adding a new event in Thread to update output
devices directly.
Bug: 135621476
Test: atest AudioTrackTest AudioRecordTest AudioPlaybackCaptureTest
Test: atest AudioHostTest AudioServiceHostTest RoutingTest
Test: atest AudioEffectTest BassBoostTest DynamicsProcessingTest
Test: atest AAudioTests
Test: audio smoke test, run OboeTester
Change-Id: I87f3e59fd01b0b100232d61a9abbc471c61110c4
Type and address are used to distinguish a device, it makes more
sense to set device type and address when creating a DeviceDescriptor.
Bug: 135621476
Test: make, atest audiopolicy_tests
Change-Id: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
AudioDeviceTypeAddr is moved to libaudiofoundation. In that case, it can
be used in DeviceDescriptorBase.
Bug: 135621476
Test: make, atest audiofoundation_parcelable_test
Test: play music, record audio
Change-Id: Ia66dce29c8fb9d25c40598d9bada6eb295313884
Move AudioDeviceTypeAddr from AudioPolicy.h to libaudiofoundation.
AudioDeviceTypeAddr is a class that contains audio device type and
address. It can be used not only in audio policy, but also other places.
Bug: 135621476
Test: make, atest AudioHostTest
Change-Id: Ib257859891c647c07f22771012efdada438a4ff5
Refactor interface between audio flinger and audio policy. Use device
descriptor instead of audio device type and address. DeviceDescriptor
can contain more information that may be useful when opening an output
stream.
In audio policy, if multiple audio devices are passed in when opening
an output stream, one device is extracted using the same strategy as
when selecting a device for volume application. When starting source,
audio policy manager will call audio flinger to create audio patch. In
that case, multiple devices will still be patched to the output stream.
Test: atest AudioTrackTest AudioPlaybackCaptureTest
Test: atest audiopolicy_tests, audio smoke test
Change-Id: I46dc2da621614f8716c6c73cf807fe7d2d672cda
This reverts commit a0877dc731.
Reason for revert: Should work with go/pag/1465463 merging to master.
Change-Id: I17217744eacabf15621d4a5aac9dd1678e37e4ba
This change mainly aims at refactoring libmediahelper. Libmediahelper
doesn't need to be stored in media folder. In that case, move
libmediahelper related file to a new folder. In the meantime, move
AudioParameter.h from libaudioclient to libmediahelper. There is no
need to keep AudioParameter.h in libaudioclient while AudioParameter.cpp
is in libmediahelper.
Test: make
Bug: 135621476
Change-Id: Icce6615b7e3a68be8b7492f2a91922ab04464ca2
This reverts commit aa05782462.
Reason for revert: The original CL should work on top of ag/9570881
Test: make, atest audiofoundation_parcelable_test
Change-Id: Ibd49f8e86d97f94b13ff59779631283c0c4452e3
Add libaudio_system_headers, libaudioclient_headers, libmedia_headers
to export_header_lib_headers for libaudiofoundation_headers so that
there is not needed to add header lib when using libaudiofoundation.
Test: make
Bug: 135621476
Change-Id: Iaa2c8046f9bce4b69398795e162d1ee39cece24b
As libaudiofoundation is not part of VNDK, it may break VTS build. Make
libaudiofoundation be a static library can help solve the problem.
Test: make, atest VtsHalAudioV5_0Target
Bug: 142683018
Change-Id: I814c5380dfa5269fccc7bd37e29f308f1bc9bf28
Add parcelable test by writing the objects to Parcel and then reading
the objects to check parcelable functions work as expected.
Test: atest audiofoundation_parcelable_test
Bug: 135621476
Change-Id: I1d2263f0fe91e80b9262501372fde5e104469988
Add equals functions that can be used to check if current object is the
same as the given object by checking if all members are the same.
Bug: 135621476
Test: make
Change-Id: Idcf09587f629e6719e9dcf2f0fb7d68a01eafef9
Make some generic audio classes parcelable so that they can be easily
used in binder call, including AudioProfile, AudioPort, AudioPortConfig,
DeviceDescriptorBase.
Bug: 135621476
Test: make
Change-Id: I8bdcd0da13739fc53638c78aac133336b77fb9d2
This change includes:
1. Use DeviceTypeSet to represent a combination of audio device types.
2. Add helper functions for DeviceTypeSet
3. Stop using audio device type as a bit mask in DeviceVector
Test: atest AudioTrackTest AudioRecordTest AudioPlaybackCaptureTest
Test: atest AudioHostTest AudioServiceHostTest audiopolicy_tests
Test: audio smoke test
Change-Id: If80513b689848bcab6094f70a572f053856afa82
DeviceDescriptorBase is a class that derives from AudioPort and
AudioPortConfig and contains extensions to describe a audio port that is
a hardware device. DeviceDescriptor derives from DeviceDescriptorBase
and contains policy related stuff.
Test: atest AudioTrackTest AudioRecordTest AudioManagerTest
Test: atest AudioPlaybackCaptureTest AudioHostTest audiopolicy_tests
Test: audio smoke test
Bug: 135621476
Change-Id: I70ebe6bca70a77bbfc8f6855de3fd4c4ffa1c487
The file is copied from managerdefinition folder. Doing this to get a
better git history.
Test: make
Bug: 135621476
Change-Id: I9a6d6401e45102b5303730b4900b1899968ca267
This patch aims to make the structure for libaudiofoundation and policy
stuff simpler, including:
1. Make AudioPortBase as AudioPort in libaudiofoundation. Create
PolicyAudioPort that contains policy related stuff, which is used by
audiopolicy.
2. Make AudioPortConfigBase as AudioPortConfig in libaudiofoundation.
Create PolicyAudioPortConfig that contains policy related stuff.
3. DeviceDescriptor derives from AudioPort, AudioPortConfig, PolicyAudioPort
and PolicyAudioPortConfig. IOProfile derives from AudioPort,
PolicyAudioPort. AudioInputDescriptor/AudioOutputDescriptor derives from
AudioPortConfig, PolicyAudioPortConfig.
Test: atest AudioTrackTest, AudioRecordTest, AudioManagerTest
Test: atest audiopolicy_tests, AudioHostTest
Test: audio smoke test
Bug: 135621476
Change-Id: I40299d95dda3b3fc0ea88b079f2fe38d8f7e5b31
Make AudioProfileVector only in libaudiofoundation. In policy part,
instead of having policy specific AudioProfileVector deriving from
AudioProfileVector in libaudiofoundation, make all the functions as
global functions. In that case, AudioPortBase does not need to be a
template class. That helps make the structure clearer.
Test: audio smoke test
Test: CTS for AudioTrack, AudioRecord, AudioManager
Test: audiopolicy_tests, AudioHostTest
Bug: 135621476
Change-Id: I36b12123cf52c3f82cef09a965403791dff74093
The purpose of this change is to make a generic AudioPort class that
could be used by vendor.
1. Add AudioPortFoundation and AudioPortBase. AudioPortFoundation
contains generic members of an audio port. AudioPortBase is a template
class that derives from AudioPortFoundation. It takes audio profile
vector as a template parameters. That makes it more feasible to use
customized audio profile stuff as needed. In audio policy, AudioPort
derives from AudioPortBase and contain policy related stuff.
2. Add AudioPortConfigBase. AudioPortConfigBase contains generic members
of an audio port config. AudioPortConfig derives from AudioPortConfigBase
and contains policy related stuff.
3. Use std::string instead of String8 in AudioPort and AudioPortConfig.
Bug: 135621476
Test: CTS for AudioRecord, AudioTrack, AudioManager, RoutingTest
Test: audiopolicy_tests, AudioServiceHostTest
audio smoke test
Test: dumpsys media.audio_policy
Change-Id: I05611b7067c18006660de2c678acd56bdd34010a
Copy AudioPort.h from audio policy to libaudiofoundation and name it as
AudioPortBase.h. Note that AudioPortBase has not been added into the
make file as it needs some more change to make it work. Doing this just
to make a cleaner diff for later change.
Bug: 135621476
Test: make
Change-Id: I6cd1a53e889340c7fefffdd5832854016cd733ee
AudioProfile is a class that contains information for an audio profile.
AudioProfileVectorBase is a base class that contains operations for a
vector of audio profiles. AudioProfileVector derives from
AudioProfileVectorBase and contains policy related stuff.
Bug: 135621476
Test: CTS for AudioRecord, AudioTrack, AudioManager
Test: audio smoke test, audiopolicy_tests
Test: dumpsys media.audio_policy
Change-Id: Ic2e08efcc5efa99e499a931811b7042fbd5ddf04
Copy AudioProfile from audio policy to libaudiofoundation. Note that
AudioProfile in libaudiofoundation has not been added into the make
file as it needs some more change to make it work. Doing this just to
make a cleaner diff for later change.
Rename AudioProfile in managerdefinitions folder as AudioProfileVector
since AudioProfile will be moved to libaudiofoundation.
Bug: 135621476
Test: make
Change-Id: I13ac067317648bbfd8d3960d16a1ea56ded83011
1. Add SampleRateSet, FormatSet, ChannelMaskSet, FormatVector
using std::vector and std::set in libaudiofoundation.
2. Use SampleRateSet, FormatSet, ChannelMaskSet, FormatVector in
audio framework.
Bug: 135621476
Test: make, CTS for AudioRecord, AudioTrack, AudioManagerTest
Test: play and record audio
Change-Id: Ic04e637bcc6ba9df84c5e7561ec3c03f18a7d242
Make AudioGain parcelable so that it can be easier to use in binder
call.
Bug: 135621476
Test: make
Change-Id: I4159e92a27c6d99570ac2e2175c3d46fa7975059
1. Create folder for libaudiofoudation.
2. Move AudioGain to libaudiofoudation. The goal is to make AudioGain
be able to use in binder call and be vendor-available later.
Bug: 135621476
Test: make, CTS for AudioTrack, AudioRecord, AudioManagerTest
Change-Id: Ibf16ad9cb7f2ac657a02632ccbe4f934b5a12731