Commit graph

1378 commits

Author SHA1 Message Date
Mikhail Naganov
88cb2f4662 audio: Add missing GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST
This fixes test error when on devices that do not have
AIDL HAL.

Bug: 205884982
Bug: 259294358
Test: m
Change-Id: I6cec10f35cd42eb06947bf483555287257a6a58e
2022-11-15 22:11:17 +00:00
Shunkai Yao
6c04ef2c55 Merge changes from topic "aidl_audio_effect_8_config"
* changes:
  Add effect config xml parser in AIDL effect factory
  Support effect config parser in effect AIDL
2022-11-14 15:24:01 +00:00
Mikhail Naganov
2b68543625 Merge "audio: Make StreamDescriptor::Command a union" 2022-11-11 04:34:04 +00:00
Shunkai Yao
60b34b78a4 Add effect config xml parser in AIDL effect factory
Bug: 255361653
Test: parse an example audio_effects.xml
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalAudioEffectTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I566aaf814470342f1ef55414889bbd3aea462f9a
2022-11-11 00:14:50 +00:00
Shunkai Yao
52abf0a662 Support effect config parser in effect AIDL
Bug: 255361653
Test: parse an example audio_effects.xml
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalAudioEffectTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I086905bcbe113a56767cae45102c84f5250d348e
2022-11-10 22:38:55 +00:00
Treehugger Robot
c6eb5c9104 Merge "audio: Add volume/mute, audio mode, and screen state to IModule" 2022-11-10 22:12:41 +00:00
Mikhail Naganov
98334439d5 audio: Make StreamDescriptor::Command a union
Previously StreamDescriptor::Command used to be a parcelable
holding a command code (enum) + a command argument which was
used for one command only. This got replaced with an equivalent
union, where each command w/o arguments is represented by a
'Void' variant, and the command with an argument with a variant
of a corresponding type.

This has the following benefits:

  - the union guarantees that the argument is only set for
    commands that actually use it, thus all related comments
    and validations can be removed;

  - the command dispatch can be turned into an exhaustive
    switch.

To be able to use an exhaustive switch, the 'exit' command
has been exposed at the interface, but marked as 'hal_reserved'.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I3f2c27a48e4d0b7cfce1171244b2eddc1637005f
2022-11-10 21:37:19 +00:00
Mikhail Naganov
3b125b76aa audio: Add volume/mute, audio mode, and screen state to IModule
Add the following methods to IModule:
 - getTelephony;
 - get/setMasterMute;
 - get/setMasterVolume;
 - get/setMicMute;
 - updateAudioMode;
 - updateScreenRotation;
 - updateScreenState;
The "update..." methods are "informational," the HAL may ignore
them and must not raise any errors.

ITelephony currently contains 2 methods:
 - getSupportedAudioModes;
 - switchAudioMode.
This "switchAudioMode" must validate the argument, and must
switch the HAL to the new mode synchronously.

Implement and add VTS tests.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I9174c81fe7d16f7068257051ae5e129b15e82648
2022-11-09 18:55:07 +00:00
Mikhail Naganov
9cce6228ac Merge "audio: Fix HAL reply handling in CompressedOffloadOutputStreamTest" 2022-11-09 16:02:49 +00:00
Eric Laurent
b40d5856bc Merge "audio: Add audio_policy_configuration.xsd for the parser" 2022-11-09 08:41:53 +00:00
Shunkai Yao
6c370645c6 Move equalizer header file to Equalizer folder
Bug: 255361653
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: Ic1f9dedd35ec6cb0c1753106bdd5530f572d31ff
2022-11-08 02:45:25 +00:00
Mikhail Naganov
b1f182cbcb Merge changes Ibed7f4c3,I8a9f4f0b
* changes:
  audio: Add pause, resume, and standby stream operations
  audio: Add 'join' method to StreamWorker
2022-11-07 18:33:21 +00:00
Steven Moreland
52ed38da36 use binder_auto_utils.h ostream
Bug: N/A
Change-Id: I56f39241b35fc1962baf95f4a5c93aff1cbd705c
Test: N/A
2022-11-04 22:12:02 +00:00
Shunkai Yao
6755d76d9d Use final specifier for all effects implementation classes.
Avoid inherit from effect implementation class, all
implmentations should inherit EffectImpl directly.

