Back to All
OnQ Blog

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

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.

Qualcomm-image

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"). 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.

About the Author
Jack MayEngineer, Principal
Qualcomm relentlessly innovates to deliver intelligent computing everywhere, helping the world tackle some of its most important challenges. Our leading-edge AI, high performance, low-power computing, and unrivaled connectivity deliver proven solutions that transform major industries. At Qualcomm, we are engineering human progress.

Stay connected

Get the latest Qualcomm and industry information delivered to your inbox.

Subscribe
Manage your subscription

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

Snapdragon and Qualcomm branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries. Qualcomm patented technologies are licensed by Qualcomm Incorporated.

Note: Certain services and materials may require you to accept additional terms and conditions before accessing or using those items.

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

Qualcomm Incorporated includes our licensing business, QTL, and the vast majority of our patent portfolio. Qualcomm Technologies, Inc., a subsidiary of Qualcomm Incorporated, operates, along with its subsidiaries, substantially all of our engineering, research and development functions, and substantially all of our products and services businesses, including our QCT semiconductor business.

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 or license any of the services or materials referenced herein.