Hi everyone,
I am aiming to use the EZDSP5535 to process audio and write the data to the SD card. Right now as a test, I am performing an audio loopback operation (16bit @ 44.1KHz) while 1024 word-samples of data are written on to the SD card each time through TI's ATAFS. However it seems like the audio write time is taking a long time, thus loopback is missing samples? (very serious as it's audible). These operations are all done in a task in DSP/BIOS as shown below. Any suggestions/ideas are greatly appreciated!
task { ata_error = ATA_fopen(pAtaFile, "rec", "wav"); if(ata_error != ATA_ERROR_NONE) printf("ATA_fopen Failed %d\n", ata_error); else printf("\nFile Creation/Open on SD card is Successful\n"); // issue in and out buffers before reclaim for(i=0; i<NUM_OUT_BUFS; i++) { SIO_issue(hStreamIn, &audBufsIn[i][0], WORDS_PER_OUT_BUF, NULL); SIO_issue(hStreamOut, &audBufsOut[i][0], WORDS_PER_OUT_BUF, NULL); } // simple way to set audio recording time for(btr=0;btr<WORDS_PER_OUT_BUF*5;btr++) { //get an empty audio buffer, blocking until buffer a/v SIO_reclaim(hStreamIn, (void**)&inBuf, NULL); SIO_reclaim(hStreamOut, (void**)&outBuf, NULL); // copy audio input data to output stream for (i = 0; i < WORDS_PER_OUT_BUF; i++) { outBuf[i] = inBuf[i]; } SIO_issue(hStreamOut, outBuf, WORDS_PER_OUT_BUF, NULL); SIO_issue(hStreamIn, inBuf, WORDS_PER_OUT_BUF, NULL); // byte swap sample, as MMC_setEndianMode() to big endian doesn't seem to work for (i = 0; i < WORDS_PER_OUT_BUF; i++) { outBuf[i] = (outBuf[i]<<8) | ((outBuf[i]>>8)&0x00FF); } ata_error = ATA_write(pAtaFile, outBuf, WORDS_PER_OUT_BUF); if(ata_error != ATA_ERROR_NONE) printf("ATA_write Failed %d \n", ata_error); } ata_error = ATA_close(pAtaFile); if(ata_error) printf("ATA_close Failed\n"); }