Commit graph

974 commits

Author SHA1 Message Date
Mikhail Naganov
d338aebc38 Add AUDIO_FORMAT_MAT to the list of formats in XSD
This format is known to the framework since Android Q, and its lack
from the XSD was an issue, which only got fixed in
Audio HAL V7.

Bug: 176536594
Test: atest VtsHalAudioV5_0Target
Change-Id: I32ccb926b5ad9202a5a6329d7069db37563ff45b
2021-01-22 23:12:36 +00:00
Mikhail Naganov
d5b489a3de Fix UninstantiatedParameterizedTestSuite errors in Audio HAL
Fix the specification of the test suite name passed to
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST to
avoid UninstantiatedParameterizedTestSuite errors.

Bug: 177344488
Test: atest VtsHalAudioV6_0TargetTest
Test: atest VtsHalAudioV7_0TargetTest
Change-Id: I418a488faa61c3bee2b959747e97483428d624b0
2021-01-20 15:21:22 -08:00
Mikhail Naganov
4ffb092362 Audio: Add VTS tests for invalid enum-strings, Part 3
Add checks for rejection of invalid port configs.
Fix the default implementation to pass the tests.

Clarified that patch-related operations in IDevice
are optional.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
Test: atest VtsHalAudioV7_0TargetTest
      with side-loaded V7 default wrapper
Change-Id: I08e85d4883938b4d8f3c411be9fb1bd597eea0c2
2021-01-12 15:34:45 -08:00
Mikhail Naganov
0dbf3982af Audio: Add VTS tests for invalid enum-strings, Part 2
Add checks for rejection of invalid device addresses
and base configs.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
Test: atest VtsHalAudioV7_0TargetTest
      with side-loaded V7 default wrapper
Change-Id: I39690f2a171c1be6246ab155dec8e2b1a405a2a8
2021-01-08 17:51:24 -08:00
Mikhail Naganov
9139399bad Audio: Add VTS tests for invalid enum-strings, Part 1b
Add missing checks for invalid channel mask and tags
in playback and record metadata. Fix the behavior of
the default wrapper.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
Test: atest VtsHalAudioV7_0TargetTest
      with side-loaded V7 default wrapper
Change-Id: Ie0f82b2becc457b735349eb351ea29989a64f22c
2021-01-07 18:35:11 -08:00
Mikhail Naganov
3f1457b953 Audio: Add VTS tests for invalid enum-strings, Part 1
Add tests that try passing invalid enum-string values to HAL
methods taking enum-strings. Fix issues found in the default
wrapper.

Interface updates:

- Update AudioConfig structure to indicate whether
  AudioOffloadInfo is specified.

- Add return value to IStreamIn.updateSinkMetadata
  and IStreamOut.updateSourceMetadata to provide indication
  of invalid arguments.

- Specify the behavior of IDevice.open{Input|Output}Stream
  in the case of invalid arguments vs. rejected config.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
Test: atest VtsHalAudioV7_0TargetTest
      with side-loaded V7 default wrapper
Change-Id: I6bd7be3869cc7a8d5d00506565bbf0b3a050b630
2021-01-07 10:32:06 -08:00
Eric Laurent
daedb0dc2e audio HAL V7: Update track metadata
Add channel mask and audio attributes tags to playback
and record track metadata sent to audio HAL.

The legacy HAL wrapper supports older legacy HAL versions
by sending partial metadata when the legay HAL version is
less than 3.2.

Bug: 168751366
Test: make
Change-Id: Iba3ee3b669e4300201374d4a0d5cf45a04872274
Merged-In: Iba3ee3b669e4300201374d4a0d5cf45a04872274
2021-01-05 12:50:40 -08:00
Treehugger Robot
85959e1682 Merge "Audio: Fix automatic version replacement in IStreamOutEventCallback.hal" 2020-12-28 20:08:24 +00:00
Mikhail Naganov
d7d258014e Audio: Fix automatic version replacement in IStreamOutEventCallback.hal
The version update script created a typo in the doc string
of IStreamOutEventCallback.

