# qualcomm/fastrpc architecture

> Architecture diagram of the GitHub repository qualcomm/fastrpc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qualcomm/fastrpc
- Repository: https://github.com/qualcomm/fastrpc

## Overview

FastRPC lets a CPU-side application invoke DSP code through generated stubs and skeletons, with the framework transporting requests and responses between processors. The principal workflow is application → stub → CPU library → kernel transport → DSP framework → skeleton → implementation, then back with results. The repository includes CPU runtime APIs, DSP-side support, memory and queue facilities, and service interfaces. README workflow relationships are documented; source excerpts are partial, so unverified internal call links are omitted.

Main entry points: [`src/fastrpc_apps_user.c`](https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_apps_user.c) (FastRPC client API), [`src/dsprpcd.c`](https://github.com/qualcomm/fastrpc/blob/development/src/dsprpcd.c) (DSP RPC daemon), [`src/apps_std_skel.c`](https://github.com/qualcomm/fastrpc/blob/development/src/apps_std_skel.c) (Generated skeletons), [`src/apps_std_imp.c`](https://github.com/qualcomm/fastrpc/blob/development/src/apps_std_imp.c) (Standard service implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["CPU client runtime"]
  node_cpu_api["FastRPC client API"]
  node_public_api["Remote API definitions<br/>[remote.h]"]
  node_context["Session contexts<br/>[fastrpc_context.c]"]
  node_memory["RPC memory mapping<br/>[fastrpc_mem.c]"]
end

subgraph group_transport["DSP transport runtime"]
  node_dsp_driver["DSP RPC daemon<br/>[dsprpcd.c]"]
  node_queue["DSP request queues<br/>[dspqueue_cpu.c]"]
end

subgraph group_services["DSP services"]
  node_skeleton["Generated skeletons<br/>[apps_std_skel.c]"]
  node_service_impl["Standard service implementation<br/>[apps_std_imp.c]"]
  node_memory_service["Memory service<br/>[apps_mem_imp.c]"]
  node_remote_control["Remote control service"]
  node_listener["DSP listeners"]
  node_message_service["DSP message service<br/>[adspmsgd.c]"]
end

subgraph group_support["Runtime support"]
  node_config["Configuration parser"]
  node_internal["RPC internal definitions<br/>[fastrpc_internal.h]"]
  node_common["Shared runtime definitions<br/>[fastrpc_common.h]"]
  node_utilities["Runtime utilities<br/>[AEEstd.h]"]
end

node_application(("CPU application"))
node_stub["Generated stub"]
node_kernel["Kernel RPC driver"]

node_application -->|"calls"| node_stub
node_stub -->|"invokes"| node_cpu_api
node_cpu_api -->|"queues request"| node_kernel
node_kernel -->|"transports via rpmsg"| node_dsp_driver
node_dsp_driver -->|"dispatches call"| node_skeleton
node_skeleton -->|"invokes method"| node_service_impl
node_service_impl -->|"returns result"| node_skeleton
node_skeleton -->|"queues response"| node_dsp_driver
node_dsp_driver -->|"returns response"| node_kernel
node_kernel -->|"dispatches response"| node_cpu_api
node_cpu_api -->|"returns result"| node_stub
node_stub -->|"returns result"| node_application
node_cpu_api -.->|"maps buffers"| node_memory
node_cpu_api -.->|"manages sessions"| node_context
node_dsp_driver -.->|"dispatches requests"| node_queue

click node_cpu_api "https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_apps_user.c"
click node_public_api "https://github.com/qualcomm/fastrpc/blob/development/inc/remote.h"
click node_context "https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_context.c"
click node_memory "https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_mem.c"
click node_dsp_driver "https://github.com/qualcomm/fastrpc/blob/development/src/dsprpcd.c"
click node_queue "https://github.com/qualcomm/fastrpc/blob/development/src/dspqueue/dspqueue_cpu.c"
click node_skeleton "https://github.com/qualcomm/fastrpc/blob/development/src/apps_std_skel.c"
click node_service_impl "https://github.com/qualcomm/fastrpc/blob/development/src/apps_std_imp.c"
click node_memory_service "https://github.com/qualcomm/fastrpc/blob/development/src/apps_mem_imp.c"
click node_remote_control "https://github.com/qualcomm/fastrpc/blob/development/src/apps_remotectl_skel.c"
click node_listener "https://github.com/qualcomm/fastrpc/blob/development/src/adsp_default_listener.c"
click node_message_service "https://github.com/qualcomm/fastrpc/blob/development/src/adspmsgd.c"
click node_config "https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_config_parser.c"
click node_internal "https://github.com/qualcomm/fastrpc/blob/development/inc/fastrpc_internal.h"
click node_common "https://github.com/qualcomm/fastrpc/blob/development/inc/fastrpc_common.h"
click node_utilities "https://github.com/qualcomm/fastrpc/blob/development/inc/AEEstd.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cpu_api,node_public_api,node_context,node_memory toneBlue
class node_dsp_driver,node_queue toneAmber
class node_skeleton,node_service_impl,node_memory_service,node_remote_control,node_listener,node_message_service toneMint
class node_config,node_internal,node_common,node_utilities toneRose
class node_application,node_stub,node_kernel toneIndigo
```

## Components

### CPU client runtime

- [FastRPC client API](https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_apps_user.c): `src/fastrpc_apps_user.c`
- [Remote API definitions](https://github.com/qualcomm/fastrpc/blob/development/inc/remote.h): `inc/remote.h`
- [Session contexts](https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_context.c): `src/fastrpc_context.c`
- [RPC memory mapping](https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_mem.c): `src/fastrpc_mem.c`

### DSP transport runtime

- [DSP RPC daemon](https://github.com/qualcomm/fastrpc/blob/development/src/dsprpcd.c): `src/dsprpcd.c`
- [DSP request queues](https://github.com/qualcomm/fastrpc/blob/development/src/dspqueue/dspqueue_cpu.c): `src/dspqueue/dspqueue_cpu.c`

### DSP services

- [Generated skeletons](https://github.com/qualcomm/fastrpc/blob/development/src/apps_std_skel.c): `src/apps_std_skel.c`
- [Standard service implementation](https://github.com/qualcomm/fastrpc/blob/development/src/apps_std_imp.c): `src/apps_std_imp.c`
- [Memory service](https://github.com/qualcomm/fastrpc/blob/development/src/apps_mem_imp.c): `src/apps_mem_imp.c`
- [Remote control service](https://github.com/qualcomm/fastrpc/blob/development/src/apps_remotectl_skel.c): `src/apps_remotectl_skel.c`
- [DSP listeners](https://github.com/qualcomm/fastrpc/blob/development/src/adsp_default_listener.c): `src/adsp_default_listener.c`
- [DSP message service](https://github.com/qualcomm/fastrpc/blob/development/src/adspmsgd.c): `src/adspmsgd.c`

### Runtime support

- [Configuration parser](https://github.com/qualcomm/fastrpc/blob/development/src/fastrpc_config_parser.c): `src/fastrpc_config_parser.c`
- [RPC internal definitions](https://github.com/qualcomm/fastrpc/blob/development/inc/fastrpc_internal.h): `inc/fastrpc_internal.h`
- [Shared runtime definitions](https://github.com/qualcomm/fastrpc/blob/development/inc/fastrpc_common.h): `inc/fastrpc_common.h`
- [Runtime utilities](https://github.com/qualcomm/fastrpc/blob/development/inc/AEEstd.h): `inc/AEEstd.h`

### Other components

- **CPU application**
- **Generated stub**
- **Kernel RPC driver**

## Connections

- CPU application → Generated stub: calls
- Generated stub → FastRPC client API: invokes
- FastRPC client API → Kernel RPC driver: queues request
- Kernel RPC driver → DSP RPC daemon: transports via rpmsg
- DSP RPC daemon → Generated skeletons: dispatches call
- Generated skeletons → Standard service implementation: invokes method
- Standard service implementation → Generated skeletons: returns result
- Generated skeletons → DSP RPC daemon: queues response
- DSP RPC daemon → Kernel RPC driver: returns response
- Kernel RPC driver → FastRPC client API: dispatches response
- FastRPC client API → Generated stub: returns result
- Generated stub → CPU application: returns result
- FastRPC client API → RPC memory mapping: maps buffers
- FastRPC client API → Session contexts: manages sessions
- DSP RPC daemon → DSP request queues: dispatches requests
