OnQ Blog

How to use FastRPC to offload from CPU to Qualcomm Hexagon DSP

Jul 23, 2015

Qualcomm products mentioned within this post are offered by Qualcomm Technologies, Inc. and/or its subsidiaries.

What do drones, robots and cameras have in common?

They can all take advantage of the DSP for higher performance in real-time tasks. In drones, that means flight control; in robots, that means balance and walking; and in cameras, it means image pre- and post-processing. Offloading real-time tasks from the CPU to the DSP is a big step toward higher performance, with the sweetener of much lower power consumption.

How To Use Hexagon DSP And FastRPC

Our Hexagon SDK exposes FastRPC, a remote procedure call framework allowing clients to transparently make remote method invocations between the Qualcomm Snapdragon processor (APPS) and the application DSP (aDSP). It’s available now on the Snapdragon 8074 built into the DragonBoard 800, a product of Lantronix Technologies Corporation, as well as the 8084 and 8994.

FastRPC is designed around several features that make offloading tasks as easy as possible:

  • Initiating the remote invocation looks the same as if you called it locally, you provide the function definition via IDL (Interface Description Language).
  • Tools auto-generate interface header and libs to handle parameter passing, cache coherency.
  • For FastRPC calls into dynamic modules the framework loads the aDSP module for you.
  • FastRPC is synchronous. That eliminates the complexity of having the kernel manage state between aDSP and APPS in an asynchronous call.

The diagram shows the invocation of a single method in which the client resides on APPS (e.g., Snapdragon CPU) and the object resides on the aDSP (e.g., Hexagon). The stub and skel are auto-generated, you only need to call the function from the applications processor and provide the implementation of that function on the aDSP.

On an Android device that supports FastRPC, these are the steps to get your job offloaded to the aDSP.

  1. Download and install the Hexagon SDK.
  2. Describe your job’s API in IDL (Interface Description Language).
  3. Auto generate your header, and the stub and skel libraries.
  4. Implement your API on the DSP, link it and the skel library into a shared object, push the shared object to the device.
  5. Link the stub to your android native app and call your API.
  6. (Optional) Create java bindings for your API and call you API from an APK.

That’s it.

A Drone Developer Kit?

Not exactly.

But we’re seeing developers take the Snapdragon processor in that direction, and the Hexagon DSP goes with it. You can do plenty more on the DSP than just multimedia, so dig in and find out for yourself.

If you’re a drone or robotics developer looking for faster execution of real-time tasks with lower power consumption, apply for access to the Hexagon SDK. It includes full documentation and code samples for invoking FastRPC.

And stay tuned for more how-to’s and use cases involving Hexagon.

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries ("Qualcomm"). Qualcomm products mentioned within this post are offered by Qualcomm Technologies, Inc. and/or its subsidiaries. The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.

Jack May

Engineer, Principal

©2021 Qualcomm Technologies, Inc. and/or its affiliated companies.

References to "Qualcomm" may mean Qualcomm Incorporated, or subsidiaries or business units within the Qualcomm corporate structure, as applicable.

Qualcomm Incorporated includes Qualcomm's licensing business, QTL, and the vast majority of its patent portfolio. Qualcomm Technologies, Inc., a wholly-owned subsidiary of Qualcomm Incorporated, operates, along with its subsidiaries, substantially all of Qualcomm's engineering, research and development functions, and substantially all of its products and services businesses. Qualcomm products referenced on this page are products of Qualcomm Technologies, Inc. and/or its subsidiaries.

Materials that are as of a specific date, including but not limited to press releases, presentations, blog posts and webcasts, may have been superseded by subsequent events or disclosures.

Nothing in these materials is an offer to sell any of the components or devices referenced herein.