Commit graph

42618 commits

Author SHA1 Message Date
Mikhail Naganov
e503e08107 Merge "audio: Cleanups and refactorings" 2022-09-13 17:55:22 +00:00
Treehugger Robot
105ac0f1ae Merge "Use EXPECT_LE instead of EXPECT_LT for some iio sensors that do not support runtime suspend." 2022-09-13 02:46:51 +00:00
Mikhail Naganov
a2c5ddf993 audio: Cleanups and refactorings
Added utility functions for operating on positional
bit flags.

Moved retrieval of offload mix ports to ModuleConfig
utility class.

Clarify the names of read/write tests.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id20881c2e62bc1b95d8fc3c268f99e36337dce7a
2022-09-12 23:00:42 +00:00
Treehugger Robot
406a9614c8 Merge "Remove color format constraints" into android13-tests-dev am: 3457c4eeae
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2193734

Change-Id: I020a213d387681acbe0b2b3e8036babed3d6f1bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 18:33:46 +00:00
Treehugger Robot
719a761007 Merge "fix segmentation fault of GraphicsComposerAidlCommandTest" into android13-tests-dev am: 52d98de46d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2196875

Change-Id: I0bb05ff8c7e0fe37f31fae7a3917d12b6f706edb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 18:32:50 +00:00
David Gross
98d27de6ee [automerger skipped] Make VtsHalNeuralnetworks* tests more binder-friendly. am: ce0048732a -s ours
am skip reason: Merged-In I3f81d71ca3c0ad4c639096b1dc034a8909bc8971 with SHA-1 79324920f7 is already in history

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2201826

Change-Id: I477a0eecbed8d6f5c2a1a8dd5b009340ce59529a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 18:32:17 +00:00
Xin Li
7ad1370553 Merge android12L-tests-dev@8941410 am: be8ea4d3a8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2186502

Change-Id: I48d023e9331d2e480dc35c25d79e056a9af53336
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 18:28:36 +00:00
Max Bires
0068fccb41 Merge "Clarify error message in DeviceInfo check." 2022-09-09 23:40:17 +00:00
Treehugger Robot
3457c4eeae Merge "Remove color format constraints" into android13-tests-dev 2022-09-09 16:12:04 +00:00
Changyeon Jo
7f5ad61254 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
(cherry picked from commit 849d0f370c)
2022-09-09 16:05:53 +00:00
heqiang1008 thundersoft
d6ef4fb700 Use EXPECT_LE instead of EXPECT_LT for some iio sensors that do not support runtime suspend.
Change-Id: I646511f9d6c62f2967cedf6a2abc19aa621ee073
2022-09-09 09:11:10 +00:00
Max Bires
757ed42e2c Clarify error message in DeviceInfo check.
This change gives additional context to the device info checks while.
Currently, an unprovisioned device will generate a massive spam of
failures which may be WAI for an early hardware revision device that
was not provisioned with attestation IDs.

Test: atest VtsHalRemotelyProvisionedComponentTest
Change-Id: I16069dba841a90aa55781148d3c268ced635e006
2022-09-08 18:19:26 -07:00
Qoo Lin
5195a49c3c Fix SetBadMetadata fail am: 2ff704a6d4 am: ec1e1f61ed
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2201200

Change-Id: I916e8f20f2871db15616eb90905c9f768f07d95e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 00:30:56 +00:00
Qoo Lin
ec1e1f61ed Fix SetBadMetadata fail am: 2ff704a6d4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2201200

Change-Id: Ia133acde9b27c275d6aeb02618af86ade3233956
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-08 00:15:46 +00:00
Treehugger Robot
52d98de46d Merge "fix segmentation fault of GraphicsComposerAidlCommandTest" into android13-tests-dev 2022-09-07 23:57:57 +00:00
Lorena Torres-Huerta
e38b08ad47 Merge changes from topic "media_common_types_version_bump"
* changes:
  Use explicit aidl versions for audio hal and soundtrigger dependencies.
  Add AudioAttributes and AudioFlag for use in HAL interface for engine configuration.
2022-09-07 23:30:55 +00:00
Tri Vo
9c21c70ffa Merge "Add defaults for current Identity AIDL API version" 2022-09-07 22:22:58 +00:00
Max Bires
26a548500f Merge "Update IRemotelyProvisionedComponent HAL to v3" 2022-09-07 21:54:02 +00:00
Tri Vo
25df1037d1 Add defaults for current Identity AIDL API version
This makes it easier to bump the version of this interface.

Test: m
Change-Id: If0d4e405ae2f11da2e540800766ef9ed9b399663
2022-09-06 17:46:04 -07:00
Cole Faust
7b6acb3f2d Fix module-file name collisions
Bazel doesn't allow a module and file with the same name.

Bug: 198619163
Test: Presubmits
Change-Id: I828de4265a247c93e778764d0ece54d4d1760daa
2022-09-05 17:56:28 -07:00
Treehugger Robot
22b8aceacb Merge "Make BootControlHAL available in recovery" 2022-09-02 19:25:29 +00:00
Max Bires
137ffac4c5 Update IRemotelyProvisionedComponent HAL to v3
This change makes all of the changes to the HAL AIDL files, along with
corresponding documentation edits, to facilitate the definition for
version 3 of IRemotelyProvisionedComponent HAL.

The bulk of the changes are described within the RKP_CHANGELOG.md file
and will therefore not be discussed here within the commit message.

