table of contents
- trixie-backports 1.0.7-2~bpo13+1
- testing 1.0.7-2
- unstable 1.0.7-2
| fastrpc(3) | Library Functions | fastrpc(3) |
NAME¶
fastrpc - Qualcomm FastRPC C API
SYNOPSIS¶
#include <fastrpc/remote.h>
#include <fastrpc/rpcmem.h>
Remote Handle Functions¶
int remote_handle64_open(const char* name, remote_handle64
*ph);
int remote_handle64_invoke(remote_handle64 h, uint32_t dwScalars,
remote_arg *pra);
int remote_handle64_invoke_async(remote_handle64 h,
fastrpc_async_descriptor_t *desc, uint32_t dwScalars, remote_arg *pra);
int remote_handle64_control(remote_handle64 h, uint32_t req, void* data,
uint32_t datalen);
int remote_handle64_close(remote_handle64 h);
RPC Memory Functions (rpcmem)¶
void rpcmem_init(void);
void rpcmem_deinit(void);
void* rpcmem_alloc(int heapid, uint32_t flags, int size);
void* rpcmem_alloc2(int heapid, uint32_t flags, size_t size);
static inline void* rpcmem_alloc_def(int size);
void rpcmem_free(void* po);
int rpcmem_to_fd(void* po);
DSP Queue Functions (dspqueue_rpc)¶
int dspqueue_rpc_open(const char* uri, remote_handle64* h);
int dspqueue_rpc_close(remote_handle64 h);
AEEResult dspqueue_rpc_init_process_state(remote_handle64 _h, int32_t
process_state_fd);
AEEResult dspqueue_rpc_create_queue(remote_handle64 _h, uint32_t id,
int32_t queue_fd, uint32_t count, uint64_t* queue_id);
AEEResult dspqueue_rpc_destroy_queue(remote_handle64 _h, uint64_t
queue_id);
AEEResult dspqueue_rpc_is_imported(remote_handle64 _h, uint64_t queue_id,
int32_t* imported);
AEEResult dspqueue_rpc_wait_signal(remote_handle64 _h, int32_t*
signal);
AEEResult dspqueue_rpc_cancel_wait_signal(remote_handle64 _h);
AEEResult dspqueue_rpc_signal(remote_handle64 _h);
DESCRIPTION¶
The fastRPC library provides mechanisms to offload execution of compute-intensive tasks from the Application Processor (CPU) to remote DSP domains (such as ADSP, CDSP, SDSP, and GDSP). It uses an IDL compiler to generate stub (CPU) and skel (DSP) code, which communicate via the APIs exposed in this header.
Remote Handle Functions¶
- remote_handle64_open()
- Opens a multi-domain remote handle for a specific device or URI. The handle is stored in ph upon success.
- remote_handle64_invoke()
- Invokes a remote procedure call synchronously on the DSP using the given handle h. dwScalars specifies the signature of the arguments, and pra points to the array of arguments.
- remote_handle64_invoke_async()
- Asynchronously invokes a remote procedure call on the DSP. The completion is tracked via the desc asynchronous descriptor.
- remote_handle64_control()
- Sends a control request (such as getting the domain ID) to the DSP driver for an open handle.
- remote_handle64_close()
- Closes an open remote handle and releases associated resources.
RPC Memory (rpcmem) Functions¶
The rpcmem functions provide memory allocation routines that guarantee memory buffers are correctly mapped and contiguous, enabling zero-copy transfers between the CPU and DSP. Memory heaps are identified by an ID (e.g., RPCMEM_HEAP_ID_SYSTEM, RPCMEM_HEAP_ID_CONTIG) and constrained by flags (e.g., RPCMEM_FLAG_UNCACHED, RPCMEM_FLAG_CACHED, RPCMEM_DEFAULT_FLAGS).
- rpcmem_init() / rpcmem_deinit()
- Initializes and deinitializes the RPC memory subsystem. If a client links with libadsprpc.so, libcdsprpc.so, or libsdsprpc.so directly, the initialization is handled automatically.
- rpcmem_alloc() / rpcmem_alloc2()
- Allocates RPC memory from a specific ION/DMA heap heapid.
flags specify caching and alignment constraints. Use
rpcmem_alloc2() for allocations larger than 2 GB.
Example: rpcmem_alloc(RPCMEM_HEAP_ID_SYSTEM, RPCMEM_DEFAULT_FLAGS, 4096); - rpcmem_alloc_def()
- A convenience inline wrapper for allocating system heap memory using default cached flags.
- rpcmem_free()
- Frees memory previously allocated by rpcmem_alloc() or rpcmem_alloc2().
- rpcmem_to_fd()
- Retrieves the file descriptor (FD) underlying an RPC memory allocation. This is useful for passing the buffer directly to other sub-systems (like DMA-BUF).
DSP Queue (dspqueue_rpc) Functions¶
The dspqueue_rpc API allows the setup and management of shared DSP queues, enabling highly efficient, stateful asynchronous communication and signaling.
- dspqueue_rpc_open()
- Opens a fastRPC connection to the DSP queue interface using the specified uri (e.g., "file:///libdspqueue_rpc_skel.so?dspqueue_rpc_skel_handle_invoke&_modver=1.0").
- dspqueue_rpc_close()
- Closes the given DSP queue handle h.
- dspqueue_rpc_init_process_state()
- Initializes the overall process state on the DSP utilizing the provided process_state_fd.
- dspqueue_rpc_create_queue()
- Creates a shared communication queue on the remote DSP bound to the given memory file descriptor queue_fd and count. Outputs the identifier into queue_id.
- dspqueue_rpc_destroy_queue()
- Destroys and reclaims a previously created remote queue matching queue_id.
- dspqueue_rpc_is_imported()
- Verifies if a specific queue_id has been successfully imported by the DSP side.
- dspqueue_rpc_wait_signal()
- Blocks and waits for a remote queue signal to be emitted by the DSP.
- dspqueue_rpc_cancel_wait_signal()
- Cancels a pending wait signal operation on the remote handle.
- dspqueue_rpc_signal()
- Fires a signal event from the CPU to awake the associated DSP queue loop.
RETURN VALUE¶
On success, handle functions and most dspqueue functions return 0 (AEE_SUCCESS). On error, they return a non-zero error code. rpcmem_alloc() and its variants return a valid pointer on success, or NULL on failure.
SEE ALSO¶
| May 2026 | fastrpc |