Test: N/A
Change-Id: I331a2781ecb212275d0f8acee33ff49d01714b53
2020-12-22 23:20:57 +00:00
Mikhail Naganov
79903fea44 Audio VTS: Improve stability, update config validation test
Major challenge: the configuration of HAL tests
depends on the APM XML configuration file which may be
invalid. The code that reads the configuration
has been updated to avoid crashes when the config
is invalid.

In CheckConfig_audioPolicyConfigurationValidation the
dependency on the config parser was removed. Previously,
a failure to parse the config by the config parser would
lead to the test being skipped, which isn't correct
as it must fail in this case.

Minor fixes to V7 tests to pass on a real life legacy HAL.

Bug: 36733185
Test: run VtsHalAudioV7_0TargetTest on a device with V6
Test: run VtsHalAudioV7_0TargetTest on a device with
      a side-loaded V7 and invalid APM config file
Test: run VtsHalAudioV7_0TargetTest on a device with
      a side-loaded V7
Change-Id: I746339ff69ab455dc64eef9a17827d047b357329
2020-12-16 15:30:28 -08:00
Mikhail Naganov
bae2336665 HidlUtils: remove temporary conversion functions
Remove temporary conversion functions and update
the code that was using them.

Bug: 142480271
Test: m
Change-Id: Idf36dbac398efbc03bd6da68c79f6fb1ddc24e9c
Merged-In: Idf36dbac398efbc03bd6da68c79f6fb1ddc24e9c
2020-12-16 01:14:03 +00:00
Mikhail Naganov
f363ed4f96 audio: Update default effect HAL wrapper to support V7
During this conversion, the functionality of the V7 wrapper
hasn't been tested yet. This will be done in a separate CL
that will also include required updates to the VTS tests.

Since the changes were made to the code shared with pre-V7
versions, verified that V6 HAL didn't regress.

Bug: 142480271
Test: atest VtsHalAudioEffectV6_0TargetTest
Test: m VtsHalAudioEffectV7_0TargetTest
Test: m android.hardware.audio@7.0-service.example
Change-Id: I72389c8d564596bef22b47dfdcb2e77d636ef0a3
Merged-In: I72389c8d564596bef22b47dfdcb2e77d636ef0a3
2020-12-16 01:14:02 +00:00
Mikhail Naganov
e1a9c8f8b8 audio: Update default wrapper to support V7
During this conversion, the functionality of the V7 wrapper
hasn't been tested yet. This will be done in a separate CL
that will also include required updates to the VTS tests.

Since the changes were made to the code shared with pre-V7
versions, verified that V6 HAL didn't regress.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
Test: m VtsHalAudioV7_0TargetTest
Change-Id: I0e42fe1279912ffa78ce40c69f6aa2054e84d385
Merged-In: I0e42fe1279912ffa78ce40c69f6aa2054e84d385
2020-12-16 01:14:02 +00:00
Mikhail Naganov
b52e93f516 audio: Extend HidlUtils for the default wrapper needs
Add conversions used by the default wrapper.

Promote some conversions to pre-V7 interface to reduce
version-based forking in the default wrapper code.

Bug: 142480271
Test: atest android.hardware.audio.common@7.0-util_tests
Change-Id: I93c482eeaf08442271be2656693be5395ca53762
Merged-In: I93c482eeaf08442271be2656693be5395ca53762
2020-12-16 01:14:02 +00:00
Mikhail Naganov
ec5df2d747 audio: Use docstrings instead of comments in types.hal files
Converted comments into docstrings for enums and structures
in Audio HAL V7 definition.

Bug: 142480271
Test: m
Change-Id: Id5e36e7a42e2600ab69612819f8260110871c711
Merged-In: Id5e36e7a42e2600ab69612819f8260110871c711
2020-12-11 22:10:50 +00:00
Mikhail Naganov
1b444a5332 Implement a.h.audio.common@7.0-util module
This includes a rewrite of HidlUtils for V7.
A unit test is added for its conversion functions.