Bug: 255361653
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I3c3bd990423be21f2c79f0e797d71b2d7f850dca
2022-11-02 00:26:44 +00:00
Mikhail Naganov
bae409f6c6 audio: Fix HAL reply handling in CompressedOffloadOutputStreamTest
Increase data position based on the HAL consumption of data,
on the production by the test.

Bug: 254806348
Test: atest VtsHalAudioV7_1TargetTest:CompressedOffloadOutputStream/CompressedOffloadOutputStreamTest
Change-Id: I33a86ec62662ba4738c70c15b77ece0135da7d29
2022-11-01 00:16:54 +00:00
Shunkai Yao
6afc855087 AIDL effect: Add all aosp effects default implementation
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I6825ba77ae0707f97e852f0faa52ce3486ba2af5
2022-10-31 22:53:57 +00:00
Shunkai Yao
82a6f7a8ad AIDL effect: Add all aosp effect parameters definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: Ice5cac10956c419c04be44f9142b5b2935cacf3b
2022-10-31 22:18:43 +00:00
Shunkai Yao
464775e777 AIDL effect: init effect test case with effect factory service.
Bug: 255578432
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: Ib73811c602b5fd8f647ede1033ea62ee65e36a0b
2022-10-31 19:15:35 +00:00
Mikhail Naganov
445bb348fc audio: Add audio_policy_configuration.xsd for the parser
The default implementation will include an XML APM config
parser generated from the XSD schema. This CL provides the
schema file. It was copied from HIDL/7.1 and augmented
with new formats.

Bug: 255477173
Test: N/A
Change-Id: Ic0a09ba044d87165441671a2b2601b0a8177e5fa
2022-10-28 22:57:53 +00:00
Mikhail Naganov
cce8e5f39d audio: Add pause, resume, and standby stream operations
Clarify and verify in VTS that the data FMQ of StreamDescriptor
is a transient buffer. The consumer must always read its entire
contents. This is the same behavior as in the HIDL HAL.

Define the state machine for streams and the set of commands for
transferring between states.

Clarify and verify in VTS that the frame counter of the
observable position must never be reset.

Implement commands for the synchronous I/O case.

Refactor stream test logic to simplify testing of state
transitions.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ibed7f4c3e77852863714f1910112f664b32d5897
2022-10-28 20:58:10 +00:00
Mikhail Naganov
705297317b audio: Add 'join' method to StreamWorker
This is intended for use in tests where the worker
just executes some actions and then exits by itself.
Use of 'join' instead of 'stop' ensures that the
worker goes through all actions.

Bug: 205884982
Test: atest libaudioaidlcommon_test
Change-Id: I8a9f4f0bb786ee606e3b63a9847f414119716a7d
2022-10-20 01:21:01 +00:00
Shunkai Yao
a4ab38caf0 AIDL effect: Add Equalizer parameters implementation and vts
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I94b2283ca2aa0e45715e1c9ac3ea6ad809ec2a2c
2022-10-19 19:13:25 +00:00
Shunkai Yao
e3559444b3 AIDL effect: Add Equalizer parameters definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: Ice305308379598a8cd286fc14818798e589ffc18
2022-10-19 19:12:57 +00:00
Shunkai Yao
08b687ded7 AIDL effect: Add queryProcess in IFactory
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest; atest VtsHalAudioEffectFactoryTargetTest
Change-Id: I5518ceaa0ea744e30803fc23996e2a2b48398024
2022-10-15 00:03:37 +00:00
Shunkai Yao
bd9c79cbd8 Remove the absolute path in AIDL EQ Android.bp
Bug: 253474521
Test: m android.hardware.audio.effect.service-aidl.example; m libequalizer
Change-Id: Ic8ce31572e2fc6c566e306c25350680a7d352709
2022-10-13 18:43:53 +00:00
Shunkai Yao
bc71b029bf Merge changes from topic "aidl_audio_effect3"
* changes:
  AIDL effect: Add effect AIDL implementationi and vts test
  AIDL effect: Add effect AIDL definition
