Audio V4: More fixes of the audio 2.0 API

Remove unnecessary Result typedef.
Make bufferSizeFrames and burstSizeFrames unsigned
as they should not be negative.
Remove legacy AudioInterleave.
Remove implicit callflow annotation.
Make EffectConfigParameters a bitfield.

Bug: 38184704
Test: hardware/interfaces/update-makefiles.py
Change-Id: I33e6f7869d20ca0cad4123f32347754e5a514caa
Signed-off-by: Kevin Rocard <krocard@google.com>
This commit is contained in:
Kevin Rocard
2018-01-31 18:26:45 -08:00
parent 520e53d346
commit eacb99697f
10 changed files with 10 additions and 57 deletions

View File

@@ -21,8 +21,6 @@ import IStreamIn;
import IStreamOut;
interface IDevice {
typedef android.hardware.audio@4.0::Result Result;
/**
* Returns whether the audio hardware interface has been initialized.
*

View File

@@ -20,8 +20,6 @@ import android.hardware.audio.common@4.0;
import IDevice;
interface IDevicesFactory {
typedef android.hardware.audio@4.0::Result Result;
/** Allows a HAL implementation to be split in multiple independent
* devices (called module in the pre-treble API).
* Note that this division is arbitrary and implementation are free

View File

@@ -20,8 +20,6 @@ import android.hardware.audio.common@4.0;
import IDevice;
interface IPrimaryDevice extends IDevice {
typedef android.hardware.audio@4.0::Result Result;
/**
* Sets the audio volume of a voice call.
*

View File

@@ -20,8 +20,6 @@ import android.hardware.audio.common@4.0;
import android.hardware.audio.effect@4.0::IEffect;
interface IStream {
typedef android.hardware.audio@4.0::Result Result;
/**
* Return the frame size (number of bytes per sample).
*

View File

@@ -20,8 +20,6 @@ import android.hardware.audio.common@4.0;
import IStream;
interface IStreamIn extends IStream {
typedef android.hardware.audio@4.0::Result Result;
/**
* Returns the source descriptor of the input stream. Calling this method is
* equivalent to getting AUDIO_PARAMETER_STREAM_INPUT_SOURCE on the legacy

View File

@@ -21,8 +21,6 @@ import IStream;
import IStreamOutCallback;
interface IStreamOut extends IStream {
typedef android.hardware.audio@4.0::Result Result;
/**
* Return the audio hardware driver estimated latency in milliseconds.
*

View File

@@ -93,9 +93,9 @@ struct MmapBufferInfo {
/** Mmap memory buffer */
memory sharedMemory;
/** Total buffer size in frames */
int32_t bufferSizeFrames;
uint32_t bufferSizeFrames;
/** Transfer size granularity in frames */
int32_t burstSizeFrames;
uint32_t burstSizeFrames;
/** Attributes describing the buffer. */
bitfield<MmapBufferFlag> flags;
};

View File

