Commit Graph

42581 Commits

Author SHA1 Message Date
Shunkai Yao
f1d6039f96 AIDL effect: Initial IFactory interface definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest

Merged-In: I9f5ef1284bb5d77a9d60cb8b901742fc8e467926
Change-Id: I9f5ef1284bb5d77a9d60cb8b901742fc8e467926
(cherry picked from commit d56bc22d1e)
2022-08-30 22:09:18 +00:00
Mikhail Naganov
a2c714129e audio: Add StreamDescriptor.frameSizeBytes
This field indicates the frame size and is filled by
the HAL module, so that the client does not have
to calculate it.

As a side effect, in the VTS code, a StreamContext can
now be created solely from a StreamDescriptor.

Added unit tests for the functions from Utils.

Bug: 205884982
Test: atest libaudioaidlcommon_test
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ief836b8b2d35bacb1f9778e2462d540554149d7f
Change-Id: Ief836b8b2d35bacb1f9778e2462d540554149d7f
(cherry picked from commit 5862c1e3bc)
2022-08-30 03:54:07 +00:00
Mikhail Naganov
4f5d3f12f5 audio: Implementation of audio I/O, part II
This patch implements audio I/O for the synchronous, non-MMAP
case.

Updated the StreamDescriptor structure to make it usable.
Clarified comments on the expectations for the client and
the HAL module.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I09651c6e80a397c80870622ac19234b4d4a38cbb
Change-Id: I09651c6e80a397c80870622ac19234b4d4a38cbb
(cherry picked from commit 01803d454a)
2022-08-30 01:39:24 +00:00
Mikhail Naganov
0b9c5feed1 audio: Fix the lifetime of the StreamWorker's logic part
Fix the mistake of making StreamWorker to inherit
from the part which provides actual thread logic (Impl).
The lifetime of the logic object must be longer
than the lifetime of the StreamWorker's thread.
Otherwise, the thread could still have running while
the logic has already been destroyed (consider
the order of destructors in C++ class inheritance).

With this fix, the StreamWorker class does not have
to be a template anymore, thus reorganize the code
to move big methods into a .cpp file.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
Change-Id: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
(cherry picked from commmit 84024eccee)

Change-Id: I70958f437657b574cda6480c3216a0b1ea252433
2022-08-30 01:36:31 +00:00
Mikhail Naganov
48d3115614 audio: Allow stopping a StreamWorker from the looping thread
Enhance the return type of the 'workerCycle' to allow it
exiting without inducing an error on the controller side.

Also, put StreamWorker into a namespace.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I3b27028b10f80f27985040cae8f8b0e6ab63ddad
Change-Id: I3b27028b10f80f27985040cae8f8b0e6ab63ddad
(cherry picked from commit 5021df71c7)
2022-08-30 01:30:19 +00:00
Mikhail Naganov
409ce2a665 audio: Use 'sdk_version' instead of 'platform_apis'
Replace 'platform_apis: true' with 'sdk_version: module_current'.
The former causes compiling against SDK source code,
this is not needed for the audio HAL.

Bug: 205884982
Test: m android.hardware.audio.service-aidl.example
Change-Id: I9b9c32707ac7276f5cd077681bd1f8122bc20feb
Merged-In: I9b9c32707ac7276f5cd077681bd1f8122bc20feb
(cherry picked from commit 714e959c89)
2022-08-29 22:42:26 +00:00
Sahil Somani
b6eba859a1 Merge "Rename Light HAL default implementation variable." 2022-08-27 01:42:39 +00:00
Yixiao Luo
511538808f Merge "Add OWNERS file to TV Input HAL" 2022-08-26 23:19:24 +00:00
Sahil Somani
1b4eb23b72 Rename Light HAL default implementation variable.
The Light HAL implements a function getLights that returns a vector
of HwLight objects. This vector is called "lights" in Lights.cpp,
but it is called "types" in Lights.h. Lights.h has been changed to
call the vector "lights".

Test: VtsHalLightTargetTest
Change-Id: I1e567d1454d42e3efc0186cde8340c32e7f3456e
2022-08-26 15:00:15 -07:00
Treehugger Robot
73754429ee Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f am: 2a3972288c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I1ebf39592d323ef2e4b394c360fe0774da1f6347
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:24:25 +00:00
Treehugger Robot
2a3972288c Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev am: 2a04b4462f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2194136

