Commit graph

1402 commits

Author SHA1 Message Date
Shunkai Yao
f56afb303b AIDL: Add BassBoost strength range in AIDL definition.
Bug: 261646550
Test: atest VtsHalAudioEffectTargetTest
Change-Id: I38efed8c7cc88295c72403a3c598db5dedd8c137
2022-12-09 19:14:10 +00:00
Shunkai Yao
39bf2c3146 Audio AIDL HAL priority update
Enable RT priority inheritance.
Set minimum Audio AIDL HAL Binder access priority to ANDROID_PRIORITY_AUDIO.

Bug: 261496726
Test: atest VtsHalAudioEffectTargetTest
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I584d80f4fe344e4bfae5765cac2afb92313b6a39
2022-12-09 02:39:42 +00:00
Mikhail Naganov
625741e687 Merge "audio: Add TEST_MAPPING for presubmit testing" 2022-12-08 17:27:42 +00:00
Treehugger Robot
77494f934a Merge "audio: Add microphone settings to IModule, IStreamIn" 2022-12-07 23:38:30 +00:00
Mikhail Naganov
552dad4272 audio: Add TEST_MAPPING for presubmit testing
Currently it lists only tests for the core HAL, will
add effect HAL tests in a separate CL.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I92705f44235ff0fe38cbf86fef07518277b5f3ce
2022-12-07 20:33:51 +00:00
Mikhail Naganov
ef6bc74fc4 audio: Add microphone settings to IModule, IStreamIn
Add 'MicrophoneInfo' and 'MicrophoneDynamicInfo' parcelables.
Add IModule.getMicrophones method.
Add following methods to IStreamIn:
  - getActiveMicrophonesIds;
  - get/setMicrophoneDirection;
  - get/setMicrophoneFieldDimension.

Provide trivial implementations and VTS.

Also slightly refactor port retrieval from ModuleConfig
to unify common queries.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I472c7733e2a331a67cea613cd9218889eff06a43
2022-12-07 18:36:31 +00:00
Mikhail Naganov
cd290e90e8 Merge "audio VTS: Clarify numbers used by CompressedOffloadOutputStreamTest" 2022-12-06 02:25:27 +00:00
Mikhail Naganov
e0c9c1cbb6 audio VTS: Clarify numbers used by CompressedOffloadOutputStreamTest
Make more clear the origin of numbers used by the test
CompressedOffloadOutputStreamTest#Mp3FormatGaplessOffload.

No change in the test behavior.

Bug: 260676244
Test: m VtsHalAudioV7_1TargetTest
Change-Id: I48211ad4510dec7fe90dc6f755485283376eaa23
2022-12-05 22:09:13 +00:00
Treehugger Robot
8fcc79fcb7 Merge changes I0a18a6d9,I13a83113,I13c9c8d1,I8717acac
* changes:
  audio: Add non-blocking I/O stream operations
  audio: Fix handling of quick worker completion in StreamWorker
  audio: Report unknown stream positions explicitly
  audio: Implement transient state testing
2022-12-05 22:08:02 +00:00
Mikhail Naganov
30301a42c7 audio: Add non-blocking I/O stream operations
Introduce IStreamCallback interface for non-blocking I/O. Add 2
new stream states: TRANSFERRING and TRANSFER_PAUSED, and define
state machines for the async case. Add DrainMode as in previous
HAL versions.

Note that non-blocking input is not fully implemented because it
did not exist in previous HAL versions, and the corresponding
AudioInputFlag does not exist yet.

Enhance VTS state machine tests to allow waiting for an async
event.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I0a18a6d930dee5941f769e08083817d41ff941e6
2022-12-05 19:57:43 +00:00
Mikhail Naganov
e467e01379 audio: Fix handling of quick worker completion in StreamWorker
In tests, it is possible that the worker exits quickly,
prior to the moment when the thread controller begins
waiting for it to start. Improper handling of this case
was causing intermittent lock-ups of VTS tests.

