This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BIOSPSP audio example for C674x

Expert 1215 points

Hi,

The audio example given in the C674x BIOSPSP package would stop running if the audio processing between SIO Rx and Tx takes too long. I think a better handling of this situation would be to skip the a few audio frames but without breaking anything. Any advice how to do that?

Thanks

 

  • Hi Yan

    By "Stop running" - kindly explain what do you intend. Once it "stops" how did you recover?

    Let us know if any modification was done to the example code - except adding a delay between reclaim of Rx /TX and issue of Rx/Tx.

    Audio driver will always be alive (after SIO create calls) and respond SIO issue and recliam at any time.

    regards

    Vichu

     

  • Hi,

    "Stop running" means the audio loop will break, and the program just to somewhere that is not recoverable. It happened with the audio example from the EVM6747, I don't think I touched anything except adding an audio processing block.

    It is an easy experiment for you to do. Insert some heavy stuff between SIO issue and reclaim. Increasingly insert more and it will happen fairly soon.

    Thanks

  • Hi Yan

    I have inserted 5sec delay between Reclaim and Issue (please see the code snippet below).

    System still was live and captured audio could be monitored as short piece (1 IOP length) once in 5 secs. It tested for 15mins. Do you want me check this for more time?

    This confirms the delay between reclaim and issue is not the reason for out of control and probably the programming done between these two has some thing to do.

    regards

    Vichu

    ---snippet from audioSample_io.c----------

     /* Forever loop to continously receviec and transmit audio data           */
        for (i32Count = 0; i32Count >= 0; i32Count++)
        {
            nmadus = SIO_reclaim(inStream, (Ptr *)&rcv, NULL);
           
            /* Reclaim full buffer from the input stream */
            if (nmadus < 0)
            {
                LOG_printf(&trace,"\r\nError reclaiming full buffer from the input stream\n");
            }

            /* Reclaim empty buffer from the output stream to be reused */
            nmadus = SIO_reclaim(outStream, (Ptr *)&xmt, NULL);
            if (nmadus < 0)
            {
                LOG_printf(&trace,"\r\nError reclaiming empty buffer from the output stream\n");
            }

      TSK_sleep(5000);

            /* copy the receive information to the transmit buffer                */
            memcpy(xmt,rcv,BUFSIZE * RX_NUM_SERIALIZER);

            /* Issue full buffer to the output stream    */
            if (SIO_issue(outStream, xmt, BUFSIZE * TX_NUM_SERIALIZER, NULL)
         != SYS_OK)
            {
                LOG_printf(&trace,"\r\nFailed to issue empty buffer to stream\n");
            }

            /* Issue an empty buffer to the input stream */
            if (SIO_issue(inStream, rcv, BUFSIZE * RX_NUM_SERIALIZER, NULL)
         != SYS_OK)
            {
                LOG_printf(&trace,"\r\nFailed to issue empty buffer to stream\n");
            }
        }