Made necessary minor adjustments to the HAL V7 types.
Also, fixed definition of 'audioFormatsList' to allow for
vendor extensions.

Bug: 142480271
Bug: 173647783
Test: m && atest android.hardware.audio.common@7.0-util_tests
Change-Id: Ib883f1c246fce78c004846516699aa724d4b5d44
Merged-In: Ib883f1c246fce78c004846516699aa724d4b5d44
2020-12-11 22:10:10 +00:00
Mikhail Naganov
4122f6328a Move UUID conversions into their own class
Mechanical extraction of HidlUtils::uuidFrom/ToHal into
a dedicated class UuidUtils.

Bug: 142480271
Test: m
Change-Id: Ic5333ba32dc293f32c5562d0ef05bde8e5f9b302
Merged-In: Ic5333ba32dc293f32c5562d0ef05bde8e5f9b302
2020-12-11 22:09:43 +00:00
Treehugger Robot
f3ff53da1a Merge changes from topic "aosp-audio-base-h"
* changes:
  audio: Add @export annotations to microphone-related enums
  Make audio*-base.h files autogenerated again
2020-12-10 22:57:35 +00:00
Mikhail Naganov
37d78b45e7 audio: Add @export annotations to microphone-related enums
This addresses long-standing TODOs in system/audio.h.
Annotated the following enums:

 - AudioMicrophoneChannelMapping;
 - AudioMicrophoneLocation;
 - AudioMicrophoneDirectionality.

This allows removing hand-written conversion functions
since the values are guaranteed to match between HIDL and
system/audio.h.

Bug: 122858783
Test: m
Change-Id: I2bf250ef9154a7ae86679afa566c80dfd01f1d5b
Merged-In: I2bf250ef9154a7ae86679afa566c80dfd01f1d5b
2020-12-09 23:37:48 +00:00
Mikhail Naganov
2287a249a6 Make audio*-base.h files autogenerated again
Major change: audio-base.h is generated from "core" types.hal,
new file audio_common-base.h is generated from "common" types.hal.

In order to be able to add system-only constants to generated
enums, the latter are made anonymous, values got "HAL_" prefix.
Then in system/audio.h a full enum is constructed.

Removed audio_drain_type_t from exported, as it belongs to
libhardware only.

Added missing enums that were introduced at the system side
only in Android R.

Bug: 122858783
Test: m
Change-Id: I8c017912395a03beacea077fd562fae2329ad975
Merged-In: I8c017912395a03beacea077fd562fae2329ad975
2020-12-09 23:36:48 +00:00
Treehugger Robot
b5cb89cfbf Merge "Changing package for audio_policy_configuration_V7_0" am: a173639924
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1518401

Change-Id: I70139a32c4e58d29b63b43e41c79af897dfa0df6
2020-12-07 19:08:24 +00:00
Hayden Gomes
4e7d69e751 Changing package for audio_policy_configuration_V7_0
- Changed package to use android. prefix
- Added nullability flag to xsd_config

Bug: 171572311
Test: built and atest VtsHalAudioEffectV7_0TargetTest
VtsHalAudioEffectV7_0TargetTest VtsHalAudioEffectV4_0TargetTest
VtsAidlHalAudioControlTest

Change-Id: I9ac83a98256404313b5efef17c0a164d2ee72136
Merged-In: I9ac83a98256404313b5efef17c0a164d2ee72136
2020-12-04 16:50:37 +00:00
Xin Li
8ac301f5f1 Merge "Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855" into stage-aosp-master 2020-12-03 03:19:13 +00:00
Xin Li
c026d3a0b6 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: If5afd00334e8b09250df1ae97dec9285e39ad930
Change-Id: Ic66bb1389f1bbecfdaa641e1fcdbf79044f55d23
2020-12-02 00:32:27 -08:00
Mikhail Naganov
c9dbca51e6 audio: Align lists of enum values between framework and HAL
Enum values defined in the XSD now correspond to the
"no system definitions" lists of enums in
system/media/audio/audio-hal-enums.h.

