Skip to main content
Header: 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”
Parameters
__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.
Returns 0 on success, otherwise error code: AEE_EINVALIDFORMAT: Invalid URI format AEE_EUNSUPPORTED: Domain or module not supported AEE_ENOSUCH: Module not found AEE_EBADPARM: Invalid parameters (NULL pointers) AEE_ENOMEMORY: Not enough memory AEE_ECONNREFUSED: Connection to DSP failed AEE_EVERSION: Version mismatch when _modver or _sgver specified

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().
Parameters
__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
Returns 0 on success, otherwise error code: AEE_EBADPARM: Invalid parameters (NULL pointers) AEE_EINVALIDHANDLE: Invalid remote handle AEE_EUNSUPPORTED: Operation not supported AEE_ENOMEMORY: Not enough memory AEE_ECONNREFUSED: Connection to DSP failed AEE_ETIMEOUT: RPC call timed out

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.
Parameters
__QAIC_IN remote_handle
[in] Remote handle to close, obtained from remote_handle_open()
Returns 0 on success, otherwise error code: AEE_EINVALIDHANDLE: Invalid remote handle AEE_EBUSY: Handle is still in use by pending operations AEE_EFAILED: Internal error occurred during cleanup

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.
Parameters
__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
Returns 0 on success, otherwise error code: AEE_EBADPARM: Invalid parameters (NULL data pointer, invalid datalen) AEE_EUNSUPPORTED: Request ID not supported AEE_EFAILED: Internal error occurred Request-specific error codes

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.
Parameters
__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
Returns 0 on success, otherwise error code: AEE_EBADPARM: Invalid parameters (NULL data pointer, invalid datalen) AEE_ENOSUCH: Process/session not found AEE_EINVALIDDOMAIN: Invalid domain ID specified Other error codes returned from FastRPC framework

remote_handle_invoke_async

Invokes a remote handle asynchronously. This function allows asynchronous invocation of remote methods, providing non-blocking execution and callback mechanisms.
Parameters
__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()
Returns 0 on success, otherwise error code: AEE_EBADPARM: Invalid parameters AEE_EUNSUPPORTED: Async operations not supported AEE_ENOSUCH: Invalid handle Other error codes from FastRPC framework

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.
Parameters
__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)
Returns 0 on success (job completed), otherwise error code: AEE_EBUSY: Job is still pending and not completed within timeout AEE_EBADPARM: Invalid job ID provided AEE_EFAILED: Internal FastRPC framework error

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)
Parameters
__QAIC_IN fastrpc_async_jobid
[in] Job ID returned by remote_handle_invoke_async() when submitting the asynchronous job
Returns 0 on success, otherwise error code: AEE_EBUSY: Job is still pending and has not completed yet AEE_EBADPARM: Invalid job ID provided AEE_EFAILED: Internal FastRPC framework error

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.
Parameters
__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.
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters AEE_EFAILED - Internal mapping failure

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.
Parameters
__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.
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters AEE_EFAILED - Internal unmapping failure AEE_EBUSY - Memory is still in use and cannot be unmapped

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().
Parameters
__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
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters AEE_EFAILED - Internal mapping failure

remote_mem_unmap

DEPRECATED: Use fastrpc_munmap() instead. Unmaps memory previously mapped using remote_mem_map() from a specific remote domain process.
Parameters
__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().
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters AEE_EFAILED - Internal unmapping failure AEE_EBUSY - Memory is still in use and cannot be unmapped

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().
Parameters
__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)
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters AEE_EFAILED - Internal mapping failure

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().
Parameters
__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().
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters AEE_EFAILED - Internal unmapping failure AEE_EBUSY - Memory is still in use and cannot be unmapped

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.
Parameters
__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
Returns 0 on success, error code on failure: AEE_EALREADY - Buffer already mapped. Multiple mappings for same buffer not supported. AEE_EBADPARM - Invalid parameters (null pointers, unaligned sizes, etc) AEE_EFAILED - Failed to map buffer (internal driver error) AEE_ENOMEMORY - Out of memory in driver AEE_EUNSUPPORTED - API not supported on target DSP

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.
Parameters
__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().
Returns 0 on success, error code on failure: AEE_EBADPARM - Invalid parameters (null pointers, unaligned sizes, etc) AEE_EINVALIDFD - No mapping found for the specified file descriptor AEE_EFAILED - Failed to unmap buffer (internal driver error) AEE_EUNSUPPORTED - API not supported on target DSP

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.
Parameters
__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)
Returns void. Check errno for error details: EINVAL - Invalid parameters (null buf, size=0, etc) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

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
Parameters
__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
Returns void. Check errno for error details: EINVAL - Invalid parameters (null buf, size=0, etc) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

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
Parameters
__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
Returns 0 on success, -1 on failure. Check errno for error details: EINVAL - Invalid parameters (fd < -1, len = 0, etc) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

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
Parameters
__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.
Returns On success, returns a virtual address that can be used in FastRPC calls. On failure, returns (void*)-1. Check errno for error details: EINVAL - Invalid parameters (fd < 0, size = 0 or size >= 2GB) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

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
Parameters
__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.
Returns On success, returns a virtual address that can be used in FastRPC calls. On failure, returns (void*)-1. Check errno for error details: EINVAL - Invalid parameters (fd < 0, size = 0) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

Type Definitions

domain_t

Domain type for multi-domain RPC calls.

remote_handle

Remote handle parameter for RPC calls.

remote_handle64

Remote handle parameter for multi-domain RPC calls.

fastrpc_async_jobid

Job id of Async job queued to DSP.