Bug: 205884982
Test: atest libaudioaidlcommon_test
Change-Id: I13a83113b32b859e212f1a517ad61bf5b8d43365
2022-12-03 05:00:33 +00:00
Treehugger Robot
f0dba4f541 Merge "add defaults and host_supported to the AIDL interface targets" 2022-11-30 17:24:46 +00:00
Mikhail Naganov
5e01ce4cba Merge "audio VTS: Use 'IN_DEFAULT' device type for telephony" 2022-11-30 17:14:43 +00:00
David Li
4d36183b34 add defaults and host_supported to the AIDL interface targets
Test: make -j128
Merged-In: Icf69d2860419dd821b9b0730ea6cd4c4cdf42621
Change-Id: I9958d8d8849ab389f64614f3967dfa89cd6f9b95
2022-11-30 14:31:16 +00:00
Mikhail Naganov
d72b42d769 audio VTS: Use 'IN_DEFAULT' device type for telephony
This undoes the change which had happened unintentionally in
https://cs.android.com/android/_/android/platform/hardware/ \
interfaces/+/1e703f182e2fcbb9123bf661d81d22a04d0e1f8d

The device type passed to 'openInputStream' for telephony
devices should be 'AUDIO_DEVICE_IN_DEFAULT'

Bug: 259636577
Test: atest VtsHalAudioV7_0TargetTest
Test: atest VtsHalAudioV7_1TargetTest
Change-Id: Ic8f4367961346b87087c885a3cdaccab3c1407c9
2022-11-30 01:01:59 +00:00
Mikhail Naganov
549a822be2 audio: Report unknown stream positions explicitly
Instead of using 'STATUS_NO_INIT' in the case when stream
position can not be reported, use a special value for Position
fields. This streamlines processing of statuses on the client
side, by removing the need to treat 'STATUS_NO_INIT' specially.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I13c9c8d165b632900ca76de144759ef7b9200eff
2022-11-23 18:30:07 +00:00
Mikhail Naganov
bd483c03b2 audio: Implement transient state testing
Add ModuleDebug.streamTransientStateDelayMs parameter to ensure
that streams stay in transient states for the specified amount of
time. This enabled sending commands from VTS while the stream is
still in a transient state.

Add 'getStatus' stream command to retrieve current positions,
counters, and stream state. Previously we were planning to use a
zero-sized burst command for that, however, after the
introduction of stream state machines, the 'burst' command is
not handled in every stream state, and may even affect the
current state, thus it's no more usable for this purpose.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8717acace8d95d76bef2ec9fd6561796d7544992
2022-11-23 01:58:19 +00:00
Dorin Drimus
7755c25f93 Merge "Add more DTS audio encodings to the AIDL interface" 2022-11-22 14:28:44 +00:00
Shunkai Yao
812d5b4ce0 AIDL effect vts test cases refinement
Bug: 255361653
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I4d4c4de97a73d4ea6dedd9c9e1733da03860430b
2022-11-18 19:50:24 +00:00
Treehugger Robot
a335badc22 Merge changes I2dfd304c,I978432e2
* changes:
  LoudnessEnhancer: Add AIDL implementation and its unit test
  Audio AIDL Effect VTS : Extract all common parameters to defaults
2022-11-17 22:00:44 +00:00
Shraddha Basantwani
68041cab61 LoudnessEnhancer: Add AIDL implementation and its unit test
Added AIDL implementation for LoudnessEnhancer audio effect
parameters and its unit test.

Bug: 258124419
Test: atest VtsHalLoudnessEnhancerTargetTest

Change-Id: I2dfd304ca9f72383572fd1f762d41864dd73e39d
2022-11-17 10:24:06 +05:30
Shraddha Basantwani
5a2577cad6 Audio AIDL Effect VTS : Extract all common parameters to defaults
Bug: 258124419
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: I978432e2efcdcbb7341000b39b5f39e0e5d82eb7
2022-11-17 10:23:58 +05:30
Shunkai Yao
f0c263b547 Use AIDL effect bundle in effectserviceexampleimpl.
Bug: 255361653
Test: atest VtsHalAudioEffectTargetTest
atest VtsHalAudioEffectFactoryTargetTest
atest VtsHalEqualizerTargetTest

Change-Id: Ia50ff5066e007f6a8569114e36f0e4565a6100ea
2022-11-16 18:09:17 +00:00
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
Dorin Drimus
76ed0594e7 Add more DTS audio encodings to the AIDL interface
Allow the additional DTS encodings (ENCODING_DTS_HD_MA and ENCODING_DTS_UHD_P2) in the audio_policy_configuration.xsd schema file for the AIDL interface.

Change-Id: Id87b5bcbc1729c6d5158770ffd891b32367a877a
Test: atest DtsAudioFormatsTest
Bug: 235469058
Bug: 243789303
2022-11-11 10:54:13 +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