inc/remote.h
Structures
domain
Domain type for multi-domain RPC calls.
Members
int
Domain ID.
char
URI for remote_handle_open.
remote_buf
32-bit Remote buffer parameter for RPC calls
Members
void *
size_t
Address of a remote buffer.
remote_buf64
64-bit Remote buffer parameter for RPC calls
Members
uint64_t
int64_t
Address of a remote buffer.
remote_dma_handle
32-bit Remote DMA handle parameter for RPC calls
Members
int32_t
uint32_t
File descriptor of a remote buffer.
remote_dma_handle64
64-bit Remote DMA handle parameter for RPC calls
Members
int32_t
uint32_t
File descriptor of a remote buffer.
uint32_t
Offset of the file descriptor.
remote_arg
32-bit Remote Arg structure for RPC calls
Members
remote_buf
remote_handle
32-bit remote buffer
remote_handle64
non-domains remote handle
remote_dma_handle
multi-domains remote handle
remote_arg64
64-bit Remote Arg structure for RPC calls
Members
remote_buf64
remote_handle
64-bit remote buffer
remote_handle64
non-domains remote handle
remote_dma_handle64
multi-domains remote handle
fastrpc_async_callback
Async call back response type, input structure.
Members
void(*
Callback function for async notification.
void *
Current context to identify the callback.
fastrpc_async_descriptor
Async descriptor to submit async job.
Members
enum fastrpc_async_notify_type
fastrpc_async_jobid
Async response type.
fastrpc_async_callback_t
Job id of Async job queued to DSP.
remote_rpc_control_latency
Structure used for request ID DSPRPC_CONTROL_LATENCY in remote handle control interface.
Members
uint32_t
Enable latency optimization techniques to meet requested latency.
uint32_t
Latency in microseconds.
remote_dsp_capability
Members
uint32_t
uint32_t
uint32_t
remote_rpc_control_wakelock
Structure used for request ID DSPRPC_CONTROL_WAKELOCK in remote handle control interface.
Members
uint32_t
remote_rpc_get_domain
Structure used for request ID DSPRPC_GET_DOMAIN in remote handle control interface.
Members
int
remote_control_custom_path
Structure used for request IDs DSPRPC_SET_PATH and DSPRPC_GET_PATH in remote handle control interface.
Members
int32_t
const char *
value size including NULL char
char *
key used for storing the path
remote_rpc_thread_params
Structure used for request ID FASTRPC_THREAD_PARAMS in remote session control interface.
Members
int
int
Remote subsystem domain ID, pass -1 to set params for all domains.
int
User thread priority (1 to 255), pass -1 to use default.
remote_rpc_control_unsigned_module
Structure used for request ID DSPRPC_CONTROL_UNSIGNED_MODULE in remote session control interface.
Members
int
int
Remote subsystem domain ID, -1 to set params for all domains.
remote_rpc_relative_thread_priority
Structure used for request ID FASTRPC_RELATIVE_THREAD_PRIORITY in remote session control interface.
Members
int
int
Remote subsystem domain ID, pass -1 to update priority for all domains.
remote_rpc_process_clean_params
When a remote invocation does not return, then call “remote_session_control” with FASTRPC_REMOTE_PROCESS_KILL requestID and the appropriate remote domain ID.
Members
int
remote_rpc_session_close
Structure used for request ID FASTRPC_SESSION_CLOSE in remote session control interface.
Members
int
remote_rpc_control_pd_dump
Structure used for request ID FASTRPC_CONTROL_PD_DUMP in remote session control interface This is used to enable/disable PD dump for userPDs on the DSP.
Members
int
int
Remote subsystem domain ID, -1 to set params for all domains.
remote_process_type
Structure for remote_session_control, used with FASTRPC_REMOTE_PROCESS_TYPE request ID to query the type of PD running defined by enum fastrpc_process_type.
Members
int
int
remote_rpc_notif_register
Structure for remote_session_control, used with FASTRPC_REGISTER_STATUS_NOTIFICATIONS request ID to receive status notifications of the user PD on the DSP.
Members
void *
int
fastrpc_notif_fn_t
remote_rpc_pd_initmem_size
Structure used for request ID FASTRPC_PD_INITMEM_SIZE in remote session control interface.
Members
int
uint32_t
Remote subsystem domain ID, pass -1 to set params for all domains.
remote_rpc_reserve_new_session
Structure for remote_session_control, used with FASTRPC_RESERVE_SESSION request ID to reserve new fastrpc session of the user PD on the DSP.
Members
char *
uint32_t
char *
uint32_t
uint32_t
uint32_t
remote_rpc_effective_domain_id
Structure for remote_session_control, used with FASTRPC_GET_EFFECTIVE_DOMAIN_ID request ID to get effective domain id of fastrpc session on the user PD of the DSP.
Members
char *
uint32_t
uint32_t
uint32_t
remote_rpc_get_uri
Structure for remote_session_control, used with FASTRPC_GET_URI request ID to get the URI needed to load the module in the fastrpc user PD on the DSP.
Members
char *
uint32_t
uint32_t
char *
uint32_t
char *
uint32_t
fastrpc_context_create
Members
uint32_t *
uint32_t
uint64_t
uint64_t
fastrpc_context_destroy
Members
uint64_t
uint64_t
Functions
remote_handle_open
Opens a remote handle to a DSP module for FastRPC communication.
NOTE: This function should not be called directly from applications. It is automatically called by the stub functions generated by the QAIC compiler from IDL files. Applications should use the generated stub functions instead.
This function creates a handle to communicate with a module running on the DSP. The handle can be used to invoke remote functions defined in the module’s IDL interface.
Example URIs: “uri:libexample.so;_domain=adsp” “uri:libfoo.so;_domain=cdsp;_session=1;_trace=2”
__QAIC_IN_CHAR const char *
[in] URI of the module to open, found in the auto-generated header file. Format: “uri:module[;option1=value1][;option2=value2]…”
__QAIC_OUT remote_handle *
[out] Pointer to store the opened remote handle. This handle should be used in subsequent remote_handle_invoke() calls and must be closed using remote_handle_close() when no longer needed.
remote_handle64_open
remote_handle_invoke
Invokes a remote function on the DSP through a FastRPC handle.
NOTE: This function should not be called directly from applications. It is automatically called by the stub functions generated by the QAIC compiler from IDL files. Applications should use the generated stub functions instead.
This function invokes a remote function defined in the module’s IDL interface using the handle opened via remote_handle_open().
__QAIC_IN remote_handle
[in] Remote handle obtained from remote_handle_open()
__QAIC_IN uint32_t
[in] Scalar value encoding the number and types of arguments:
REMOTE_SCALARS_INBUFS(sc): Number of input buffers
REMOTE_SCALARS_OUTBUFS(sc): Number of output buffersREMOTE_SCALARS_INHANDLES(sc): Number of input handles
REMOTE_SCALARS_OUTHANDLES(sc): Number of output handles
__QAIC_IN remote_arg *
[in] Array of remote_arg structures containing the arguments in order:
Input buffers
Output buffers
Input handlesOutput handles Each remote_arg contains:buf.pv: Pointer to buffer data
buf.nLen: Length of buffer in bytes
remote_handle64_invoke
remote_handle_close
Closes a remote handle previously opened with remote_handle_open()
This function closes the remote handle and frees any associated resources. The handle becomes invalid after this call and should not be used again.
__QAIC_IN remote_handle
[in] Remote handle to close, obtained from remote_handle_open()
remote_handle64_close
remote_handle_control
Sets control parameters for remote handle operations.
This function allows configuring various control parameters for remote handle operations like latency requirements, wake lock control, domain info etc.
__QAIC_IN uint32_t
[in] Request ID specifying the control parameter to set, defined in enum handle_control_req_id:
DSPRPC_CONTROL_LATENCY: Configure latency requirements
DSPRPC_CONTROL_WAKELOCK: Enable/disable wake lock control
DSPRPC_GET_DOMAIN: Get domain ID for a handle See handle_control_req_id enum for full list
__QAIC_IN_LEN(datalen) void *
[in] Pointer to request-specific data structure containing parameters:
For DSPRPC_CONTROL_LATENCY: struct remote_rpc_control_latency
For DSPRPC_CONTROL_WAKELOCK: struct remote_rpc_control_wakelock
For DSPRPC_GET_DOMAIN: struct remote_rpc_get_domain Structure must match the request ID
__QAIC_IN uint32_t
[in] Size of the data structure in bytes
remote_handle64_control
remote_session_control
Sets control parameters for remote sessions.
This function allows configuring various control parameters for remote sessions like process lifecycle, thread parameters, session management etc.
__QAIC_IN uint32_t
[in] Request ID specifying the control parameter to set, defined in enum session_control_req_id:
FASTRPC_THREAD_PARAMS: Set thread priority and stack size
FASTRPC_REMOTE_PROCESS_KILL: Kill remote process
FASTRPC_SESSION_CLOSE: Close all open handles for a domain
FASTRPC_RESERVE_NEW_SESSION: Reserve a new FastRPC session See session_control_req_id enum for full list
__QAIC_IN_LEN(datalen) void *
[in] Pointer to request-specific data structure containing parameters:
For FASTRPC_THREAD_PARAMS: struct remote_rpc_thread_params
For FASTRPC_REMOTE_PROCESS_KILL: struct remote_rpc_process_kill
For FASTRPC_RESERVE_NEW_SESSION: struct remote_rpc_control_session Structure must match the request ID
__QAIC_IN uint32_t
[in] Size of the data structure in bytes
remote_handle_invoke_async
Invokes a remote handle asynchronously.
This function allows asynchronous invocation of remote methods, providing non-blocking execution and callback mechanisms.
__QAIC_IN remote_handle
[in] Remote handle obtained from remote_handle_open()
__QAIC_IN fastrpc_async_descriptor_t *
[in] Async descriptor containing:
type: Type of async job (FASTRPC_ASYNC_NO_SYNC, FASTRPC_ASYNC_CALLBACK)
context: User context passed to callback
cb: Callback function and arguments (for FASTRPC_ASYNC_CALLBACK type) See fastrpc_async_descriptor_t for details
__QAIC_IN uint32_t
[in] Method invocation parameters encoded as scalar value:
Number of input/output buffers
Number of input/output handles Use REMOTE_SCALARS_* macros to decode
__QAIC_IN remote_arg *
[in] Array of remote_arg structures containing:
Input buffers
Output buffers
Input handles
Output handles Output buffers must be allocated via rpcmem_alloc() or registered as ION buffers using register_buf()
remote_handle64_invoke_async
fastrpc_async_get_status
Gets the status and result of an asynchronous FastRPC job.
This function allows checking the completion status of an asynchronous FastRPC job and retrieving its result. It can be configured to wait for job completion with different timeout behaviors.
__QAIC_IN fastrpc_async_jobid
[in] Job ID returned by remote_handle_invoke_async() when submitting the asynchronous job
__QAIC_IN int
[in] Timeout value in microseconds:
0: Returns immediately with current status/result
Positive value: Waits up to specified microseconds for completion
Negative value: Waits indefinitely until job completes
__QAIC_OUT int *
[out] Pointer to store the job result:
0 if job completed successfully
Error code if job failed Only valid when function returns 0 (job completed)
fastrpc_release_async_job
Releases resources associated with an asynchronous FastRPC job.
This function must be called after an asynchronous job completes to free associated resources and cleanup internal state. It should only be called after receiving job completion status either through:
Callback notification (for FASTRPC_ASYNC_CALLBACK jobs)
Polling via fastrpc_async_get_status() (for FASTRPC_ASYNC_POLL jobs)
__QAIC_IN fastrpc_async_jobid
[in] Job ID returned by remote_handle_invoke_async() when submitting the asynchronous job
remote_mmap
DEPRECATED: Use fastrpc_mmap() instead.
Maps memory to the remote domain. This function is limited to 32-bit addresses and provides basic mapping functionality without cache configuration control.
__QAIC_IN int
[in] File descriptor associated with the memory to be mapped. Must be a valid DMA buffer file descriptor.
__QAIC_IN uint32_t
[in] Mapping flags. Currently only REMOTE_MAP_MEM_STATIC is supported.
__QAIC_IN uint32_t
[in] Input virtual address on CPU side. Must be the address returned by mmap() when mapping the DMA fd.
__QAIC_IN int
[in] Size of buffer in bytes to map. Must be page aligned (4KB).
__QAIC_OUT uint32_t *
[out] Pointer to store the mapped address on remote domain.
remote_munmap
DEPRECATED: Use fastrpc_munmap() instead.
Unmaps memory previously mapped using remote_mmap() from the remote domain. This function is limited to 32-bit addresses.
__QAIC_IN uint32_t
[in] Remote virtual address returned by remote_mmap()
__QAIC_IN int
[in] Size of buffer to unmap in bytes. Must match the size used in remote_mmap(). Partial unmapping is not supported.
remote_mem_map
DEPRECATED: Use fastrpc_mmap() instead.
Maps memory to a specific remote domain process. This function provides more control over domain selection compared to remote_mmap().
__QAIC_IN int
[in] DSP domain ID to map memory to. Use -1 for default domain based on linked library (lib(a/m/s/c)dsprpc.so). Valid domains: ADSP_DOMAIN_ID, MDSP_DOMAIN_ID, SDSP_DOMAIN_ID, CDSP_DOMAIN_ID, GDSP_DOMAIN_ID
__QAIC_IN int
[in] File descriptor of DMA memory to map
__QAIC_IN int
[in] Mapping flags from enum remote_mem_map_flags
__QAIC_IN uint64_t
[in] Virtual address of buffer on CPU side
__QAIC_IN size_t
[in] Size of buffer in bytes to map
__QAIC_OUT uint64_t *
[out] Pointer to store the mapped address on remote domain
remote_mem_unmap
DEPRECATED: Use fastrpc_munmap() instead.
Unmaps memory previously mapped using remote_mem_map() from a specific remote domain process.
__QAIC_IN int
[in] DSP domain ID to unmap memory from. Use -1 for default domain. Must match domain used in remote_mem_map().
__QAIC_IN uint64_t
[in] Remote virtual address returned by remote_mem_map()
__QAIC_IN size_t
[in] Size of buffer in bytes to unmap. Must match size used in remote_mem_map().
remote_mmap64
DEPRECATED: Use fastrpc_mmap() instead.
Maps memory to the remote domain with 64-bit address support. This is the 64-bit version of remote_mmap().
__QAIC_IN int
[in] File descriptor associated with the memory to be mapped
__QAIC_IN uint32_t
[in] Mapping flags. Currently only REMOTE_MAP_MEM_STATIC is supported.
__QAIC_IN __QAIC_INT64PTR
[in] Input virtual address on CPU side (64-bit)
__QAIC_IN int64_t
[in] Size of buffer in bytes to map
__QAIC_OUT __QAIC_INT64PTR *
[out] Pointer to store the mapped address on remote domain (64-bit)
remote_munmap64
DEPRECATED: Use fastrpc_munmap() instead.
Unmaps memory previously mapped using remote_mmap64() from the remote domain. This is the 64-bit version of remote_munmap().
__QAIC_IN __QAIC_INT64PTR
[in] Remote virtual address returned by remote_mmap64()
__QAIC_IN int64_t
[in] Size of buffer to unmap in bytes. Must match size used in remote_mmap64().
fastrpc_mmap
fastrpc_mmap Creates a mapping on remote process for a DMA buffer with file descriptor.
New fastrpc session will be opened if not already opened for the domain. This API maps the buffer with RW- permission and CACHE WRITEBACK configuration. Driver will clean cache when buffer is passed in a FastRPC call.
__QAIC_IN int
[in] DSP domain ID of a fastrpc session. Use -1 for default domain based on linked library. Valid domains are ADSP_DOMAIN_ID, MDSP_DOMAIN_ID, SDSP_DOMAIN_ID, CDSP_DOMAIN_ID, or GDSP_DOMAIN_ID.
__QAIC_IN int
[in] DMA memory file descriptor obtained from dma_alloc_fd() or similar DMA allocation APIs.
__QAIC_IN void *
[in] Virtual address of the buffer on CPU side. Must be the same address returned by mmap() when mapping the DMA fd.
__QAIC_IN int
[in] Offset from the beginning of the buffer. Must be page aligned (4KB).
__QAIC_IN size_t
[in] Size of buffer in bytes to map. Must be page aligned (4KB).
__QAIC_IN enum fastrpc_map_flags
[in] Controls mapping functionality on DSP. See enum fastrpc_map_flags for valid flags: FASTRPC_MAP_CACHE_WRITEBACK - Map with writeback cache configuration (default) FASTRPC_MAP_CACHE_WRITETHROUGH - Map with writethrough cache configuration FASTRPC_MAP_CACHE_UNCACHED - Map as uncached memory FASTRPC_MAP_CACHE_NONCACHED - Map as non-cached memory
fastrpc_munmap
fastrpc_munmap Removes a mapping created by fastrpc_mmap() for a DMA buffer on the remote process.
The mapping must be removed before closing the DMA file descriptor.
__QAIC_IN int
[in] DSP domain ID of a fastrpc session. Use -1 for default domain based on linked library. Valid domains are ADSP_DOMAIN_ID, MDSP_DOMAIN_ID, SDSP_DOMAIN_ID, CDSP_DOMAIN_ID, or GDSP_DOMAIN_ID.
__QAIC_IN int
[in] DMA memory file descriptor that was used to create the mapping.
__QAIC_IN void *
[in] Virtual address of the buffer on CPU side. Must match the address used in fastrpc_mmap().
__QAIC_IN size_t
[in] Size of buffer in bytes to unmap. Must match the length used in fastrpc_mmap().
remote_register_buf
remote_register_buf/remote_register_buf_attr Register a file descriptor for a buffer to enable zero-copy sharing with DSP via SMMU.
These functions are thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.
__QAIC_IN_LEN(size) void *
[in] Virtual address of the buffer to register. Must be a valid mapped address.
__QAIC_IN int
[in] Size of the buffer in bytes. Must be > 0 and < 2GB.
__QAIC_IN int
[in] File descriptor for the buffer. Use -1 to deregister a previously registered buffer.
[in] (remote_register_buf_attr only) Buffer attributes: 0 - Non-coherent mapping (cached) 1 - Coherent mapping (uncached)
remote_register_buf_attr
remote_register_buf_attr2
remote_register_buf_attr2 Register a file descriptor for a buffer to enable zero-copy sharing with DSP via SMMU.
This version supports 64-bit buffer sizes, unlike remote_register_buf/remote_register_buf_attr.
This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.
Some older versions of libcdsprpc.so lack this function, so users should set this symbol as weak: #pragma weak remote_register_buf_attr2
__QAIC_IN_LEN(size) void *
[in] Virtual address of the buffer to register. Must be a valid mapped address.
__QAIC_IN size_t
[in] Size of the buffer in bytes. Must be > 0.
__QAIC_IN int
[in] File descriptor for the buffer. Use -1 to deregister a previously registered buffer.
__QAIC_IN int
[in] Buffer attributes: 0 - Non-coherent mapping (cached) 1 - Coherent mapping (uncached) 2 - No mapping, buffer used as identifier only
remote_register_dma_handle
remote_register_dma_handle/remote_register_dma_handle_attr Register a DMA handle with FastRPC to enable zero-copy sharing of ION memory with DSP via SMMU.
This API is only valid on Android systems with ION-allocated memory.
This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.
Some versions of libadsprpc.so lack this function, so users should set these symbols as weak: #pragma weak remote_register_dma_handle #pragma weak remote_register_dma_handle_attr
__QAIC_IN int
[in] File descriptor for the ION buffer. Use -1 to deregister a previously registered buffer.
__QAIC_IN uint32_t
[in] Size of the buffer in bytes. Must be > 0.
[in] (remote_register_dma_handle_attr only) Buffer attributes: 0 - Non-coherent mapping (cached) 1 - Coherent mapping (uncached) 2 - No mapping, buffer used as identifier only
remote_register_dma_handle_attr
remote_register_fd
remote_register_fd Register a file descriptor with FastRPC to enable zero-copy sharing of memory with DSP.
This API is useful when users have a file descriptor but no virtual address mapping.
The function creates a PROT_NONE mapping that cannot be accessed directly, but serves as an identifier for the buffer in FastRPC calls. The mapping is used internally by the RPC layer to share the buffer with DSP.
This API has a 2GB size limitation. For larger buffers, use remote_register_fd2().
This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.
Some versions of libadsprpc.so lack this function, so users should set this symbol as weak: #pragma weak remote_register_fd
__QAIC_IN int
[in] File descriptor for the buffer. Must be a valid file descriptor.
__QAIC_IN int
[in] Size of the buffer in bytes. Must be > 0 and < 2GB.
remote_register_fd2
remote_register_fd2 Register a file descriptor with FastRPC to enable zero-copy sharing of memory with DSP.
This API is useful when users have a file descriptor but no virtual address mapping. Unlike remote_register_fd(), this function supports buffers larger than 2GB.
The function creates a PROT_NONE mapping that cannot be accessed directly, but serves as an identifier for the buffer in FastRPC calls. The mapping is used internally by the RPC layer to share the buffer with DSP.
This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.
Some versions of libadsprpc.so lack this function, so users should set this symbol as weak: #pragma weak remote_register_fd2
__QAIC_IN int
[in] File descriptor for the buffer. Must be a valid file descriptor.
__QAIC_IN size_t
[in] Size of the buffer in bytes. Must be > 0.

