inc/remote.h
Structures
domain
Domain type for multi-domain RPC calls.
Members
remote_buf
32-bit Remote buffer parameter for RPC calls
Members
remote_buf64
64-bit Remote buffer parameter for RPC calls
Members
remote_dma_handle
32-bit Remote DMA handle parameter for RPC calls
Members
remote_dma_handle64
64-bit Remote DMA handle parameter for RPC calls
Members
remote_arg
32-bit Remote Arg structure for RPC calls
Members
remote_arg64
64-bit Remote Arg structure for RPC calls
Members
fastrpc_async_callback
Async call back response type, input structure.
Members
fastrpc_async_descriptor
Async descriptor to submit async job.
Members
remote_rpc_control_latency
Structure used for request ID DSPRPC_CONTROL_LATENCY in remote handle control interface.
Members
remote_dsp_capability
Members
remote_rpc_control_wakelock
Structure used for request ID DSPRPC_CONTROL_WAKELOCK in remote handle control interface.
Members
remote_rpc_get_domain
Structure used for request ID DSPRPC_GET_DOMAIN in remote handle control interface.
Members
remote_control_custom_path
Structure used for request IDs DSPRPC_SET_PATH and DSPRPC_GET_PATH in remote handle control interface.
Members
remote_rpc_thread_params
Structure used for request ID FASTRPC_THREAD_PARAMS in remote session control interface.
Members
remote_rpc_control_unsigned_module
Structure used for request ID DSPRPC_CONTROL_UNSIGNED_MODULE in remote session control interface.
Members
remote_rpc_relative_thread_priority
Structure used for request ID FASTRPC_RELATIVE_THREAD_PRIORITY in remote session control interface.
Members
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
remote_rpc_session_close
Structure used for request ID FASTRPC_SESSION_CLOSE in remote session control interface.
Members
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
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
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
remote_rpc_pd_initmem_size
Structure used for request ID FASTRPC_PD_INITMEM_SIZE in remote session control interface.
Members
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
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
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
fastrpc_context_create
Members
fastrpc_context_destroy
Members
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”
[in] URI of the module to open, found in the auto-generated header file. Format: “uri:module[;option1=value1][;option2=value2]…”
[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().
[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
[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.
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.
[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
[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
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.
[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
[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
remote_handle_invoke_async
Invokes a remote handle asynchronously.
This function allows asynchronous invocation of remote methods, providing non-blocking execution and callback mechanisms.
[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
[in] Method invocation parameters encoded as scalar value:
Number of input/output buffers
Number of input/output handles Use REMOTE_SCALARS_* macros to decode
[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.
[in] Job ID returned by remote_handle_invoke_async() when submitting the asynchronous job
[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
[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)
[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.
[in] File descriptor associated with the memory to be mapped. Must be a valid DMA buffer file descriptor.
[in] Input virtual address on CPU side. Must be the address returned by mmap() when mapping the DMA fd.
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.
[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().
[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
remote_mem_unmap
DEPRECATED: Use fastrpc_munmap() instead.
Unmaps memory previously mapped using remote_mem_map() from a specific remote domain process.
[in] DSP domain ID to unmap memory from. Use -1 for default domain. Must match domain 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().
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().
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.
[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.
[in] DMA memory file descriptor obtained from dma_alloc_fd() or similar DMA allocation APIs.
[in] Virtual address of the buffer on CPU side. Must be the same address returned by mmap() when mapping the DMA fd.
[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.
[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.
[in] Virtual address of the buffer on CPU side. Must match the address used in fastrpc_mmap().
[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.
[in] Virtual address of the buffer to register. Must be a valid mapped address.
[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
[in] Virtual address of the buffer to register. Must be a valid mapped address.
[in] File descriptor for the buffer. Use -1 to deregister a previously registered buffer.
[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
[in] File descriptor for the ION buffer. Use -1 to deregister a previously registered buffer.
[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