Added channel masks that used to be in s/m/a/audio-base-utils.h.
Removed use of "vectors of vectors" for channel masks
since individual channels are not allowed to be used
in the APM config and at the HAL transport level.

Fixed definition of the gain mode of audio ports:

1. Since it's a bit mask in the framework, it must be a list in
   the audio policy configuration XML file. Note that the old
   definition is compatible with the new one as one element is a
   valid list.
2. As gain mode is defined in the XSD file, it shouldn't be
   defined again in types.hal.

Bug: 122858783
Bug: 142480271
Test: audio smoke tests
Change-Id: I2df5eb4bc4a393611d3adb0ee30583767197591b
Merged-In: I2df5eb4bc4a393611d3adb0ee30583767197591b
2020-12-01 23:37:53 +00:00
Mikhail Naganov
12776a1b3d Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I07e96ae99724f38fe0b40194f4feab7ff68418e7
Merged-In: I07e96ae99724f38fe0b40194f4feab7ff68418e7
2020-11-24 03:44:08 +00:00
Mikhail Naganov
94ab03a3a2 Remove PREUPLOAD.cfg from audio HAL example
As suggested by the comment on ag/12691153

Bug: 142480271
Test: N/A
Change-Id: Ic9e2b986d3f9734dd884a2c88ca86d251147126b
Merged-In: Ic9e2b986d3f9734dd884a2c88ca86d251147126b
2020-11-21 01:16:10 +00:00
Mikhail Naganov
d72a7c27ab audio: Implement VTS tests for V7.0
The major change in V7.0 is use of enum values defined
in the Audio Policy Configuration XSD schema. This allows
decoupling types used at the HIDL layer from system/audio.h.
Added a header audio_policy_configuration_V7_0-enums.h
with utility functions analogous to ones from system/audio.h
but defined for the types generated from XSD schema.

Since the code of VTS tests is shared between versions,
ensured that the VTS tests for the previous HAL versions
didn't regress.

Bug: 142480271
Test: atest VtsHalAudioV6_0TargetTest
      atest VtsHalAudioEffectV6_0TargetTest
      atest VtsHalAudioV7_0TargetTest
      atest VtsHalAudioEffectV7_0TargetTest
Change-Id: Ia7c2d49a02783725080c8fed6a25853e91bba487
Merged-In: Ia7c2d49a02783725080c8fed6a25853e91bba487
2020-11-21 01:15:53 +00:00
Mikhail Naganov
baf57fb136 audio: Add example HAL implementation
This is partial implementation of the example V7.0 audio HAL
which passes VTS tests. Note that the 'core' part
of the HAL (IDevice/IStream) isn't implemented yet.
It passes VTS because it doesn't provide any devices
(modules) and the audio HAL isn't the 'default' instance.

Bug: 142480271
Test: atest VtsHalAudioV7_0TargetTest
      atest VtsHalAudioEffectV7_0TargetTest
Change-Id: Ie3dd62c5db1cdb5534df4dd7f326c4c8776bf3c4
Merged-In: Ie3dd62c5db1cdb5534df4dd7f326c4c8776bf3c4
2020-11-21 01:15:39 +00:00
Mikhail Naganov
1074c22fe1 audio: Reformat README as Markdown
Rename README -> README.md, reformat it as Markdown.
Provide missing descriptions for some directories.

Bug: 142480271
Test: N/A
Change-Id: Ic6f60a21def4bf210a7e1446454d709f68a13422
Merged-In: Ic6f60a21def4bf210a7e1446454d709f68a13422
2020-11-21 01:15:19 +00:00
Mikhail Naganov
355dd0630c audio: HAL V7 tweaks
- rename AudioBasicConfig -> AudioConfigBase to better
  match a similar structure in audio.h;

- define AudioProfile structure for defining an I/O profile;

