* changes:
Refactor for audio device type in conversion.
Use AudioDeviceTypeAddr when setting device for effects.
Add constructor with type and address for DeviceDescriptor.
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
Merged-In: If4a5c5002d6d4ccb7aaf823111b371d417784b19
Separate SET_DEVICE and SET_INPUT_DEVICE command in effects as it can
be multiple devices for output case, but only single device for input
case.
Use AudioDeviceTypeAddr instead of just audio device type as address
can be useful to identify audio device if there are multiple devices
with the same device type connected.
Bug: 135621476
Test: atest AudioEffectTest BassBoostTest DynamicsProcessingTest
Test: atest EqualizerTest VirtualizerTest VisualizerTest
Change-Id: Ie9df88e3338730392abbc3efae5daadc70398ff7
Merged-In: Ie9df88e3338730392abbc3efae5daadc70398ff7
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
Merged-In: I5f9063bd8c756ace77c162e86a8c0dd685da79b4
Before, in Android 10, this would have been a small leak because
unlinkToDeath is not called, but now, objects are automatically
unlinked. However, this presents a problem since you must hold onto
a binder in order to linkToDeath. This now holds onto the binder
and is relying on the automatic-unlinkToDeath behavior.
Fixes: 145675653
Test: atest CtsNativeMediaAAudioTestCases
arm64-v8a CtsNativeMediaAAudioTestCases: Passed: 122, Failed: 0, Ignored: 0, Assumption Failed: 0
Test: after using app and killing which uses AAudio MMAP stream,
dumpsys output for media.aaudio is cleaned up:
------------ AAudio Service ------------
Stream Handles:
AAudioClientTracker:
AAudioEndpointManager:
Exclusive MMAP Endpoints: 0
ExclusiveSearchCount: 3
ExclusiveFoundCount: 0
ExclusiveOpenCount: 1
ExclusiveCloseCount: 1
Shared Endpoints: 0
SharedSearchCount: 1
SharedFoundCount: 0
SharedOpenCount: 0
SharedCloseCount: 0
Change-Id: I2ef141320dc3ef0135fb7ef002d85377d06a75c2
* changes:
Refactor audio device type in audio flinger.
Refactor opening output interface between AF and AP.
Move libmediahelper into a new folder.
Use AudioDeviceTypeAddr in DeviceDescriptorBase.
Move AudioDeviceTypeAddr to libaudiofoundation.
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
Merged-In: I87f3e59fd01b0b100232d61a9abbc471c61110c4
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
Merged-In: I46dc2da621614f8716c6c73cf807fe7d2d672cda
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
Merged-In: Icce6615b7e3a68be8b7492f2a91922ab04464ca2
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
Merged-In: 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
Merged-In: Ib257859891c647c07f22771012efdada438a4ff5
* changes:
Add parcelable test for classes in libaudiofoundation.
Add export header lib headers to libaudiofoundation_headers.
Add equals functions for classes in libaudiofoundation.
Make audio stuff parcelable.
Clear up bit mask usage in audio policy.
Make AudioGain parcelable.
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
Merged-In: I1d2263f0fe91e80b9262501372fde5e104469988
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
Merged-In: Iaa2c8046f9bce4b69398795e162d1ee39cece24b
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
Merged-In: 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
Merged-In: 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
Merged-In: If80513b689848bcab6094f70a572f053856afa82
Make AudioGain parcelable so that it can be easier to use in binder
call.
Bug: 135621476
Test: make
Change-Id: I4159e92a27c6d99570ac2e2175c3d46fa7975059
Merged-In: I4159e92a27c6d99570ac2e2175c3d46fa7975059
* changes:
Add audio health tests.
Move systemaudio_tests to system/media.
Enable AUDIO_ARRAYS_STATIC_CHECK.
Add test for device type helper functons.
Stop using audio device types as bit mask in policy.h
Add test for audio device type helper functions.
First test for audio health check. The test checks if all declared
devices found by checking if the audio device types of attached devices
can be seen by audio policy.
Bug: 141580284
Test: atest audio_health_tests audiopolicy_tests
Change-Id: I0374f382eaab7b36ab623b11a59e0634565f2187
Merged-In: I0374f382eaab7b36ab623b11a59e0634565f2187
Enable static check for audio arrays so that it can be earlier to catch
if there is any error within the audio arrays.
Bug: 135621476
Test: make
Change-Id: I598311e0853ca77dff83fb97974e534adb238567
Merged-In: I598311e0853ca77dff83fb97974e534adb238567