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
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
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
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
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
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
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
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
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
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
- 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
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
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
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
- 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
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
- 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
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
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
This is an automated copy performed using copyHAL.sh script.
Bug: 142480271
Test: m
Change-Id: Ifd91cc0bb59608cd92d1d8e4e76c3abea0a8da5e
Merged-In: Ifd91cc0bb59608cd92d1d8e4e76c3abea0a8da5e
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
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
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.
Added 'AUDIO_SOURCE_HOTWORD'.
Bug: 122858783
Bug: 142480271
Test: audio smoke tests
Change-Id: Ie5896775b6bc7dfd3ab158c4a7b497dbda827e9d
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
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
- 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
Add target for the library with code generated by xsdc.
Temporarily disable default implementation and VTS targets.
Bug: 142480271
Test: m
Change-Id: I6c891893398617a36f4748f185e189064ba4d4ee
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
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
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