Dear Speex Devs,<br><br>One more problem from my side. I had earlier queried about bad quality of speex.<br><br>For this run, I changed the memory mode option in CCStudio to none from large. (I will explain this if required.)<br>
Now, I am trying to run speex on C55x in real time.<br><br>Find a code snippet from my main function below.<br><br>Basically, I am getting the error mentioned in the subject line.<br>Weird thing is that, for the statements marked in bold below, if I enable printf, I don&#39;t get this error, whereas if I disable it, Speex complains with this error.<br>
Is it because of the delay required?<br><br>By having a look at the code, and the code structure which I have mentioned in the code itself, can you throw some insight?<br>Also why should this error occur at first place? I searched the forum but could not find the exact solution.<br>
<br>Awaiting reply.<br><br>Vijay<br><br><br>            if(canEncode == 1)  
//sets to 1 when DMA is ready with 20ms samples with 8khz sampling<br>            {                 <br>                canEncode = 0;
<br>                 <br>                if(busyEncoding == 0) 
// to guard encoding and decoding <br>                {
<br>                    busyEncoding = 1;
<br>                     <br>                    //copy 20ms data (160 is the frame size) to encode<br><br>                    for(i_loop = 0; i_loop &lt; FRAME_SIZE; i_loop++)
<br>                    {
<br>                        if(CurrentRxR_DMAChannel == 2)
<br>                        {
<br>                            inout_byte[2*i_loop] = RcvL1[i_loop];
<br>                            inout_byte[2*i_loop+1] = RcvR1[i_loop];             <br>                        }
<br>                        else
<br>                        {
<br>                            inout_byte[2*i_loop] = RcvL2[i_loop];
<br>                            inout_byte[2*i_loop+1] = RcvR2[i_loop];                     <br>                        }         <br>                    }
<br>                    byte2word(inout_byte, in_short, FRAME_SIZE);
<br>                    speex_bits_reset(&amp;bits); 
<br>                    returnVal = speex_encode_int(encoderState, (spx_int16_t *) in_short, &amp;bits);
<br>                     <br>                     <br>                    nbChars = speex_bits_write(&amp;bits, cbits, sizeof(cbits)*BYTES_PER_CHAR) /BYTES_PER_CHAR; 
<br>                    speex_bits_rewind(&amp;bits);                             <br>                     <br>                    speex_bits_read_from(&amp;bits, cbits, TESTENC_BYTES_PER_FRAME);
<br>                     <br><b><font size="4">                    //printf(&quot;%d\n&quot;,counterDecode++);
<br>                    counterDecode++;
</font></b><br>                     <br>                    returnVal = speex_decode_int(decoderState, &amp;bits, (spx_int16_t *)out_short);
<br>                     <br>                    if(returnVal != 0)
<br>                    {
<br>                        printf(&quot;speex decode int falied %d %d&quot;, returnVal, counterDecode);
<br>                        exit(0);
<br>                    }
<br>                     <br>                    speex_bits_reset(&amp;bits);
<br>                    skip_group_delay = 0;
<br>                     <br>                    busyEncoding = 0;
<br>                    //printf(&quot;encode-decode complete\n&quot;);
<br>                     
<br>                    //copy decode data to playback through DMA<br><br>                    for(i_loop = 0; i_loop &lt; FRAME_SIZE; i_loop++)
<br>                    {
<br>                        if(CurrentTxR_DMAChannel == 1)
<br>                        {
<br>                             XmitL1[i_loop] = out_short[2*i_loop]; 
<br>                        }
<br>                        else
<br>                        {
<br>                            XmitL2[i_loop] = out_short[2*i_loop]; 
<br>                        }     
<br>                    }       
<br> <br>                    for(i_loop = 0; i_loop &lt; FRAME_SIZE; i_loop++)
<br>                    {
<br>                        if(CurrentTxR_DMAChannel == 1)
<br>                        {
<br>                            XmitR1[i_loop] = out_short[2*i_loop + 1];
<br>                        }
<br>                        else
<br>                        {
<br>                            XmitR2[i_loop] = out_short[2*i_loop + 1];
<br>                        }     
<br>                    }
<br>    
<br>                                                                 <br>                     busyEncoding = 0;    
<br>                      <br>                }
<br>                else
<br>                {
<br>                    //printf(&quot;encoder called when busy\n&quot;);
<br>                }     <br>            }
<br><br><br>