@@ -470,23 +470,6 @@ enum AudioChannelMask : uint32_t {
INDEX_MASK_8 = INDEX_HDR | ((1 << 8) - 1)
};
/**
* Expresses the convention when stereo audio samples are stored interleaved
* in an array. This should improve readability by allowing code to use
* symbolic indices instead of hard-coded [0] and [1].
*
* For multi-channel beyond stereo, the platform convention is that channels
* are interleaved in order from least significant channel mask bit to most
* significant channel mask bit, with unused bits skipped. Any exceptions
* to this convention will be noted at the appropriate API.
*/
@export(name="", value_prefix="AUDIO_INTERLEAVE_")
enum AudioInterleave : int32_t {
LEFT = 0,
RIGHT = 1,
};
/**
* Major modes for a mobile device. The current mode setting affects audio
* routing.
@@ -495,7 +478,9 @@ enum AudioInterleave : int32_t {
enum AudioMode : int32_t {
NORMAL = 0,
RINGTONE = 1,
/** Calls handled by the telephony stack (Eg: PSTN). */
IN_CALL = 2,
/** Calls handled by apps (Eg: Hangout). */
IN_COMMUNICATION = 3,
};
@@ -854,6 +839,7 @@ struct AudioPortConfig {
struct AudioPortDeviceExt {
AudioModuleHandle hwModule; // module the device is attached to
AudioDevice type;
/** 32 byte string identifying the port. */
uint8_t[32] address;
};
@@ -864,7 +850,7 @@ struct AudioPortDeviceExt {
enum AudioMixLatencyClass : int32_t {
LOW,
NORMAL
} ;
};
struct AudioPortMixExt {
AudioModuleHandle hwModule; // module the stream is attached to

View File

@@ -26,7 +26,6 @@ interface IEffect {
* @return retval operation completion status.
*/
@entry
@callflow(next={"*"})
init() generates (Result retval);
/**
@@ -39,7 +38,6 @@ interface IEffect {
* @param outputBufferProvider optional buffer provider reference.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setConfig(EffectConfig config,
IEffectBufferProviderCallback inputBufferProvider,
IEffectBufferProviderCallback outputBufferProvider)
@@ -51,7 +49,6 @@ interface IEffect {
*
* @return retval operation completion status.
*/
@callflow(next={"*"})
reset() generates (Result retval);
/**
@@ -81,7 +78,6 @@ interface IEffect {
* @param device output device specification.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setDevice(bitfield<AudioDevice> device) generates (Result retval);
/**
@@ -99,7 +95,6 @@ interface IEffect {
* @return result updated volume values.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setAndGetVolume(vec<uint32_t> volumes)
generates (Result retval, vec<uint32_t> result);
@@ -124,7 +119,6 @@ interface IEffect {
* @param mode desired audio mode.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setAudioMode(AudioMode mode) generates (Result retval);
/**
@@ -137,7 +131,6 @@ interface IEffect {
* @param outputBufferProvider optional buffer provider reference.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setConfigReverse(EffectConfig config,
IEffectBufferProviderCallback inputBufferProvider,
IEffectBufferProviderCallback outputBufferProvider)
@@ -154,7 +147,6 @@ interface IEffect {
* @param device input device specification.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setInputDevice(bitfield<AudioDevice> device) generates (Result retval);
/**
@@ -163,7 +155,6 @@ interface IEffect {
* @return retval operation completion status.
* @return config configuration descriptor.
*/
@callflow(next={"*"})
getConfig() generates (Result retval, EffectConfig config);
/**
@@ -173,7 +164,6 @@ interface IEffect {
* @return retval operation completion status.
* @return config configuration descriptor.
*/
@callflow(next={"*"})
getConfigReverse() generates (Result retval, EffectConfig config);
/**
@@ -186,7 +176,6 @@ interface IEffect {
* the number of supported combinations exceeds 'maxConfigs'.
* @return result list of configuration descriptors.
*/
@callflow(next={"*"})
getSupportedAuxChannelsConfigs(uint32_t maxConfigs)
generates (Result retval, vec<EffectAuxChannelsConfig> result);
@@ -197,7 +186,6 @@ interface IEffect {
* NOT_SUPPORTED code.
* @return result configuration descriptor.
*/
@callflow(next={"*"})
getAuxChannelsConfig()
generates (Result retval, EffectAuxChannelsConfig result);
@@ -207,7 +195,6 @@ interface IEffect {
* @return retval operation completion status; absence of the feature
* support is indicated using NOT_SUPPORTED code.
*/
@callflow(next={"*"})
setAuxChannelsConfig(EffectAuxChannelsConfig config)
generates (Result retval);
@@ -221,7 +208,6 @@ interface IEffect {
* @param source source descriptor.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setAudioSource(AudioSource source) generates (Result retval);
/**
@@ -232,7 +218,6 @@ interface IEffect {
* @param param effect offload descriptor.
* @return retval operation completion status.
*/
@callflow(next={"*"})
offload(EffectOffloadParameter param) generates (Result retval);
/**
@@ -241,7 +226,6 @@ interface IEffect {
* @return retval operation completion status.
* @return descriptor effect descriptor.
*/
@callflow(next={"*"})
getDescriptor() generates (Result retval, EffectDescriptor descriptor);
/**
@@ -285,9 +269,8 @@ interface IEffect {
* INVALID_ARGUMENTS if there was a problem with mapping
* any of the buffers.
*/
@callflow(next={"*"})
setProcessBuffers(AudioBuffer inBuffer, AudioBuffer outBuffer) generates (
Result retval);
setProcessBuffers(AudioBuffer inBuffer, AudioBuffer outBuffer)
generates (Result retval);
/**
* Execute a vendor specific command on the effect. The command code
@@ -327,7 +310,6 @@ interface IEffect {
* @param value the value of the parameter.
* @return retval operation completion status.
*/
@callflow(next={"*"})
setParameter(vec<uint8_t> parameter, vec<uint8_t> value)
generates (Result retval);
@@ -349,7 +331,6 @@ interface IEffect {
* @return retval operation completion status.
* @return result the value of the parameter.
*/
@callflow(next={"*"})
getParameter(vec<uint8_t> parameter, uint32_t valueMaxSize)
generates (Result retval, vec<uint8_t> value);
@@ -375,7 +356,6 @@ interface IEffect {
* @return configsCount number of configs returned.
* @return configsData data for all the configs returned.
*/
@callflow(next={"*"})
getSupportedConfigsForFeature(
uint32_t featureId,
uint32_t maxConfigs,
@@ -402,7 +382,6 @@ interface IEffect {
* @return retval operation completion status.
* @return configData config data.
*/
@callflow(next={"*"})
getCurrentConfigForFeature(uint32_t featureId, uint32_t configSize)
generates (Result retval, vec<uint8_t> configData);

View File

@@ -245,7 +245,7 @@ enum EffectConfigParameters : int32_t {
CHANNELS = 0x0004, // channels
FORMAT = 0x0008, // format
ACC_MODE = 0x0010, // accessMode
ALL = BUFFER | SMP_RATE | CHANNELS | FORMAT | ACC_MODE
// Note that the 2.0 ALL have been moved to an helper function
};
/**
@@ -258,7 +258,7 @@ struct EffectBufferConfig {
bitfield<AudioChannelMask> channels;
AudioFormat format;
EffectBufferAccess accessMode;
EffectConfigParameters mask;
bitfield<EffectConfigParameters> mask;
};
struct EffectConfig {