Change-Id: I651a99927a137c7401750274b505e30e548e7858
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 17:05:34 +00:00
Treehugger Robot
2a04b4462f Merge "Make VtsHalNeuralnetworks* tests more binder-friendly." into android12-tests-dev 2022-08-26 16:51:31 +00:00
Mikhail Naganov
6a4872dff0 audio: Implementation of audio I/O, part I
This patch adds necessary structures and prepares for implementing
data flow for audio I/O.

Also in this patch we clarify the relationship between audio patches
and buffer size for audio I/O, and between buffer size and latency.

Bug: 205884982
Bug: 233816848
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I8522632607d4cf50a112225c19b5dd5ad8848591
Change-Id: I8522632607d4cf50a112225c19b5dd5ad8848591
(cherry picked from commit 68bee70442)
2022-08-26 02:44:15 +00:00
Mikhail Naganov
48e2e8fe49 audio: Implement setting name and priority in StreamWorker
Audio threads need to be able to set their priority.
Also, traditionally these worker threads set a custom
thread name. Implement this functionality in StreamWorker.

Since initialization steps can fail, implement simple
error reporting via a string field `mError`. The state
of the string field replaces the dedicated `ERROR` worker
state.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: Ie9ab94922d47f277a4993a90b478a2fa76657923
Change-Id: Ie9ab94922d47f277a4993a90b478a2fa76657923
(cherry picked from commit e9e0f7c0f5)
2022-08-26 02:43:37 +00:00
Mikhail Naganov
0c174e9133 audio: Prevent priority inversions in aidl StreamWorker
Avoid taking a lock in high priority worker threads
without a real need.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I8cc0f5cb58752b7b7d413a9f4e46093c39445892
Change-Id: I8cc0f5cb58752b7b7d413a9f4e46093c39445892
(cherry picked from commit d989a4b669)
2022-08-26 02:42:46 +00:00
Mikhail Naganov
614e4b5f16 audio: Add StreamWorker to aidl/common
This utility class has been copied from HIDL VTS.
It will be used both for the default implementation
and AIDL VTS, and might need modifications.

Bug: 205884982
Test: atest libaudioaidlcommon_test
Merged-In: I43b35b0c23ae45305dca66e15b60820cad19635e
Change-Id: I43b35b0c23ae45305dca66e15b60820cad19635e
(cherry picked from commit c17f0484bc)
2022-08-26 02:41:58 +00:00
David Gross
79324920f7 Make VtsHalNeuralnetworks* tests more binder-friendly.
Certain mutation testing -- mutateOperandLifeTimeTest and
mutateOperandInputOutputTest -- can introduce potentially very large
CONSTANT_COPY operands, which can in turn create potentially very
large Models which must be passed across binder.  To avoid overflowing
the binder buffer, we estimate the size of the mutated Model, and skip
the test if that size is too high.  The old logic recognizes that our
tests only have a single active binder transaction at a time, and
assumes that there are no other clients using the same service at the
same time, and so we should have the binder buffer to ourselves; to be
conservative, we reject any Model whose estimated size exceeds half
the binder buffer size.  Unfortunately, sometimes the binder buffer
still overflows, because it unexpectedly contains an allocation from
some other transaction: It appears that binder buffer memory
management is not serialized with respect to transactions from our
tests, and therefore depending on scheduler behavior, there may be a
sizeable allocation still in the buffer when we attempt to pass the
large Model.  To fix this problem we become even more conservative,
and instead of limiting the Model to half the binder buffer size, we
limit it to half IBinder.MAX_IPC_SIZE (the recommended transaction
size limit).  To confirm that this change does not exclude too many
tests, I checked how may times the size filter function
exceedsBinderSizeLimit is called, how many times it rejects a model
under the new logic (modelsExceedHalfMaxIPCSize), and how many times
it rejects a model under the old logic (modelsExceedHalfMaxIPCSize).