- use AudioProfile to replace IStream.getSupported* methods
  with a single IStream.getSupportedProfiles method;

- define AudioDevice type for convenience and clarity;

- move enums definition for AudioInputFlags and AudioOutputFlags
  into XSD. This allows parsing APM config w/o depending on
  the framework code.

Bug: 142480271
Test: m
Change-Id: I1951b2de383751fe53b96954dfd02cdd1ab6cc8f
Merged-In: I1951b2de383751fe53b96954dfd02cdd1ab6cc8f
2020-11-21 01:15:03 +00:00
Mikhail Naganov
fda20429b4 Audio: Rearrange types in V7
Update channel mask and SR lists to conform to XSD.
Added a script for converting existing APM XML files.

Bug: 142480271
Test: m
Change-Id: I986b9bccdade5fa850b06b033143388715a656af
Merged-In: I986b9bccdade5fa850b06b033143388715a656af
2020-11-20 01:41:38 +00:00
Mikhail Naganov
a8814e51be Audio: Build file updates
Add target for the library with code generated by xsdc.

Temporarily disable default implementation and VTS targets.

Bug: 142480271
Test: m
Change-Id: I6c891893398617a36f4748f185e189064ba4d4ee
Merged-In: I6c891893398617a36f4748f185e189064ba4d4ee
2020-10-27 15:24:36 +01:00
Mikhail Naganov
60ced768f3 Audio: Copy HAL V6 into V7
This is an automated copy performed using copyHAL.sh script.

Bug: 142480271
Test: m
Change-Id: Ifd91cc0bb59608cd92d1d8e4e76c3abea0a8da5e
Merged-In: Ifd91cc0bb59608cd92d1d8e4e76c3abea0a8da5e
2020-10-27 15:24:36 +01:00
Mikhail Naganov
3b1172dfe4 Audio: Update and fix copyHAL script
Make necessary updates and fixes to produce HAL V7 and VTS.

Bug: 142480271
Test: audio/common/all-versions/copyHAL.sh 6.0 7.0 &&
      atest --rebuild-module-info -b VtsHalAudioV7_0TargetTest &&
      m
Change-Id: I5bc2344dae611fbf7e3e0fef185deee999c4aefa
Merged-In: I5bc2344dae611fbf7e3e0fef185deee999c4aefa
2020-10-27 15:24:36 +01:00
Grzegorz Kolodziejczyk
b5f2d23e26 Introduce LE Audio software provider for bluetooth audio 2.1
Patch introduces LE Audio software encoding provider for bluetooth audio 2.1.

Bug: 150670922
Tag: #feature
Test: vts-tradefed run vts -m VtsHalBluetoothAudioV2_1TargetTest
Sponsor: jpawlowski@
Change-Id: If668593be7a46c9abcc45d21c5bdb9b493864cc1
2020-10-09 17:54:44 +00:00
Dan Shi
f27b504a10 Remove vts10 reference vts_target_tests_defaults
The module is obsoleted.

Bug: 169581727
Test: build
Change-Id: I55853a2cde4c042c489b0e6ac8bcab93fc47be73
2020-10-05 10:48:24 -07:00
Dan Shi
ecbff25e71 Merge "Suppress gtest error for tests without any instance" am: de3f15adc0 am: acfabe652f am: 6086e20a02
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1425889

Change-Id: Ifcff46f571a3b4d0fdd996c1249a8838ca1d7e84
2020-09-16 00:00:37 +00:00
Dan Shi
ac9cf4482b Suppress gtest error for tests without any instance
Bug: 162052785
Test: m -j vts
Change-Id: I627d6790aa08aa9c6e3c5b8bdc533213ee08de21
Merged-In: I627d6790aa08aa9c6e3c5b8bdc533213ee08de21
2020-09-11 11:02:25 -07:00
Xin Li
36dcf1a404 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I6502829205ede2de914b27e6c2c5c42916af2b39
Change-Id: I7cb06511e43bd1fffd5f80a11dbdf5b1314cfe8e
2020-08-28 13:05:04 -07:00
Jasmine Cha
10828b9168 Audio VTS: Fix empty parameter list failures for AudioV6 am: 1eb1f36877 am: 0c0bdf4db2 am: 58a2095cc0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1382482

