SNDEX_GetDSPMixRate

Syntax

#include <twl/snd.h>
SNDEXResult SNDEX_GetDSPMixRate( u8* rate );

Arguments

rate Pointer to the variable that gets the rate at which CPU and DSP audio output is mixed.

Return Values

SNDEX_RESULT_SUCCESS The whole series of operations completed successfully.
SNDEX_RESULT_ILLEGAL_STATE This function has been called on the NITRO platform or from an exception handler.
SNDEX_RESULT_BEFORE_INIT Extended sound features have not been initialized by the SNDEX_Init function.
SNDEX_RESULT_EXCLUSIVE Processing for other extended sound features is running. Note that mutexes are used for each of the extended sound features, so they cannot be used simultaneously.
This is also returned when a mutex error occurred in the ARM7. When this is the case, the situation may improve on a retry because the error is dependent on the progress of processing in ARM7.
As mentioned in the SNDEX Library Overview, the error also returns during processing of shutter sound playback.
SNDEX_RESULT_PXI_SEND_ERROR A PXI command failed to be sent to the ARM7. This error occurs when the PXI send queue for the ARM7 has filled up, or when the hardware has detected an error. As a result, the state may improve when a retry is made.
SNDEX_RESULT_FATAL_ERROR This error should not ordinarily occur. This may occur when an illegal PXI command was sent directly, ignoring library state management; when the ARM7 component and the extended sound feature library have different versions; when library state management has fallen into an abnormal state due to memory corruption; or when other such conditions arise. There is no way to recover from this at run time.

Description

Synchronously gets the rate at which CPU and DSP audio output is mixed. The mixing ratio is a value from 0 to 8.

0 CPU 0%, DSP 100%
1 CPU 12.5%, DSP 87.5%
2 CPU 25%, DSP 75%
3 CPU 37.5%, DSP 62.5%
4 CPU 50%, DSP 50%
5 CPU 62.5%, DSP 37.5%
6 CPU 75%, DSP 25%
7 CPU 87.5%, DSP 12.5%
8 CPU 100%, DSP 0%

This function calls the SNDEX_GetDSPMixRateAsync function internally and stops its own calling thread until asynchronous processing has completed. This function expects to be called from a thread, so it fails if it is called from an exception handler. Note that this function continues to block internally if PXI receive interrupts are prohibited, because PXI receive interrupts are used to detect the processing's completion.

See Also

SNDEX_GetDSPMixRateAsync
SNDEX_SetDSPMixRate

Revision History

2008/11/07 Added mention that SNDEX_RESULT_EXCLUSIVE is returned during processing of shutter sound playback.
2008/02/15 Initial version.


CONFIDENTIAL