This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[OMAP-L137] DSPLink RingIO and RingIO_acquire() Function



Using DSPLink 1.63, on an OMAP L137 EVM, I'm using ring IO to receive data from a DSP.  The RingIO_acquire function returns an error status if the data is below the watermark I set.  This works as excpected and my callback handler is invoked and my thread attempts to invoke RingIO_acquire when data is available (per my watermark).  However, after a while, I notice the acquire function sets the acquired bytes "OUT" param to 0, even though the getValidData is showing more data than required by my watermark.  When this happens, the buffer fills up and the DSP is waiting for an available segment to acquire and write.  The only thing I can do is RingIO_flush on the reader side; however, my valid data that I want to process is now flushed.

Suggestions would be greatly appreciated.

  • Hello,

    The behavior of RingIO_acquire for Reader client depends on the NEED_EXACT_SIZE specified while opening the RingIO client.

    I will give some details on the behavior of RingIO_acquire before describing what I feel your problem is.

    The NEED_EXACT_SIZE flag indicates whether the reader always needs buffers only of a specific size and buffers of lesser size are not acceptable.

    • NEED_EXACT_SIZE is TRUE

    If the requested valid size is not available within the RingIO as a contiguous data buffer, error is returned.
    If the requested empty size is not available till the end of the RingIO buffer, but is available from the top of the buffer, the behavior varies depending on whether a foot-buffer has been configured.

    • If non-zero size foot-buffer is configured, the required amount of valid data is copied from the top of the data buffer into the foot-buffer (assuming foot-buffer size is sufficient). A contiguous data buffer is then returned to the user as requested. Further acquires will happen from the specific offset from the top of the buffer. If foot-buffer size is not sufficient to return a contiguous data buffer of specified size, error is returned.   If foot-buffer is not configured, error is returned in this case.
    •  NEED_EXACT_SIZE is FALSE: If the requested buffer size is not available, RingIO returns the amount of valid contiguous data buffer that is available till the end of the data buffer, with a status code indicating this. Foot-buffer is not used in this scenario

    In your scenario, RingIO wrap around seems to be occurring. RingIO client has NEED_EXACT_SIZE as true. Also, configured foot buffer is 0 or less than what is required for RingIO_acquire to pass. Some amount of the valid data is present at the end of the RingIO buffer. The remaining valid data is present from the top of the RingIO buffer. This explains why RingIO_acquire is failing even though the valid data size is more than your watermark.

    To solve your problem I would request you to set a foot buffer of appropriate size. As explained in the RingIO_acquire theory given above, it will enable your RingIO_acquire to pass. Please have a look at the foot buffer section in the ProgrammersGuide available at $DSPLINK/doc. This gives detailed design as well as use case scenarios including the one who are facing.

    Deepali