Bug: 240312857
Test: It is human readable and also builds.
Change-Id: I920550bdfe5a8f9ba677c4a4f67e975bcd3672ab
2022-09-02 10:20:28 -07:00
Treehugger Robot
9cf5a87265 Merge "fix segmentation fault of GraphicsComposerAidlCommandTest" 2022-09-02 17:12:02 +00:00
David Drysdale
2530f9ca5e Merge changes Iaa941e12,Icbd4c9cd
* changes:
  KeyMint HAL: reinstate tags in extension schema
  KeyMint HAL: clarify obsolete tags
2022-09-02 16:09:43 +00:00
David Drysdale
7ea97a310a KeyMint HAL: reinstate tags in extension schema
Commit 93c72cef92 ("KeyMint: sync all attestation tags",
http://aosp/1719302) removed various tags from the attestation that are
only applicable to symmetric keys, on the assumption that these are
irrelevant for the attestation extension that is generated for the
certificate holding asymmetric public keys.

However, that change did not take into account the fact that the
AuthorizationList ASN.1 schema is re-used elsewhere in the KeyMint API,
specifically as a way of describing the characteristics associated with
a key that is being securely imported via
IKeyMintDevice::importWrappedKey.

That import process may be used for symmetrics keys, and so the tags
that are specific to symmetric keys still need to be included in
AuthorizationList.

Similarly, USER_SECURE_ID values are never included in attestation
extensions because they have no meaning off-device, but they may be
needed as part of the import of a wrapped key.

Test: TreeHugger, comment change only
Bug: 244693617
Change-Id: Iaa941e120e3641a6e6c369b7c6a51f10b44df78a
2022-09-02 17:08:04 +01:00
David Drysdale
4683a5383f KeyMint HAL: clarify obsolete tags
The tag enum names can't be removed due to AIDL back-compatibility
requirements, and also it's useful to have the values present to avoid
inadvertent reuse.

Update the tag comment text to indicate that these tags are obsolete.

Bug: 191738660
Test: TreeHugger, comment change only
Change-Id: Icbd4c9cd0313f93bc491b49eb9077766d0f44e34
2022-09-02 17:07:41 +01:00
Lorena Torres-Huerta
308e257397 Use explicit aidl versions for audio hal and soundtrigger dependencies.
There are still issues with importing implicit versions. Switching to explicit versions while b/188871598 is worked out.

Bug: 242678729
Test: m; AIDL_TRANSITIVE_FREEZE=true m aidl-freeze-api && AIDL_FROZEN_REL=true m
Merged-In: Ide6a90716bf042fbb925357e110bc84ddb9e96fb
Change-Id: Ide6a90716bf042fbb925357e110bc84ddb9e96fb
(cherry picked from commit 8296aa824b)
2022-09-01 21:57:03 +00:00
Lorena Torres-Huerta
9ae4f224ab Add AudioAttributes and AudioFlag for use in HAL interface for engine configuration.
This requires a version bump to android.media.audio.common.types.

cc_defaults and java_defaults are used in order to avoid explicitly updating version references in several Android.bp files when we do future version bumps.

Bug: 242678729
Test: m
Merged-In: Id17820f210f625e370992db4f9f85e37887b088b
Change-Id: Id17820f210f625e370992db4f9f85e37887b088b
(cherry picked from commit bf94fa32cb)
2022-09-01 21:37:43 +00:00
David Gross
ce0048732a 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

Merged-In: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971
Change-Id: I3f81d71ca3c0ad4c639096b1dc034a8909bc8971
(cherry picked from commit 79324920f7)
2022-08-31 23:02:26 +00:00
Kelvin Zhang
1cc8267aac Make BootControlHAL available in recovery
Test: th
Bug: 227536004
Change-Id: Idd0009f68598c85ef9fe234049851b9b8bd0d893
2022-08-31 16:23:38 +00:00
Qoo Lin
2ff704a6d4 Fix SetBadMetadata fail
Align Android-T

Bug: 244284552
Test: run vts -m VtsHalGraphicsMapperV4_0TargetTest
Signed-off-by: Qoo Lin <qoo.lin@mediatek.com>
Change-Id: I722981dda3b3aba97f36407e50bd338d4812a723
2022-08-31 00:53:39 +00:00
Shunkai Yao
43f9a07e04 AIDL effect: Extract common parts of effect service into cc_defaults
Bug: b/238913361
Test: atest VtsHalAudioEffectTargetTest
Merged-In: I58d925b3f4a3d41d4014f54f78d95c26cc5520ea
Change-Id: I58d925b3f4a3d41d4014f54f78d95c26cc5520ea
(cherry picked from commit c8ed5c27a1)
2022-08-30 22:34:04 +00:00
Shunkai Yao
67b1be60ab AIDL effect: Add vts for the initial effect AIDL interface implementation
Tests basic binder calls of IFactory.

Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
Merged-In: If5db3cae0447f41a149a60505d208070fbfedb7f
Change-Id: If5db3cae0447f41a149a60505d208070fbfedb7f
(cherry picked from commit 1f19c23ab6)
2022-08-30 22:13:17 +00:00
Shunkai Yao
c23916b96f AIDL effect: Minimal example implementation
Add effect factory placeholder implementation.
Update android.hardware.audio.service-aidl.example to include effects.

Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest

Merged-In: I88266b509a03ee336e22be460580c5b22123659e
Change-Id: I88266b509a03ee336e22be460580c5b22123659e
(cherry picked from commit 8a0ae5430f)
2022-08-30 22:11:16 +00:00
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