inc/PalApi.h
Functions
pal_get_version
Get PAL version in the form of Major and Minor number seperated by period.
pal_init
Initialize PAL.
Increases ref count.
pal_deinit
De-Initialize PAL.
Decreases the ref count.
pal_stream_open
Open the stream with specified configuration.
- an array of pal_devices. The size of the array is based on the no_of_devices specified by the client. If pal_media_config in pal_device is specified as NULL, PAL uses the default device configuration or appropriate configuration based on the usecases running. Clients can query the device configuration by using pal_get_device().
- an array of modifiers. Modifiers are used to add additional key-value pairs. e.g to identify the topology of usecase from default set.
- callback function associated with stream. Any event will notified through this callback function.
- client data associated with the stream. This cookie will be returned back in the callback function.
pal_stream_close
Close the stream.
pal_stream_start
Register for specific event on a given stream.
Events will be notified via the callback function registered in pal_stream_open cmd.
pal_stream_stop
Stop the stream.
Stream must be in started/paused state before stoping.
pal_stream_pause
Pause the stream.
Stream must be in started state before resuming.
pal_stream_resume
Resume the stream.
Stream must be in paused state before resuming.
pal_stream_flush
Flush accumlated data from the stream.
Stream must be in paused state before flushing.
pal_stream_drain
Drain audio data buffered by the driver/hardware has been played depending on the drain type specified.
If stream is opened with AUDIO_STREAM_FLAG_NON_BLOCKING and callback function is set in pal_open_stream(), drain complete notificaiton will be sent via the callback function otherwise will block until drain is completed.
Drain will return immediately on stop() and flush() call.
pal_stream_suspend
Suspend graph and stop processing data from the stream.
Stream must be in started state before suspending.
pal_stream_get_buffer_size
Get audio buffer size based on the direction of the stream.
buffer and out_buffer - filled if stream was opened with PAL_AUDIO_OUTPUT|PAL_AUDIO_INPUT direction.
- 0 on success, error code otherwise.
pal_stream_set_buffer_size
Set audio buffer size based on the direction of the stream.
This overwrites the default buffer size configured for certain stream types.
- input buffers configuratoin when stream is opened with PAL_AUDIO_INPUT or PAL_AUDIO_INPUT_OUTPUT direction.
- output buffers configuratoin when stream is opened with PAL_AUDIO_OUTPUT or PAL_AUDIO_INPUT_OUTPUT direction.
- 0 on success, error code otherwise.
pal_stream_read
Read audio buffer captured from in the audio stream.
an error code. Capture timestamps will be populated if session was opened with timetamp flag.
- number of bytes read or error code on failure
pal_stream_write
Write audio buffer of a stream for rendering.If at least one frame was written successfully prior to the error, PAL will return number of bytes returned.
Timestamp is honored if the stream was opened with timestamp flag otherwise it is ignored.
If the stream was opened with non-blocking mode, the write() will operate in non-blocking mode. PAL will write only the number of bytes that currently fit in the driver/hardware buffer. If the callback function is set during pal_stream_open, the callback function will be called when more space is available in the driver/hardware buffer.
pal_stream_get_device
get current device on stream.
pal_stream_set_device
set new device on stream.
This api will disable the existing device and set the new device. If the new device is a combo device and includes previously set device, it will retain the old device to avoid setting the same device again unless device configuration chagnes.
- an array of pal_device. The size of the array is based on the no_of_devices specified by the client.
pal_stream_get_param
Get audio parameters specific to a stream.
pal_stream_set_param
Set audio parameters specific to a stream.
pal_stream_get_volume
Get audio volume specific to a stream.
pal_stream_set_volume
Set audio volume specific to a stream.
pal_stream_get_mute
Get current audio audio mute state to a stream.
pal_stream_set_mute
Set mute specific to a stream.
pal_get_mic_mute
Get microphone mute state.
pal_set_mic_mute
Set global mic mute state.
pal_get_timestamp
Get time stamp.
pal_add_remove_effect
Add remove effects for Voip TX path.
pal_set_param
Set pal parameters.
pal_get_param
Get pal parameters.
pal_stream_create_mmap_buffer
Set audio volume specific to a stream.
pal_stream_get_mmap_position
Set audio volume specific to a stream.
pal_register_global_callback
Register global callback to pal.
This can be used to inform client about any information needed even before stream is created.
pal_cshm_alloc
Request for shared memory allocation.
pal_cshm_dealloc
Request for deallocate the shared memory allocated via pal_cshm_alloc.
pal_stream_set_custom_param
Stream set parameters for generic/custom param.
pal_stream_get_custom_param
Stream set parameters for generic/custom param.
payload_size - as input max size of the allocated/memory passed by the client. If it is not enough to copy the get_param payload - a error is returned with the size set to the expected size of the memory to be passed. If the memory is more/enough - api will return actual size copied for the response as a ouput.
pal_set_custom_param
Stream get parameters for generic/custom param.
pal_register_for_events
registers a callback function to get notification for audio events.
pal_get_custom_param
Get pal parameters for generic/custom param.
payload_size - as input max size of the allocated/memory passed by the client. If it is not enough to copy the get_param payload - a error is returned with the size set to the expected size of the memory to be passed. If the memory is more/enough - api will return actual size copied for the response as a ouput.

