service/inc/public/agm/agm_api.h
Structures
agm_key_value
A single entry of a Key Vector.
Members
uint32_t
key
uint32_t
value
prop_data
Members
uint32_t
uint32_t
uint32_t
agm_cshm_info
Members
uint32_t
memID of the memory allocated
agm_cshm_type
type of the memory allocated
int64_t
fd of the memory allocated
uint32_t
agm_msg_config
Members
uint32_t
memID of the memory allocated
uint32_t
offset of memory allocated
uint32_t
Size of the chunk of memory.
uint32_t
module ID to which msg is sent
uint32_t
Flags to provide additional information, if it is a release memory or not.
agm_extern_alloc_buff_info
Members
int
unique handle identifying extern mem allocation
uint32_t
size of external allocation
uint32_t
offset of buffer within extern allocation
agm_buff
Members
uint64_t
timestamp in micro-secs
uint32_t
bitmasked flags for e.g.
uint32_t
size of buffer in bytes
uint8_t *
data buffer
uint32_t
size of metadata blob
uint8_t *
Blob for metadata.
struct agm_extern_alloc_buff_info
holds info for extern buff
agm_session_aac_dec
AAC decoder parameters.
Members
uint16_t
AAC format flag.
uint16_t
AAC obj type.
uint16_t
AAC obj type.
uint16_t
PCE bits size.
uint32_t
Sample rate.
agm_session_aac_enc_cfg
AAC encoder parameters.
Members
uint16_t
AAC encoder mode.
uint16_t
AAC format flag.
agm_session_aac_enc
Members
uint32_t
uint32_t
struct agm_session_aac_enc_cfg
agm_session_flac_dec
FLAC decoder parameters.
Members
uint16_t
Number of channels.
uint16_t
Sample size.
uint16_t
Minimum block size.
uint16_t
Maximum block size.
uint32_t
Sample rate.
uint32_t
Minimum frame size.
uint32_t
Maximum frame size.
agm_session_alac_dec
ALAC decoder parameters.
Members
uint32_t
Frame length.
uint8_t
Version.
uint8_t
bit depth
uint8_t
tuning parameters
uint8_t
tuning parameters
uint8_t
tuning parameters
uint8_t
Number of channels.
uint16_t
Max run.
uint32_t
Max Frame bytes.
uint32_t
avg bit rate
uint32_t
sample rate
uint32_t
Channel layout tag.
agm_session_ape_dec
APE decoder parameters.
Members
uint16_t
Version.
uint16_t
Compression Level.
uint32_t
Format flags.
uint32_t
Blocks per frame.
uint32_t
Final frame blocks.
uint32_t
Total frames.
uint16_t
Bit width.
uint16_t
Number of channels.
uint32_t
Sample rate.
uint32_t
Seek table present.
agm_session_wma_dec
WMA decoder parameters.
Members
uint16_t
Format Tag.
uint16_t
Number of channels.
uint32_t
Sample rate.
uint32_t
Avg bytes per sec.
uint16_t
Block align.
uint16_t
Bits per sample.
uint32_t
Channel mask.
uint16_t
Encoder options.
uint16_t
reserved
agm_session_wmapro_dec
WMA Pro decoder parameters.
Members
uint16_t
Format Tag.
uint16_t
Number of channels.
uint32_t
Sample rate.
uint32_t
Avg bytes per sec.
uint16_t
Block align.
uint16_t
Bits per sample.
uint32_t
Channel mask.
uint16_t
Encoder options.
uint16_t
Adv encoder options.
uint32_t
Adv encoder options2.
agm_session_opus_dec
OPUS decoder parameters.
Members
uint16_t
uint16_t
uint8_t
uint8_t
uint16_t
uint32_t
uint16_t
uint8_t
uint8_t
uint8_t
uint8_t
uint8_t
agm_session_codec
Session encoder/decoder parameters.
Members
struct agm_session_aac_dec
AAC decoder config.
struct agm_session_aac_enc
AAC encoder config.
struct agm_session_flac_dec
Flac decoder config.
struct agm_session_alac_dec
Alac decoder config.
struct agm_session_ape_dec
APE decoder config.
struct agm_session_wma_dec
WMA decoder config.
struct agm_session_wmapro_dec
WMAPro decoder config.
struct agm_session_opus_dec
OPUS decoder config.
agm_buf_info
Shared memory buffer info 211.
Members
int32_t
int32_t
int32_t
int32_t
agm_media_config
Media Config.
Members
uint32_t
sample rate
uint32_t
number of channels
enum agm_media_format
format
uint32_t
data format
agm_group_media_config
Members
struct agm_media_config
uint32_t
slot_mask for TDM
aif_info
AIF Info.
Members
char
AIF name
enum direction
direction
agm_session_config
Session Config.
Members
enum direction
TX or RX.
enum agm_session_mode
indicates mode of agm sesison, non-tunnel, or hostless
uint32_t
start_threshold: number of buffers * buffer size
uint32_t
stop_th6reshold: number of buffers * buffer size
union agm_session_codec
codec configuration
enum agm_data_mode
compress format ID
uint32_t
pass session specific flags e.g enable inband SRCM event
agm_buffer_config
Buffer Config.
Members
uint32_t
number of buffers
size_t
size of each buffer
size_t
max metadata size a client attaches to a buffer
agm_module_id_iid_map
Maps the modules instance id to module id for a single module.
Members
uint32_t
module id
uint32_t
globally unique module instance id
agm_tag_info
Structure which holds tag and corresponding modules tagged with tag id.
Members
uint32_t
tag id
uint32_t
number of modules matching the tag_id
struct agm_module_id_iid_map
agm_module_id_iid_map list
agm_tag_module_info_list
Structure which holds tag info of a given graph.
Members
uint32_t
number of tags
uint8_t
variable payload of type struct agm_tag_module_info
agm_tag_config
Structure which holds tag config for setparams.
Members
uint32_t
tag id
uint32_t
num of tag key values
struct agm_key_value
tag key vector
agm_cal_config
Members
uint32_t
num of tag key values
struct agm_key_value
tag key vector
agm_acdb_param
Members
bool
uint32_t
uint32_t
number of ckv or tkv
uint32_t
kv size + payload size
uint8_t
kv + payload
agm_acdb_tunnel_param
Members
bool
uint32_t
uint32_t
number of gkv
uint32_t
number of ckv or tkv
uint32_t
gkv size + t/ckv size + payload size
uint8_t
gkv + t/ckv + payload
agm_event_read_write_done_payload
Members
uint32_t
tag that was used to read/write this buffer
uint32_t
data buffer status as defined in ar_osal_error.h
uint32_t
meta-data status as defined in ar_osal_error.h
struct agm_buff
buffer that was passed to agm_read/agm_write
agm_event_reg_cfg
Event registration structure.
Members
uint32_t
Valid instance ID of module.
uint32_t
Valid event ID of the module.
uint32_t
Size of the event config data based upon the module_instance_id/event_id combination.
uint8_t
1 - to register the event 0 - to de-register the event
uint8_t
module specifc event registration payload
agm_event_cb_params
data that will be passed to client in the event callback
Members
uint32_t
identifies the module which generated event
uint32_t
size of payload below
uint32_t
payload associated with the event if any
uint8_t
agm_dump_info
Data passed by the client when requesting dump.
Members
int32_t
identifies the signal received by client
uint32_t
identifies client uid
uint32_t
Functions
agm_init
Initialize agm.
agm_deinit
De-Initialize agm.
agm_aif_set_media_config
Set media configuration for an audio interface.
uint32_t
- Valid audio interface id
struct agm_media_config *
- valid media configuration for the audio interafce.
agm_aif_set_metadata
Set metadata for an audio interface.
uint32_t
- Valid audio interface id
uint32_t
- size of metadata in bytes
uint8_t *
- valid metadata for the audio interface.
agm_session_set_metadata
Set metadata for the session.
uint32_t
- Valid audio session id
uint32_t
- size of metadata in bytes
uint8_t *
- valid metadata for the session.
agm_session_aif_set_metadata
Set metadata for the session, audio intf pair.
uint32_t
- Valid session id
uint32_t
- Valid audio interface id
uint32_t
- size of metadata in bytes
uint8_t *
- valid metadata for the session and audio_intf.
agm_session_aif_connect
Set metadata for the session, audio intf pair.
uint32_t
- Valid audio session id
uint32_t
- Valid audio interface id
bool
- Connect or Disconnect AIF to Session
agm_session_aif_get_tag_module_info
Set metadata for the session, audio intf pair.
uint32_t
- Valid audio session id
uint32_t
- Valid audio interface id
void *
- payload containing tag module info list in the graph. The memory for this pointer is allocated by client.
size_t *
size of the payload. if the value of size is zero, AGM will update required module info list of a given graph. if size equal or greater than the required size, AGM will copy the module info.
agm_aif_set_params
Set parameters for modules in audio interface.
uint32_t
- Valid audio interface id
void *
- payload
size_t
- payload size in bytes
agm_session_aif_set_params
Set parameters for modules in b/w stream and audio interface.
uint32_t
- Valid audio session id
uint32_t
- Valid audio interface id
void *
- payload
size_t
- payload size in bytes
agm_session_aif_set_cal
Set calibration for modules in b/w stream and audio interface.
uint32_t
- Valid audio session id
uint32_t
- Valid audio interface id
struct agm_cal_config *
- calibration key vector
agm_session_set_params
Set parameters for modules in stream.
uint32_t
- Valid audio session id
void *
- payload
size_t
- payload size in bytes
agm_session_get_params
Get parameters of the modules of a given session.
uint32_t
- Valid audio session id
void *
- payload
size_t
- payload size in bytes
agm_get_params_from_acdb_tunnel
Get parameters for modules at acdb without session.
void *
- payload with tag and calibration date
size_t *
- size of payload
agm_set_params_with_tag
Set parameters for modules in b/w stream and audio interface.
uint32_t
- Valid audio session id
uint32_t
- valid audio interface id
struct agm_tag_config *
- tag config structure with tag id and tag key vector
agm_set_params_with_tag_to_acdb
Set parameters for modules in b/w stream and audio interface.
uint32_t
- Valid audio session id
uint32_t
- valid audio interface id
void *
- payload with tag and calibration date
size_t
- size of payload
agm_set_params_to_acdb_tunnel
Set parameters for modules at acdb without session.
void *
- payload with tag and calibration date
size_t
- size of payload
agm_session_register_cb
Open the session with specified session id.
uint32_t
- Valid audio session id
agm_event_cb
- callback function to be invoked when an event occurs.
enum event_type
- event type that
void *
- client data.
agm_session_register_for_events
Register for events from Modules.
Not needed for data path events.
uint32_t
- Valid audio session id
- event specific configuration.
agm_session_open
Open the session with specified session id.
uint32_t
- Valid audio session id
enum agm_session_mode
- Mode in which this agm session is to be opened
uint64_t *
- updated with valid session handle if the operation is successful.
agm_session_set_config
Set Session config.
- Valid session handle obtained from agm_session_open
struct agm_session_config *
- valid stream configuration of the sessions
struct agm_media_config *
- valid media configuration of the session.
struct agm_buffer_config *
- buffer configuration for the session. Null if hostless
agm_session_close
Close the session.
- Valid session handle obtained from agm_session_open
agm_session_prepare
prepare the session.
- Valid session handle obtained from agm_session_open
agm_session_start
Start the session.
- Valid session handle obtained from agm_session_open
agm_session_stop
Stop the session.
session must be in started/paused state before stopping.
- Valid session handle obtained from agm_session_open
agm_session_pause
Pause the session.
session must be in started state before resuming.
- Valid session handle obtained from agm_session_open
agm_session_flush
flush the session.
session must be in pause state before flushing.
- Valid session handle obtained from agm_session_open
agm_sessionid_flush
flush the session.
session must be in pause state before flushing.
uint32_t
- Valid audio session id
agm_session_resume
Resume the session.
session must be in paused state before resuming.
- Valid session handle obtained from agm_session_open
agm_session_suspend
suspend the session.
session must be in started state before suspending.
- Valid session handle obtained from agm_session_open
agm_session_read
Read data buffers.from session.
uint64_t
session handle returned from agm_session_open
void *
buffer where data will be copied to
size_t *
number of bytes requested to fill into the buffer. AGM will update the count with actual number of bytes filled.
agm_session_write
Write data buffers.to session.
session handle returned from agm_session_open
void *
buffer where data will be copied from
size_t *
actual number of bytes in the buffer. AGM will update the count with number of bytes consumed/written.
agm_get_hw_processed_buff_cnt
Get count of Buffer processed by h/w.
session handle returned from agm_session_open
enum direction
indicates whether to return the write or read buffer count
agm_get_aif_info_list
Get list of AIF info objects.
struct aif_info *
list of aif_info objects
size_t *
number of aif info items in the list. if num_aif_info value is listed as zero, AGM will update num_aif_info with the number of aif info items in AGM. if num_aif_info is greater than zero, AGM will copy client specified num_aif_info of items into aif_list.
agm_session_set_loopback
Set loopback between capture and playback sessions.
uint32_t
: a non zero capture session id
uint32_t
playback session id.
bool
: flag to indicate to enable(true) or disable(false) loopback
agm_session_set_ec_ref
Set ec reference on capture session.
uint32_t
: a non zero capture session id
uint32_t
aif_id on RX path.
bool
: flag to indicate to enable(true) or disable(false) ec_ref
agm_session_eos
send eos of the session.
uint64_t
- Valid session handle obtained from agm_session_open
agm_get_session_time
get timestamp of the session.
uint64_t
- Valid session handle obtained from agm_session_open
uint64_t *
- updated with valid timestamp if the operation is successful.
agm_get_buffer_timestamp
get timestamp of last read buffer.
uint32_t
- Valid audio session id
uint64_t *
- updated with valid timestamp if the operation is successful.
agm_session_get_buf_info
Get shared memory buf_info of a given session.
uint32_t
- Valid audio session id
struct agm_buf_info *
- agm_buf_info structure with dma_buf_fd
struct agm_buf_info *
- flag to determine data buf/pos buf
agm_register_service_crash_callback
This api is a no-op if agm runs in clients context.
In scenarios where AGM runs in its own process context and clients talk to AGM over IPC, this api could be used by clients to register a callback with the agm client wrapper implentation, which is then responsible to trigger this callback when the agm service crashes. Once the callback is invoked clients then can decide on the approach they want to take with respect to clean up of the agm sesisons
- Callback passed by clients
uint64_t
- Cookie that client expect to be passed during the invocation of the callback.
agm_set_gapless_session_metadata
set gapless metadata of the session.
uint64_t
- Valid session handle obtained from agm_session_open
enum agm_gapless_silence_type
- Silence Type (Initial or Trailing)
uint32_t
- Initial/Trailing silence samples to be removed
agm_session_write_with_metadata
Write data buffers with metadata to session.
session handle returned from agm_session_open
struct agm_buff *
agm_buffer where data will be copied from
size: Actual number of bytes that were consumed by AGM
agm_session_read_with_metadata
Read data buffers with metadata to session.
session handle returned from agm_session_open
struct agm_buff *
agm_buffer where data will be copied to
uint32_t *
Actual number of bytes that were captured
agm_session_set_non_tunnel_mode_config
Helps set config for non tunnel mode (rx and tx path)
session handle returned from agm_session_open
struct agm_session_config *
- valid stream configuration of the sessions
struct agm_media_config *
- valid media configuration of the input data.
struct agm_buffer_config *
- buffer configuration for the input data path.
struct agm_media_config *
- valid media configuration of the output data.
struct agm_buffer_config *
- buffer configuration for the output data path.
agm_get_group_aif_info_list
Get list of group AIF objects.
struct aif_info *
list of group aif_info objects
size_t *
number of group aif items in the list. if num_groups value is listed as zero, AGM will update num_groups with the number of group aif items in AGM. if num_groups is greater than zero, AGM will copy client specified num_groups of items into aif_list.
agm_aif_group_set_media_config
Set media configuration for a group AIF.
uint32_t
- Valid group id
struct agm_group_media_config *
- valid media configuration for the audio interafce.
agm_session_write_datapath_params
Write buffers containing codec params to session on datapath.
uint32_t
- Valid audio session id
struct agm_buff *
agm_buffer where data will be copied from
agm_dump
Dump AGM information based on client.
struct agm_dump_info *
- dump information populated by the client to facilitate dump
agm_cshm_alloc
Allocate shared memory and map it with SPF.
uint32_t
- Size of memory to alloc in bytes.
info - Info regarding the allocated shared memory
agm_cshm_msg
Send a Global MSG to a module.
uint32_t
- Valid mem_id returned as part of agm_cshm_alloc.
uint32_t
- Offset from the beginning of allocted memory.
uint32_t
- Length of the memory for module to use.
uint32_t
- Module Instance ID of the module for which this MSG is intented.
uint32_t
- Flag conveying additional info regarding the MSG.
agm_cshm_dealloc
Unmap the shared memory with SPF and Deallocate it.
uint32_t
- Valid mem_id returned as part of agm_cshm_alloc.

