Other Parts Discussed in Thread: DA8XX, DSD1791
Tool/software: Linux
We are using:
OMAP-L138 processor on a CriticalLink MityDSP-L138F board, with DSPLink MDK 2012-08-10
The GPP software runs on modified DaVinci Linux (DspLink) 1.65.0.3
We use DSPLink's NOTIFY_notify() to send a shared memory buffer address from the DSP to the GPP, which the GPP reads data from. Sometimes there are long delays or hangups in the registered Notify callback in the GPP code. The delays don't seem to be related to what the callback function is doing - they occur even if essentially all code is removed from the callback function - but the delays on the GPP side cause buffer corruption problems because the DSP is not delayed and the DSP begins to overwrite ping-pong buffered data before it can be read by the GPP. Can these delays in the GPP be related to the code running on the GPP being swapped out by Linux? Questions:
1) We see that the DSP seems to "send an interrupt" to the GPP with a call to DSPLink's HAL_intSend(). Is the callback on the GPP being called from code running in the context of an interrupt handler on the GPP?
2) The code that calls the callback simply calls through a function pointer to the callback function which is coded in our GPP source code and which is running on embedded Linux on the MityDSP-L138F board. Linux sometimes swaps executing code out. We see the buffer overwrite error approximately once an hour. Is it possible that the callback is sometimes being swapped out, so that it has to be swapped back in when the callback function is called, and something in the OS occasionally causes long delays in the swapping process? Is it possible to prevent the callback and library code from ever being swapped out? Is there some other possible cause of the delays in callback execution on the GPP?
3) Approximately 210,000 bytes of data is being sent from the DSP to the GPP per second, in 6K buffers allocated in shared memory (shared between DSP and GPP). We use only two buffers (ping-pong fashion) to send the data to the GPP. We can increase the number of shared memory buffers the DSP writes its data to increase the time after which an overwrite would occur, but DSP/GPP shared memory is limited. Given the problem described, is there an alternative solution that would prevent buffer overwrites by the DSP code?