Commit graph

73 commits

Author SHA1 Message Date
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
77d6f101e7 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
2020-12-11 14:05:10 -08: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
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
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
Eric Laurent
a0ff4be4b3 audio HAL: add output flag indicating support for gapless transitions
Add output profile flag AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD to be used in
conjunction with AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD to indicate
that gapless transitions are supported when playing compressed audio.

Bug: 158191844
Test: make
Change-Id: Ifa551ff36d8571062cac3ad38f89be2f3addb960
2020-11-26 20:15:51 +01: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
8e85d1f5a5 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
2020-11-20 15:26:14 -08: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
5b8a144d8c 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
2020-11-19 17:13:20 -08:00
Hayden Gomes
e502a601c9 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
2020-11-11 15:41:32 -08:00
Mikhail Naganov
9d9f970ee4 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
2020-11-02 19:56:48 +00: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
a5273c760c 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
2020-10-26 20:15:17 +00:00
Mikhail Naganov
bbbec8229f 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
2020-10-23 00:22:30 +00:00
Mikhail Naganov
b0c4bd081e Revert "audio: Align lists of enum values between framework and HAL"
Revert submission 12851233-hal-enum-strings

Reason for revert: breaks slider device
Reverted Changes:
I4f64a8b61:Use system/audio to/from string converters in Type...
Iddaa92bf2:Move enums shared with HAL to audio-hal-enums.h
Ie5896775b:audio: Align lists of enum values between framewor...

Bug: 171262726
Change-Id: I35c1acf6ed07b533292d1264b6237766458fd711
2020-10-20 01:29:53 +00:00
Mikhail Naganov
8d8dfcd8ed 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.

Added 'AUDIO_SOURCE_HOTWORD'.

Bug: 122858783
Bug: 142480271
Test: audio smoke tests
Change-Id: Ie5896775b6bc7dfd3ab158c4a7b497dbda827e9d
2020-10-16 23:01:13 +00:00
TreeHugger Robot
6a73ac5b4a Merge changes from topic "nullzero-hal-v7"
* changes:
  audio: Implement VTS tests for V7.0
  audio: Add example HAL implementation
  audio: Reformat README as Markdown
  audio: HAL V7 tweaks
2020-09-29 21:02:17 +00:00
Mikhail Naganov
648ec5b750 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
2020-09-28 18:55:50 +00:00
jiabin
c3b3f81272 Make getPresentationPosition mandatory.
GetPresentationPosition is marked as optional method at audio HAL v4.0.
This method return a recent count of number of audio frames presented to
an external observer. Making it mandatory can help improve the timestamp
reporting.

Test: make
Bug: 158609200
Change-Id: Ic164c10e4c406e7382cdc676f13c64de49e48734
2020-09-11 23:14:42 +00:00
Mikhail Naganov
7dd87f42f1 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
2020-08-17 18:06:46 +00:00
Mikhail Naganov
159260c586 Audio: Copy HAL V6 into V7
This is an automated copy performed using copyHAL.sh script.

Bug: 142480271
Test: m
Change-Id: Ifd91cc0bb59608cd92d1d8e4e76c3abea0a8da5e
2020-08-14 18:13:31 +00:00