fastrpc_async_callback_t

Async call back response type, input structure.

fastrpc_async_descriptor_t

Async descriptor to submit async job.

fastrpc_capability

remote_rpc_get_domain_t

Structure used for request ID DSPRPC_GET_DOMAIN in remote handle control interface.

remote_rpc_process_exception

Structure used for request ID FASTRPC_REMOTE_PROCESS_EXCEPTION in remote session control interface This is used to trigger exception in the userPDs running on the DSP.

remote_rpc_status_flags_t

DSP user PD status notification flags Status flags for the user PD on the DSP returned by the status notification function.

fastrpc_notif_fn_t

fastrpc_notif_fn_t Notification call back function

remote_rpc_notif_register_t

Structure for remote_session_control, used with FASTRPC_REGISTER_STATUS_NOTIFICATIONS request ID to receive status notifications of the user PD on the DSP.

remote_rpc_reserve_new_session_t

Structure for remote_session_control, used with FASTRPC_RESERVE_SESSION request ID to reserve new fastrpc session of the user PD on the DSP.

remote_rpc_effective_domain_id_t

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.

remote_rpc_get_uri_t

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.

fastrpc_context_create

fastrpc_context_destroy

Enumerations

fastrpc_async_notify_type

Async response type.

Values

remote_rpc_latency_flags

Flags used in struct remote_rpc_control_latency for request ID DSPRPC_CONTROL_LATENCY in remote handle control interface.

Values

remote_dsp_attributes

Different types of DSP capabilities queried via remote_handle_control using DSPRPC_GET_DSP_INFO request id.

Values

handle_control_req_id

Request IDs for remote handle control interface.

Values

fastrpc_process_type

Process types Return values for FASTRPC_REMOTE_PROCESS_TYPE control req ID for remote_handle_control Return values denote the type of process on remote subsystem.

Values

remote_rpc_status_flags

DSP user PD status notification flags Status flags for the user PD on the DSP returned by the status notification function.

Values

session_control_req_id

Request IDs for remote session control interface.

Values

remote_mem_map_flags

Memory map control flags for using with remote_mem_map() and remote_mem_unmap()

Values

fastrpc_map_flags

for fastrpc_mmap and fastrpc_munmap

Values

Macros

__QAIC_REMOTE

__QAIC_REMOTE_EXPORT

__QAIC_REMOTE

__QAIC_RETURN

_WIN32 __QAIC_REMOTE_EXPORT

__QAIC_IN

_WIN32 __QAIC_RETURN

__QAIC_IN_CHAR

_WIN32 __QAIC_IN

__QAIC_IN_LEN

_WIN32 __QAIC_IN_CHAR

__QAIC_OUT

_WIN32 __QAIC_IN_LEN

__QAIC_INT64PTR

_WIN32 __QAIC_OUT

__QAIC_REMOTE_ATTRIBUTE

_WIN32 __QAIC_INT64PTR

REMOTE_SCALARS_METHOD_ATTR

__QAIC_REMOTE_ATTRIBUTE

REMOTE_SCALARS_METHOD

Retrieves method index from the scalars parameter.

REMOTE_SCALARS_INBUFS

Retrieves number of input buffers from the scalars parameter.

REMOTE_SCALARS_OUTBUFS

Retrieves number of output buffers from the scalars parameter.

REMOTE_SCALARS_INHANDLES

Retrieves number of input handles from the scalars parameter.

REMOTE_SCALARS_OUTHANDLES

Retrieves number of output handles from the scalars parameter.

REMOTE_SCALARS_MAKEX

Makes the scalar using the method attr, index and number of io buffers and handles.

REMOTE_SCALARS_MAKE

REMOTE_SCALARS_LENGTH

Retrieves number of io buffers and handles.

ADSP_DOMAIN_ID

Defines the domain IDs for supported DSPs.

MDSP_DOMAIN_ID

SDSP_DOMAIN_ID

CDSP_DOMAIN_ID

CDSP1_DOMAIN_ID

ADSP_DOMAIN_NAME

Supported Domain Names.

MDSP_DOMAIN_NAME

SDSP_DOMAIN_NAME

CDSP_DOMAIN_NAME

CDSP1_DOMAIN_NAME

GDSP0_DOMAIN_NAME

GDSP1_DOMAIN_NAME

ADSP_DOMAIN

Defines to prepare URI for multi-domain calls.

MDSP_DOMAIN

SDSP_DOMAIN

CDSP_DOMAIN

CDSP1_DOMAIN

GDSP0_DOMAIN

GDSP1_DOMAIN

ITRANSPORT_PREFIX

Internal transport prefix.

MAX_DOMAIN_URI_SIZE

Maximum length of URI for remote_handle_open() calls.

FASTRPC_WAKELOCK_CONTROL_SUPPORTED

Macro for backward compatibility.

FASTRPC_ATTR_NONE

Attributes for remote_register_buf_attr.

FASTRPC_ATTR_NON_COHERENT

FASTRPC_ATTR_COHERENT

FASTRPC_ATTR_KEEP_MAP

FASTRPC_ATTR_NOMAP

FASTRPC_ATTR_FORCE_NOFLUSH

FASTRPC_ATTR_FORCE_NOINVALIDATE

FASTRPC_ATTR_TRY_MAP_STATIC

REMOTE_MODE_PARALLEL

REMOTE_MODE_PARALLEL used with remote_set_mode This is the default mode for the driver.

REMOTE_MODE_SERIAL

REMOTE_MODE_SERIAL used with remote_set_mode When operating in SERIAL mode the driver will invalidate output buffers before calling into the dsp.