Change-Id: I6711731b080eed56c7605194fa83faa8e76367cc
2020-08-03 21:01:37 +00:00
Jasmine Cha
58a2095cc0 Audio VTS: Fix empty parameter list failures for AudioV6 am: 1eb1f36877 am: 0c0bdf4db2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1382482

Change-Id: I7798e6c080a090459a646d9ee3013f3d101b5978
2020-08-03 20:33:06 +00:00
Jasmine Cha
1eb1f36877 Audio VTS: Fix empty parameter list failures for AudioV6
For AudioV6, OptionalInputBufferSizeTest isn't included in macro
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST.

Bug: 162715033
Test: atest VtsHalAudioV6_0TargetTest

Signed-off-by: Jasmine Cha <chajasmine@google.com>
Change-Id: I526fe166594283540804ee61265c6000de5a89e8
2020-08-03 08:49:38 +00:00
Treehugger Robot
b4a1b4f93a Merge "Provide defaults for android.hardware.audio@6.0-impl" am: 3f5116a1f6 am: 5912212c62 am: 3ef9947624
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1366502

Change-Id: I6bfc3c3cc6209c93721d490d644f5babf10682cc
2020-07-22 17:31:46 +00:00
Treehugger Robot
3ef9947624 Merge "Provide defaults for android.hardware.audio@6.0-impl" am: 3f5116a1f6 am: 5912212c62
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1366502

Change-Id: Ib211fdb5c61f6ad1893561d9bd6d86bff0b28178
2020-07-22 17:05:44 +00:00
Treehugger Robot
3f5116a1f6 Merge "Provide defaults for android.hardware.audio@6.0-impl" 2020-07-22 16:37:39 +00:00
Mikhail Naganov
cc4656f5a8 Audio VTS: Suppress empty parameter list failures am: b9743d4728 am: 948929d067 am: 4084fa17b5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1368656

Change-Id: I6384554bbd26a38c8b3e947b1db313e841d4cd56
2020-07-22 00:47:30 +00:00
Mikhail Naganov
4084fa17b5 Audio VTS: Suppress empty parameter list failures am: b9743d4728 am: 948929d067
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1368656

Change-Id: I3d5925bd34bd84cbf65cf6f86797c1a4f4263ac6
2020-07-22 00:33:45 +00:00
Mikhail Naganov
b9743d4728 Audio VTS: Suppress empty parameter list failures
GTest has introduced a check verifying that the parameter list
for TEST_P tests isn't empty. Having an empty parameter list
isn't actually a problem when the VTS test runs on a device
that lacks the corresponding HAL version.

Bug: 161758075
Test: atest VtsHalAudioV4_0TargetTest
Test: atest VtsHalAudioV5_0TargetTest
Test: atest VtsHalAudioV6_0TargetTest
Test: atest VtsHalAudioEffectV4_0TargetTest
Test: atest VtsHalAudioEffectV5_0TargetTest
Test: atest VtsHalAudioEffectV6_0TargetTest
Change-Id: Ib2a017b74f69b1608d8985f403e9b2a8e54b8311
2020-07-21 10:57:03 -07:00
Roman Kiryanov
411edccbb3 Provide defaults for android.hardware.audio@6.0-impl
This will allow vendors to create instances of
this library with other names. A different name
is required if a vendor wants to provide a custom
version (e.g. in HIDL) of
android.hardware.audio@6.0-impl and still
be able to use the library itself (e.g. to load
audio.r_submix.default) -
android.hardware.audio.service does not load both
libraries and prefers the default one.

Bug: 161485545
Test: boot emulator, check if audio works
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I55c4f9b1386be3464ad0f5f2568423843e7eae88
2020-07-20 16:08:17 -07:00