Test: VtsHalNeuralnetworksV1_0TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  3592, modelsExceedHalfMaxIPCSize = 212, modelsExceedHalfBufferSize = 18
Test: VtsHalNeuralnetworksV1_1TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models =  7228, modelsExceedHalfMaxIPCSize = 330, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_2TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 52072, modelsExceedHalfMaxIPCSize = 506, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksV1_3TargetTest --gtest_filter=TestGenerated/ValidationTest.Test/*-*dsp*
Test: # models = 73342, modelsExceedHalfMaxIPCSize = 568, modelsExceedHalfBufferSize = 28
Test: VtsHalNeuralnetworksTargetTest

Bug: 227719657
Bug: 227719752
Bug: 231928847
Bug: 238777741
Bug: 242271308

Change-Id: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971
2022-08-25 23:11:41 +00:00
Treehugger Robot
b4adbffdc4 Merge "Remove usb HIDL entry in compat matrix." 2022-08-25 20:14:47 +00:00
Treehugger Robot
870d2ac41a Merge "Remove nfc HIDL entry in compat matrix." 2022-08-25 19:43:28 +00:00
Treehugger Robot
a60aa56278 Merge "Remove gnss HIDL entry in compat matrix." 2022-08-25 19:17:27 +00:00
Treehugger Robot
856fced74a Merge "audio: Update README.md to add info about the AIDL version" 2022-08-25 17:59:25 +00:00
Mikhail Naganov
5aca7616f7 audio: Update README.md to add info about the AIDL version
This complements CL https://r.android.com/2169871.

Bug: 205884982
Test: N/A
Merged-In: Ia627e3845a078e6a4c545b13a723a6c5a038c53b
(cherry picked from commit bbf297804e)
Change-Id: I78696647e64ae1a5f216c3ab4f4a7194a5145072
2022-08-25 16:34:25 +00:00
Treehugger Robot
463d08394e Merge "Remove color format constraints" 2022-08-25 02:28:02 +00:00
Treehugger Robot
660e9a4c48 Merge changes I118b2c04,I111b72aa,Ia5d29126
* changes:
  audio: Add support for compressed offload
  audio: Improve debug logging in the AIDL version, fix bugs
  audio: Disable the C++ backend for android.hardware.audio.core
2022-08-25 02:24:01 +00:00
Treehugger Robot
2412da0826 Merge "[Bluetooth apex] Use new apex name" 2022-08-25 02:16:03 +00:00
Changyeon Jo
ec0d97c86b Remove color format constraints am: e6bb228dc6 am: 9b60ecd229
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2188343

Change-Id: Ife0695367cc56876e595275d26096cc329535c4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 00:39:27 +00:00
Mikhail Naganov
111e0ceab5 audio: Add support for compressed offload
- Add compressed offload mix port into default implementation.
- Require AudioOffloadInfo to be passed to IModule.openOutputStream
  for compressed offload port configs.
- Update VTS to handle compressed offload.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I118b2c04bff12b64a7cac4dc2c88217a6a270046
Change-Id: I118b2c04bff12b64a7cac4dc2c88217a6a270046
(cherry picked from commit 975ea3ae89)
2022-08-25 00:25:55 +00:00
Mikhail Naganov
16db9b7c97 audio: Improve debug logging in the AIDL version, fix bugs
- Make sure the AIDL default implementation has debug output enabled.
- Log additional info in the AIDL VTS to facilitate debugging.
- Make resource handler classes move-only types.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I111b72aaf12962f00b4d31b8ac87186bca5eb853
Change-Id: I111b72aaf12962f00b4d31b8ac87186bca5eb853
(cherry picked from commit f82fc6476d)
2022-08-25 00:25:25 +00:00
Mikhail Naganov
f84d640186 audio: Disable the C++ backend for android.hardware.audio.core
android.hardware.audio.core will need to use FMQ,
which does not support the C++ backend in the AIDL version.

Migrate VTS tests from the C++ backend to the NDK backend.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ia5d29126afdb4bb97dd063a032b96ab83b9ce36e
Change-Id: Ia5d29126afdb4bb97dd063a032b96ab83b9ce36e
(cherry picked from commit 8fcc442416)
2022-08-25 00:24:53 +00:00
Changyeon Jo
9b60ecd229 Remove color format constraints am: e6bb228dc6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2188343

Change-Id: I4b4f0fa412a88763e506acb9d5f2ed83463ba1d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 00:19:38 +00:00
Treehugger Robot
eefac18b26 Merge "audio HAL: Support for external device connections" 2022-08-24 15:01:49 +00:00
Xin Li
056da74605 Merge "Merge android13-tests-dev" 2022-08-23 23:07:05 +00:00
Mikhail Naganov
00603d14b3 audio HAL: Support for external device connections
Add methods 'IModule.connect/disconnectExternalDevice' which inform
audio HAL about connection / disconnection of an external
non-attached device. Add method 'getAudioRoutesForPort' to
retrieve only routes that include the specified port.

Update the behavior of 'getAudioPorts' and 'getAudioRoutes'
indicating that the result may change due to instantiation
of new device ports for connected external devices.

Clarify behavior of 'IModule.setAudioPortConfig' that it can not
work with device ports with no profiles.

Add debug flags structure 'ModuleDebug' and method
'IModule.setModuleDebug' to control the debugging aspects. VTS
tests use these flags to test HAL behavior which would otherwise
require human intervention.

Update the default implementation and VTS for the AIDL changes.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Iad5f7009e283729206f88b6278c8992f7f8a92a2
Change-Id: Iad5f7009e283729206f88b6278c8992f7f8a92a2
2022-08-23 22:40:20 +00:00
Pawan
8e13f2ac2c Updating cc_fuzz with default config
Using service_fuzzer_defaults in
	- android.hardware.health-service.aidl_fuzzer
	- android.hardware.vibrator-service.example_fuzzer

Bug: 240318902
Test: m android.hardware.health-service.aidl_fuzzer
Test: m android.hardware.vibrator-service.example_fuzzer
Change-Id: I3fd1cf37a5835ebef14658ed40332132cec07e49
2022-08-22 22:16:41 +00:00
Treehugger Robot
2468ff5608 Merge changes from topic "upstream-audio-aidl-hal"
* changes:
  Explicitly depend on V1 of android.media.audio.common.types
  Explicitly depend on audio.common-V1
  audio HAL: initial VTS tests
  audio HAL: Minimal example implementation
  audio HAL: Initial AIDL interfaces
2022-08-22 20:25:37 +00:00
William Escande
2591c3d0cf [Bluetooth apex] Use new apex name
The Bluetooth apex name is now called com.android.btservices

Bug: 243054261
Test: Build
Change-Id: Ib63646722cbef948b5198fc5f2a9b5ac2ca52ae3
2022-08-22 11:27:58 -07:00
Treehugger Robot
08f3ea9e97 Merge changes from topic "cp-libwifihal-soong"
* changes:
  Build libwifi-hal-* modules only for the first arch
  android.hardware.wifi@1.0-service in soong
2022-08-22 02:30:56 +00:00
Donghong Weng
160a22f49e Merge "Explicit conversion" 2022-08-22 01:45:35 +00:00
Jiyong Park
f4b5e7b993 Explicitly depend on V1 of android.media.audio.common.types
... for the same reason as cc489264af

Bug: 225941299
Test: m
Merged-In: I269d61c8c441b3db0832f5450f5e5a84a5989a99
Change-Id: I269d61c8c441b3db0832f5450f5e5a84a5989a99
(cherry picked from commit 446519a370)
2022-08-20 00:14:53 +00:00
Jiyong Park
d25eddfd7d Explicitly depend on audio.common-V1
Background:

android.hardware.audio.common was frozen in the upstream tm-dev.
Previously, the interface had only V1 (as the in-development version)
and it was in the VNDK. However, after the freeze, it will have V1 and
V2, and only V1 will remain in the VNDK, because we can't have multiple
versions of the same AIDL interface in VNDK (it's just waste of memory).

android.hardware.audio.core is a new AIDL interface that doesn't exist
in TM. It is also a member of VNDK and imports the audio.common
interface. So far, the import has been done without an explicit version
number (i.e. `imports: ["android.hardware.audio.common"]`). As a result,
V1 was imported before the freeze, and V2 (the latest) will be imported
after the freeze.

Problem:

audio.core depending on audio.common-V2 is NOT allowed since the former
is a member of VNDK, but the latter isn't. VNDK should form a closure.
We are actually hitting this:

```
> error: hardware/interfaces/audio/aidl/Android.bp:71:1: module
"android.hardware.audio.core-V1-ndk" variant
"android_vendor.Tiramisu_arm64_armv8-a_static" (created by module
"android.hardware.audio.core-V1-ndk-generator" (created by module
"android.hardware.audio.core_interface")): (native:vendor:vndk) should
not link to "android.hardware.audio.common-V2-ndk" (native:vendor):
VNDK-core must only depend on VNDK-core or VNDK-SP
```

To fix this, make the dependency to audio.common to be explicit about
the version. This change can't be uploaded to tm-dev as audio.core
doesn't exist there, and must be submitted before the AIDL APIs are
frozen there.

Bug: 225941299
Test: m

Merged-In: Iadc96d558d5c7431b0a2b0cbd28b99319a24ee44
Change-Id: Iadc96d558d5c7431b0a2b0cbd28b99319a24ee44
(cherry picked from commit cc489264af)
2022-08-20 00:14:53 +00:00
Mikhail Naganov
e5d747e908 audio HAL: initial VTS tests
Tests basic functionality for enumerating
capabilities of an audio module, audio patches
creation, and opening of I/O streams.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I7c7c3c7008f2fc43db1542455c74444a08e55534
Change-Id: I7c7c3c7008f2fc43db1542455c74444a08e55534
(cherry picked from commit 7abc70f908)
2022-08-20 00:14:53 +00:00
Mikhail Naganov
df5adfde15 audio HAL: Minimal example implementation
Implements basic functionality for enumerating
capabilities of an audio module, audio patches
creation, and opening of I/O streams.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ie5d67e9192a598260e762ae9368f99592c8ad97e
Change-Id: Ie5d67e9192a598260e762ae9368f99592c8ad97e
(cherry picked from commit ecdc6ca8e8)
2022-08-20 00:14:53 +00:00
Mikhail Naganov
bd4013f179 audio HAL: Initial AIDL interfaces
This adds basic support for enumerating capabilities
of an audio module, creation of patches, and opening of
I/O streams.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ib1ef13c95d338b6ef1bde7d87dcd675fc1d35e85
Change-Id: Ib1ef13c95d338b6ef1bde7d87dcd675fc1d35e85
(cherry picked from commit ee27478264)
2022-08-20 00:14:53 +00:00
Treehugger Robot
a3fe17250d Merge "Release the memory allocated in the algorithm to prevent memory leaks" 2022-08-19 22:09:37 +00:00
Changyeon Jo
849d0f370c Remove color format constraints
VtsHalEvsTargetTest does not verify any behavior depending on
a frame buffer's color format.

Bug: 240685726
Test: atest VtsHalEvsTargetTest
Change-Id: If8b8c595cfc7404a8122728593f778528b45af15
2022-08-18 04:49:39 +00:00
Liening.Liu
1aa1cf155e Release the memory allocated in the algorithm to prevent memory leaks
In the reference implementation of the identity function, there are two places where the memory requested in the openssl algorithm is not released. This memory should be freed.

Test: Vts/Cts

Bug: 242927524
Change-Id: I88ffba39cb6ec887f395122e4670bf9f1a2d8e12
2022-08-18 02:38:04 +00:00
Yixiao Luo
7c22a89d1d Add OWNERS file to TV Input HAL
Bug: 227673740
Test: N/A
Change-Id: I35db194e2597cdd17ecb7b15c5591fb1009e1be8
2022-08-17 18:46:14 -07:00
Xin Li
7406132b49 Merge android13-tests-dev
Merged-In: Ie372f74f3a52decce592181c7d65624f8ec03ed1
Change-Id: Ia81e24391de0d26737a5d65fbc5c8bb86bf03d5b
2022-08-17 16:37:46 -07:00
donghongweng
f533ccb14e Fix unqualified-std-cast-call compiler warning
Test: m
Change-Id: I403ce701846a3d3582e1dfa5557fe981e86f2140
2022-08-17 15:49:59 +08:00
Jiyong Park
46afe63eaf Build libwifi-hal-* modules only for the first arch
Previously, the build rules assumed that the target supports both 64 and
32 bit architectures, which isn't true for 32-bit-only targets. That
caused build breakage on such targets. Fixing that by building the
modules only for the first architecture (64 on 64-only or 64/32 target,
and 32 on 32-only target).

Bug: 241916304
Test: build the 32-bit-only target
Merged-In: I5353ab1561622eae12e2dff87eb0f17b47c3773d
Change-Id: I5353ab1561622eae12e2dff87eb0f17b47c3773d
(cherry picked from commit 3ab5c90104)
2022-08-17 16:41:19 +09:00