Forums - adsprpc zero-copy and host access to persistent buffers

2 posts / 0 new
Last post
adsprpc zero-copy and host access to persistent buffers
ashapiro
Join Date: 30 Dec 13
Posts: 26
Posted: Tue, 2014-09-02 11:17

Hi,

I'm trying to use a persistent thread on the aDSP to process real-time RF samples provided by a host thread on the CPU. I allocated a buffer for the input samples and two for the two sets of output values, and passed them into my initialization function that constructs the thread via adsprpc, then stored their pointers for use later. I was under the impression that the DSP shared memory with the CPU and RPC calls were zero-copy, with the stub/skel code simply updating the cache entries on each as necessary, in which case I would expect the pointers to stay constant for the life of the application.

What I'm seeing, though, is that the pointers change from one adsprpc function to another. For example, the buffers' addresses in my initialize function are: input=0xfdb01000, output0=0xfdb00000, output1=0xfdb02000. When I call the update function, providing it the same host-side input array (allocated with ION), it uses the following address on the DSP side: input=0xfdb00000. This is the same address as output0 during initialization, suggesting that they are reusing temporary buffers rather than being distinct addresses. Am I missing something here?

What is the suggested way to do this? I'm essentially trying to create a zero-copy circular message queue from a single large input buffer, broken up into N equally sized messages. When the producer fills in a message it calls an RPC function that notifies the DSP thread by way of a QuRT pipe. Is there a way to do this without having to copy the data from the user into a buffer allocated on the DSP?

Thanks,

Adam

  • Up0
  • Down0
anatolyy
Join Date: 15 Feb 14
Posts: 7
Posted: Sun, 2014-10-19 13:49

buffers are mapped and unmapped per call, so there is no guarantee that you would get the same virtual address on the next call.  

  • Up0
  • Down0
or Register

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.