AXRegisterExceedCallback

Syntax

#include <cafe/ax.h>

typedef void (*AXExceedCallback)(u32 cycles);

void AXRegisterExceedCallback(AXExceedCallback callback);

Parameters

callback Callback to be registered.

Return Values

None.

Description

The 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.

NOTE:
This callback will only be called when DSP rendering does not complete within a single audio frame. Common AX post-rendering processing (such as Final Mix callback and Virtual Surround) will happen after DSP rendering completes. In the case that DSP rendering completes within an audio frame but post-rendering processing does not, the exceed callback will NOT be called.

Availability

Library Version Availability
Sound 2.0 Yes
Sound 1.0 Yes

Do Not Call From

None.

See Also

Load Balance Overview

Revision History

2013/05/08 Automated cleanup pass.
2012/08/01 Cleanup Pass.
2006/10/23 Initial version.


CONFIDENTIAL