Make audio HAL consistent.

Bug: 124459302
Test: hidl-gen -Lcheck ...
Change-Id: I319fb00ef3a2da3944094228d4801bd9f88c16bb
Merged-In: Ie125d9bb014ee747ce56a59feaca577ab2d9e96c
This commit is contained in:
Steven Moreland 2019-02-20 13:06:01 -08:00
parent 0446c2ec68
commit 63bf69427b
8 changed files with 84 additions and 25 deletions

View file

@ -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",

View file

@ -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.

View file

@ -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);
};

View file

@ -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,
};

View file

@ -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",

View file

@ -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

View file

@ -15,6 +15,7 @@ hidl_interface {
interfaces: [
"android.hardware.audio.common@5.0",
"android.hidl.base@1.0",
"android.hidl.safe_union@1.0",
],
types: [
"AacObjectType",

View file

@ -409,6 +409,34 @@ e78cf871f9fd1c072874e481e06e18e2681763cf2aa38c1fd777d53bab4eb69b android.hardwar
# HALs released in Android Q
438dc52ab820befb7a11e953e82110f0d8c91cdf96ef62be921efc64f5a3d580 android.hardware.atrace@1.0::IAtraceDevice
20b9f81bb0b1f812f150ec94d42648b01087f2344ea91df0416bce0fb6cdfbd4 android.hardware.atrace@1.0::types
dfdb4d04b65dc363e5621c85bfdf3023c277b75c31d821d8e71b3f44f198e214 android.hardware.audio@5.0::IDevice
0a911297821854985cfcdb17b63d7948af0f0f51ce8c68cc86367c185bbc772e android.hardware.audio@5.0::IDevicesFactory
ce2e8c6c8559fd42bd69e0dee27b4d9c93cd9b2eff487b4e6b6395b6a1a993d6 android.hardware.audio@5.0::IPrimaryDevice
4a4e5e5d9357004a1256bde8d36010ee00c51cea811a1c1e0dd969a9fc0bf862 android.hardware.audio@5.0::IStream
e05e48c583de14c1e5a6fa9d48ea50244e3e0924b76b342374e7471dc8007ba9 android.hardware.audio@5.0::IStreamIn
9471b12b1c255bb530695720bc4174bd74987b75b1f820854af8944bc8c215c9 android.hardware.audio@5.0::IStreamOut
1b0500367ed2b32a841667ac3200edf3d3a164e8004aca445ff1b085ac831e93 android.hardware.audio@5.0::IStreamOutCallback
83e365479cc77d8717c155e1787ee668cd2ae4c557b467cf75b8e7cd53697ad8 android.hardware.audio@5.0::types
edda213e520f387a3e367834b0772978b308a0f59b54479990aa9411aee9bcc4 android.hardware.audio.common@5.0::types
f269297866765b95ddd1825676cc8a772f0c7c9863286df596fc302781a42ff5 android.hardware.audio.effect@5.0::IAcousticEchoCancelerEffect
fa187b602d8939644ef708ed7627f2e3deac97899a4bda1de07f2ff126abe243 android.hardware.audio.effect@5.0::IAutomaticGainControlEffect
e1bf864ccb8458c0da1dcc74a2e748b1dca8ac360df590591cf82d98292d7981 android.hardware.audio.effect@5.0::IBassBoostEffect
d3867dcf1f46f1962d258c56151b5afb2ef26e9835fef73f01115492d58da5b7 android.hardware.audio.effect@5.0::IDownmixEffect
445a65ea2edd1ccba8a8d8e1c88d24c6ea67e57d355fa446ab390e20f0db14aa android.hardware.audio.effect@5.0::IEffect
0ac2e951f359e87644dcf642f488194f6b02563f89cfe8dd668ab7c422be89b1 android.hardware.audio.effect@5.0::IEffectBufferProviderCallback
9019e7ac057b8105a9b9ac8974b13e1ded46d1006e5a544aec510dfaf92755c6 android.hardware.audio.effect@5.0::IEffectsFactory
c8e5a7e450a5b201c286814d484d04c7b9c6cab71b4982b34b84177e818909db android.hardware.audio.effect@5.0::IEnvironmentalReverbEffect
cf356f430a1bb42fd91af65f105e07fa84a5927dc45c36d8ffce5b6c132c1f3c android.hardware.audio.effect@5.0::IEqualizerEffect
8c31b0cad211968dc6008dcb2b116bf5f12079c8dce920e79242e7839104138e android.hardware.audio.effect@5.0::ILoudnessEnhancerEffect
6f0f86b549e30382619877784857c40d4c64978c1e9eef3c034bdd367aac7468 android.hardware.audio.effect@5.0::INoiseSuppressionEffect
ca15a738dedc2f4981925f7d7ff29c22bc3f8a848403dcf0c592c167de09d9af android.hardware.audio.effect@5.0::IPresetReverbEffect
443659bb9e27221e5da0d16c7a0ecb2dc3a9a03acc8a0b2196b47c50735e2d2e android.hardware.audio.effect@5.0::IVirtualizerEffect
78fed26a781cdca1b3bcb37520bff705d7764ee81db9cfd37014953c7ad2596e android.hardware.audio.effect@5.0::IVisualizerEffect
6385b6accab8a544e2ee54ba7bf5aa55dff6153bcedd80fdaae16fe9e0be7050 android.hardware.audio.effect@5.0::types
ecedc58dbcdb13503c19c0ab160ac1dd0530bb1471164149282dd1463c684185 android.hardware.bluetooth.audio@2.0::IBluetoothAudioPort
fb9c40e4deab40be5476477078fe3d8a4a4495fd9deef4321878d169d675c633 android.hardware.bluetooth.audio@2.0::IBluetoothAudioProvider
f7431f3e3e4e3387fc6f27a6cf423eddcd824a395dc4349d302c995ab44a9895 android.hardware.bluetooth.audio@2.0::IBluetoothAudioProvidersFactory
447a5c9bb0f1a5ed3f1dfe5216afe4be2f4362111d95479670eec4cae4d7d5f7 android.hardware.bluetooth.audio@2.0::types
44480c912e4ab90b9ed17e56569cd5ca98413a8a2372efb028f4181204b6b73e android.hardware.fastboot@1.0::IFastboot
7b2989744e3c555292d4b5b829acd09a7b40f96ead62ce54174cd959503b64bb android.hardware.fastboot@1.0::types
c3f831a66d5815baf74f5b82fe79cf099542ddae4dfab3f388e1d41828e794fc android.hardware.health.storage@1.0::IGarbageCollectCallback