diff options
author | Steven Moreland <smoreland@google.com> | 2019-02-20 13:06:01 -0800 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2019-02-26 09:00:14 -0800 |
commit | 63bf69427b3080f7ecbae3e34d1253412e17028e (patch) | |
tree | 993040492d240bc7eefcb61bb0784798745c9c7a /audio | |
parent | 0446c2ec681bd3c4f05561893dd3395cac0aad8d (diff) | |
download | android_hardware_interfaces-63bf69427b3080f7ecbae3e34d1253412e17028e.tar.gz android_hardware_interfaces-63bf69427b3080f7ecbae3e34d1253412e17028e.tar.bz2 android_hardware_interfaces-63bf69427b3080f7ecbae3e34d1253412e17028e.zip |
Make audio HAL consistent.
Bug: 124459302
Test: hidl-gen -Lcheck ...
Change-Id: I319fb00ef3a2da3944094228d4801bd9f88c16bb
Merged-In: Ie125d9bb014ee747ce56a59feaca577ab2d9e96c
Diffstat (limited to 'audio')
-rw-r--r-- | audio/5.0/Android.bp | 3 | ||||
-rw-r--r-- | audio/5.0/IDevice.hal | 2 | ||||
-rw-r--r-- | audio/5.0/IStreamIn.hal | 23 | ||||
-rw-r--r-- | audio/5.0/types.hal | 49 | ||||
-rw-r--r-- | audio/effect/5.0/Android.bp | 1 | ||||
-rw-r--r-- | audio/effect/5.0/types.hal | 2 |
6 files changed, 55 insertions, 25 deletions
diff --git a/audio/5.0/Android.bp b/audio/5.0/Android.bp index ee023e382..7c2db1d8a 100644 --- a/audio/5.0/Android.bp +++ b/audio/5.0/Android.bp @@ -20,6 +20,7 @@ hidl_interface { "android.hardware.audio.common@5.0", "android.hardware.audio.effect@5.0", "android.hidl.base@1.0", + "android.hidl.safe_union@1.0", ], types: [ "AudioDrain", @@ -28,8 +29,8 @@ hidl_interface { "AudioMicrophoneCoordinate", "AudioMicrophoneDirectionality", "AudioMicrophoneLocation", - "DeviceAddress", "MessageQueueFlagBits", + "MicrophoneDirection", "MicrophoneInfo", "MmapBufferFlag", "MmapBufferInfo", diff --git a/audio/5.0/IDevice.hal b/audio/5.0/IDevice.hal index afb4fad21..9e45ba5f5 100644 --- a/audio/5.0/IDevice.hal +++ b/audio/5.0/IDevice.hal @@ -133,7 +133,7 @@ interface IDevice { * @param config stream configuration. * @param flags additional flags. * @param sinkMetadata Description of the audio that is suggested by the client. - * May be used by implementations to configure hardware effects. + * May be used by implementations to configure processing effects. * @return retval operation completion status. * @return inStream in case of success, created input stream. * @return suggestedConfig in case of invalid parameters, suggested config. diff --git a/audio/5.0/IStreamIn.hal b/audio/5.0/IStreamIn.hal index d33cfdc77..b042960b1 100644 --- a/audio/5.0/IStreamIn.hal +++ b/audio/5.0/IStreamIn.hal @@ -165,4 +165,27 @@ interface IStreamIn extends IStream { */ getActiveMicrophones() generates(Result retval, vec<MicrophoneInfo> microphones); + + /** + * Specifies the logical microphone (for processing). + * + * Optional method + * + * @param Direction constant + * @return retval OK if the call is successful, an error code otherwise. + */ + setMicrophoneDirection(MicrophoneDirection direction) + generates(Result retval); + + /** + * Specifies the zoom factor for the selected microphone (for processing). + * + * Optional method + * + * @param the desired field dimension of microphone capture. Range is from -1 (wide angle), + * though 0 (no zoom) to 1 (maximum zoom). + * + * @return retval OK if the call is not successful, an error code otherwise. + */ + setMicrophoneFieldDimension(float zoom) generates(Result retval); }; diff --git a/audio/5.0/types.hal b/audio/5.0/types.hal index 988f584b6..2c153c6ea 100644 --- a/audio/5.0/types.hal +++ b/audio/5.0/types.hal @@ -49,34 +49,11 @@ struct TimeSpec { uint64_t tvNSec; // nanoseconds }; -/** - * IEEE 802 MAC address. - */ -typedef uint8_t[6] MacAddress; - struct ParameterValue { string key; string value; }; -/** - * Specifies a device in case when several devices of the same type - * can be connected (e.g. BT A2DP, USB). - */ -struct DeviceAddress { - AudioDevice device; // discriminator - union Address { - MacAddress mac; // used for BLUETOOTH_A2DP_* - uint8_t[4] ipv4; // used for IP - struct Alsa { - int32_t card; - int32_t device; - } alsa; // used for USB_* - } address; - string busAddress; // used for BUS - string rSubmixAddress; // used for REMOTE_SUBMIX -}; - enum MmapBufferFlag : uint32_t { NONE = 0x0, /** @@ -244,3 +221,29 @@ struct MicrophoneInfo { */ AudioMicrophoneCoordinate orientation; }; + +/** + * Constants used by the HAL to determine how to select microphones and process those inputs in + * order to optimize for capture in the specified direction. + * + * MicrophoneDirection Constants are defined in MicrophoneDirection.java. + */ +@export(name="audio_microphone_direction_t", value_prefix="MIC_DIRECTION_") +enum MicrophoneDirection : int32_t { + /** + * Don't do any directionality processing of the activated microphone(s). + */ + UNSPECIFIED = 0, + /** + * Optimize capture for audio coming from the screen-side of the device. + */ + FRONT = 1, + /** + * Optimize capture for audio coming from the side of the device opposite the screen. + */ + BACK = 2, + /** + * Optimize capture for audio coming from an off-device microphone. + */ + EXTERNAL = 3, +}; diff --git a/audio/effect/5.0/Android.bp b/audio/effect/5.0/Android.bp index d60d94aa9..78b950ea8 100644 --- a/audio/effect/5.0/Android.bp +++ b/audio/effect/5.0/Android.bp @@ -26,6 +26,7 @@ hidl_interface { interfaces: [ "android.hardware.audio.common@5.0", "android.hidl.base@1.0", + "android.hidl.safe_union@1.0", ], types: [ "AudioBuffer", diff --git a/audio/effect/5.0/types.hal b/audio/effect/5.0/types.hal index 84e11086b..4b6c196b8 100644 --- a/audio/effect/5.0/types.hal +++ b/audio/effect/5.0/types.hal @@ -53,6 +53,7 @@ enum Result : int32_t { * | Volume | 6..8 | 0 none * | management | | 1 implements volume control * | | | 2 requires volume indication + * | | | 3 monitors requested volume * | | | 4 reserved * +----------------+--------+-------------------------------------------------- * | Device | 9..11 | 0 none @@ -136,6 +137,7 @@ enum EffectFlags : int32_t { VOLUME_MASK = ((1 << VOLUME_SIZE) -1) << VOLUME_SHIFT, VOLUME_CTRL = 1 << VOLUME_SHIFT, VOLUME_IND = 2 << VOLUME_SHIFT, + VOLUME_MONITOR = 3 << VOLUME_SHIFT, VOLUME_NONE = 0 << VOLUME_SHIFT, // Device indication |