2022-10-13 02:14:39 +00:00
Shunkai Yao
ea24c1a128 AIDL effect: Add effect AIDL implementationi and vts test
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest; atest VtsHalAudioEffectFactoryTargetTest
Merged-In: If8000b7396360996bdfb8eb269bc3de543871673
Change-Id: If8000b7396360996bdfb8eb269bc3de543871673
2022-10-13 02:14:23 +00:00
Shunkai Yao
0632ae6cd1 AIDL effect: Add effect AIDL definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest; atest VtsHalAudioEffectFactoryTargetTest
Merged-In: I8cc902df0a396d0703839b8933318a26aab2e38d
Change-Id: I8cc902df0a396d0703839b8933318a26aab2e38d
2022-10-13 02:13:20 +00:00
Lorena Torres-Huerta
0ba91e5759 Add surround sound configuration to the AIDL Audio HAL interface.
Bug: 205884982
Test: m android.hardware.audio.service-aidl.example
Change-Id: Ie8c69c6f0437ba6527c28f525eb06d1e338e3abc
2022-10-06 05:48:22 +00:00
Xin Li
c208de1713 Merge TP1A.221005.003
Merged-In: I1fcfa29d7841a1cb73bafb1ea92f3b1630992ae9
Change-Id: I56a99c984732258849fc58052c65371d5c31e6fc
2022-10-03 13:17:46 -07:00
Florian Mayer
4eeda58ce2 Merge "Revert "Disable FilterTest/1#FilterOutNonVendorTags on HWASan."" 2022-09-28 21:03:20 +00:00
Florian Mayer
0d8a45944f Revert "Disable FilterTest/1#FilterOutNonVendorTags on HWASan."
This reverts commit 40a4639e51.

Reason for revert: Speculative rollback after fix in b/248637663

Bug: 230535046
Change-Id: I72b5242dbc73587004e31305e3b25c13cc7b5827
2022-09-28 00:25:45 +00:00
Chih-hung Hsieh
f4a9ee68a3 Merge "Fix out-of-memory error." 2022-09-27 07:17:21 +00:00
Chih-Hung Hsieh
739fbefe2d Fix out-of-memory error.
Bug: 248637663
Test: atest android.hardware.audio.common@7.0-util_tests android.hardware.audio.common@7.1-util_tests
Change-Id: Ifb41ddc3fbfa8c9db7f3e10cede2155d28d3c8c4
2022-09-24 18:07:38 -07:00
Shunkai Yao
121c6ddc99 AIDL effect: Refine some implementation and test logic.
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
Change-Id: I5a9bb542872de6c5700fa6b14e124e9b9e206da6
2022-09-22 01:36:58 +00:00
Shunkai Yao
4590517a96 AIDL effect: Initial IEffect interface implementation and vts test
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
Merged-In: Id64d28af9122e82acd96e3349cf37c3d9728069a
Change-Id: Id64d28af9122e82acd96e3349cf37c3d9728069a
2022-09-22 01:36:00 +00:00
Shunkai Yao
84efa03de3 AIDL effect: Initial IEffect interface definition
Bug: 238913361
Test: atest VtsHalAudioEffectTargetTest
Merged-In: I0d02fed5d40a108003e735d3619e2fc7c0ef6332
Change-Id: I0d02fed5d40a108003e735d3619e2fc7c0ef6332
2022-09-22 00:43:47 +00:00
Mikhail Naganov
1cbe492d59 Sync audio_policy_engine_configuration.xsd with the SDK
The audio_policy_engine_configuration.xsd schema was missing
four values for the usage enum. This was causing the VTS
test to fail. These usages must be specified in the audio
policy engine configuration file, otherwise a GTS test fails.

Bug: 245303963
Bug: 246231268
Bug: 246901091
Test: atest VtsHalAudioPolicyV1_0TargetTest
Change-Id: I0161ddb33e52cbca9b425c0cbb4f32f320c43af4
2022-09-21 18:23:06 +00:00
Mikhail Naganov
00bac4ea16 audio: Refactor transaction status checks in VTS
Introduce a GTest-like macro for validating the transaction
status. Refactor the code of VTS to use it.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I91d9ed03c7fb72f5bee55f94653499960be3e497
2022-09-15 23:58:50 +00:00
Mikhail Naganov
e503e08107 Merge "audio: Cleanups and refactorings" 2022-09-13 17:55:22 +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
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
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