1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3 <HEAD> 4 <META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5 <title>SNDEX_SetDSPMixRateAsync</title> 6 <link rel="stylesheet" href="../../css/nitro.css" type="text/css"> 7 </HEAD> 8 <BODY> 9 <H1>SNDEX_SetDSPMixRateAsync <IMG src="../../image/TWL.gif" width="24" height="12" border="0" align=middle></H1> 10 11 <H2>Syntax</H2> 12 <DL> 13 <DD><CODE>#include <twl/snd.h></CODE></DD> 14 <DD><PRE><CODE>SNDEXResult SNDEX_SetDSPMixRateAsync( u8 rate, <A href="SNDEXCallback.html">SNDEXCallback</A> callback, void* arg );</CODE></PRE></DD> 15 </DL> 16 17 <H2>Arguments</H2> 18 <TABLE> 19 <TBODY> 20 <TR> 21 <TH width="25%"><SPAN class="argument">rate</SPAN></TH> 22 <TD width="75%">Rate at which to mix CPU and DSP audio output. The specifiable range is described <A href="SNDEX_SetDSPMixRateAsync.html#Range">below</A>.</TD> 23 </TR> 24 <TR> 25 <TH width="25%"><SPAN class="argument">callback</SPAN></TH> 26 <TD width="75%"><A href="SNDEXCallback.html"><CODE>SNDEXCallback</CODE></A>-type function that is notified when the asynchronous process has completed. The asynchronous process runs even if <CODE>NULL</CODE> is specified here, but you are no longer able to detect that it has completed.</TD> 27 </TR> 28 <TR> 29 <TH width="25%"><SPAN class="argument">arg</SPAN></TH> 30 <TD width="75%">Argument to pass to the function specified in <SPAN class="argument">callback</SPAN>.</TD> 31 </TR> 32 </TBODY> 33 </TABLE> 34 35 <H2>Return Values</H2> 36 <H3>Function Return Values</H3> 37 <TABLE> 38 <TBODY> 39 <TR> 40 <TH width="25%"><CODE>SNDEX_RESULT_SUCCESS</CODE></TH> 41 <TD width="75%">Asynchronous processing started successfully. The asynchronous processing results will be passed as an argument to the function registered in <SPAN class="argument">callback</SPAN>.</TD> 42 </TR> 43 <TR> 44 <TH width="25%"><CODE>SNDEX_RESULT_ILLEGAL_STATE</CODE></TH> 45 <TD width="75%">This function has been called on the NITRO platform.</TD> 46 </TR> 47 <TR> 48 <TH width="25%"><CODE>SNDEX_RESULT_INVALID_PARAM</CODE></TH> 49 <TD width="75%">A value outside the specifiable range is given for <SPAN class="argument">rate</SPAN>.</TD> 50 </TR> 51 <TR> 52 <TH width="25%"><CODE>SNDEX_RESULT_BEFORE_INIT</CODE></TH> 53 <TD width="75%">Extended sound features have not been initialized by the <A href="SNDEX_Init.html"><CODE>SNDEX_Init</CODE></A> function.</TD> 54 </TR> 55 <TR> 56 <TH width="25%"><CODE>SNDEX_RESULT_EXCLUSIVE</CODE></TH> 57 <TD width="75%">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.<BR>As mentioned in the <A href="./doc/aboutSNDEX.html">SNDEX Library Overview</A>, the error also returns during processing of shutter sound playback.</TD> 58 </TR> 59 <TR> 60 <TH width="25%"><CODE>SNDEX_RESULT_PXI_SEND_ERROR</CODE></TH> 61 <TD width="75%">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.</TD> 62 </TR> 63 </TBODY> 64 </TABLE> 65 <H3>Asynchronous Process Results</H3> 66 <TABLE> 67 <TBODY> 68 <TR> 69 <TH width="25%"><CODE>SNDEX_RESULT_SUCCESS</CODE></TH> 70 <TD width="75%">The whole series of operations completed successfully.</TD> 71 </TR> 72 <TR> 73 <TH width="25%"><CODE>SNDEX_RESULT_EXCLUSIVE</CODE></TH> 74 <TD width="75%">A mutex error occurred in the ARM7. This error depends upon the progress of ARM7 processing, so conditions may improve when a retry is made.</TD> 75 </TR> 76 <TR> 77 <TH width="25%"><CODE>SNDEX_RESULT_FATAL_ERROR</CODE></TH> 78 <TD width="75%">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. 79 </TD> 80 </TR> 81 </TBODY> 82 </TABLE> 83 84 <H2>Description</H2> 85 <P> 86 Asynchronously changes the rate at which CPU and DSP audio output is mixed. The mixing rate is set to 8 by default. 87 </P> 88 <A Name="Range"></A> 89 <TABLE> 90 <TBODY> 91 <TR> 92 <TH width="25%">0</TH> 93 <TD width="75%">CPU 0%, DSP 100%</TD> 94 </TR> 95 <TR> 96 <TH width="25%">1</TH> 97 <TD width="75%">CPU 12.5%, DSP 87.5%</TD> 98 </TR> 99 <TR> 100 <TH width="25%">2</TH> 101 <TD width="75%">CPU 25%, DSP 75%</TD> 102 </TR> 103 <TR> 104 <TH width="25%">3</TH> 105 <TD width="75%">CPU 37.5%, DSP 62.5%</TD> 106 </TR> 107 <TR> 108 <TH width="25%">4</TH> 109 <TD width="75%">CPU 50%, DSP 50%</TD> 110 </TR> 111 <TR> 112 <TH width="25%">5</TH> 113 <TD width="75%">CPU 62.5%, DSP 37.5%</TD> 114 </TR> 115 <TR> 116 <TH width="25%">6</TH> 117 <TD width="75%">CPU 75%, DSP 25%</TD> 118 </TR> 119 <TR> 120 <TH width="25%">7</TH> 121 <TD width="75%">CPU 87.5%, DSP 12.5%</TD> 122 </TR> 123 <TR> 124 <TH width="25%">8</TH> 125 <TD width="75%">CPU 100%, DSP 0%</TD> 126 </TR> 127 </TBODY> 128 </TABLE> 129 <P> 130 If this function does not return a value of <CODE>SNDEX_RESULT_SUCCESS</CODE>, the asynchronous processing and callback do not run. Also note that a PXI receive interrupt sends notification when the asynchronous processing is complete, so callbacks do not occur if PXI receive interrupts are prohibited. 131 </P> 132 133 <H2>See Also</H2> 134 <P> 135 <A href="SNDEX_SetDSPMixRate.html"><CODE>SNDEX_SetDSPMixRate</CODE></A><BR> <A href="SNDEX_GetDSPMixRateAsync.html"><CODE>SNDEX_GetDSPMixRateAsync</CODE></A> 136 </P> 137 138 <H2>Revision History</H2> 139 <P> 1402008/11/07 Added mention that <CODE>SNDEX_RESULT_EXCLUSIVE </CODE> is returned during processing of shutter sound playback.<BR> 2008/11/06 Corrected <B>Asynchronous Process Results</B> (<CODE>SNDEX_RESULT_EXCLUSIVE</CODE>) in <B>Return Values</B>.<BR> 2008/02/22 Corrected default value of mixing rate.<BR> 2008/10/27 Initial version. 141 </P> 142 <hr><p>CONFIDENTIAL</p></body> 143</HTML> 144