#include <cafe/ax.h> typedef void (*AXExceedCallback)(u32 cycles); void AXRegisterExceedCallback(AXExceedCallback callback);
|callback||Callback to be registered.|
AXRegisterExceedCallback function registers the
callback when the DSP audio process does not complete within the
3 ms audio frame.
The AX library controls the DSP load dynamically so that the DSP audio process finishes within a single audio frame. However, in an application, complex memory access requests from multiple devices may cause latency in memory access, resulting in a longer DSP processing time, compared to the DSP load estimate of AX.
When there is large number of simultaneously played voices and the DSP processing time is longer than the AX forecast, the processing may not complete within a single audio frame. This, in turn, may result in noise in the playback sound.
The callback registered through this function will be called when there is a chance of such noise.
Check the DSP processing time using this function when a noise is observed in the playback.
It is critical that you perform the absolute minimum processing in the exceed callback function. Recommended is at most to maintain an atomic counter and/or signal an OS synchronization function. Do NOT call any other SDK APIs from your callback.
The callback argument is 0 when the AI DMA interrupt occurs before the DSP was ready. The argument is nonzero when the DSP does complete and detects that the AI DMA interrupt preceded it.
2013/05/08 Automated cleanup pass.
2012/08/01 Cleanup Pass.
2006/10/23 Initial version.