My partner and I are trying to use the ezdspC5535 as an audio effects processor intended for use by musical instruments for our senior project in electrical engineering at the University of Vermont. We want to use this device for real-time playback of effected audio signals. We would like to input the signals through the stereo input jack J3 and output them through the stereo output jack J4. Upon reviewing the documentation associated with the connected audio framework we have come to understand that for real-time playback of audio the signals go through the micro USB port J1. We want to know if it is possible to change the path from which we input signals for real-time playback. Ultimately we want to insert our own filter algorithms into the playback path, but we would like our input to be directly from the instrument itself via an 1/8th inch jack not the USB.
Any advice or help would be greatly appreciated.
Mike & Mike
Hi Mike & Mike,
If I2C works for one but not both, you might be running out of clock cycles to complete all processing with enough headroom to read and write from the I2S registers at 48KHz.
Try to increase the PLL frequency.
/* Initialize PLL */ pll_frequency_setup(60); // can go up to 120 MHz
Measure the frequency of your foreground while loop to see that it matches the sampling frequency of the codec (48KHz probably)
You can probe XF pin with an O-scope, and use bset and bclr to toggle it. (see code below)
If the while loop frequency is below 48KHz, then you are dropping samples from I2S, which would cause audio distortion.
I have been able to reproduce audio distortion due to missed samples at various PLL frequencies with enough "processing delay" (for loop of NOPs)
while(1) { //insert "processing delay" for(j=0;j<1000;j++) { asm(" nop"); } //XF on at beginning of codec read asm(" bset XF"); aic3204_codec_read(&left_input, &right_input); // Configured for one interrupt per two channels. aic3204_codec_write(left_input, right_input); //XF off at end of codec write //Freq of XF should be 48KHz if enouch cycles are provided to complete "processing" delay and poll I2S in time to avoid missing samples asm(" bclr XF"); }
Hope this helps,Mark
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.
Also see our C5000 Wiki---------------------------------------------------------------------------------------------------------
where is the xf pin?
thanks
We have attempted to change the PLL clock, but it appears we need it to be even faster than the maximum value. We also attempted to change the i2c clock to be faster aswell, and have heard some promising results but nothing near what the audio should sound like. Any help you can provide would be great. We have been working on this issue for awhile and are just stumped.
Thanks again,
michael swansonwhere is the xf pin?
You can probe the XF pin where it connects to the XF LED next to the mini-USB connector on the C5535 eZdsp.
With the software written to poll the I2S registers audio samples are ready, you should see that the loop executes with a frequency of 48KHz.
There are more efficient ways than polling to read audio samples - interrupt when I2S registers are filled, DMA to copy blocks of I2S samples at a time, even DSP/BIOS RTOS to switch between multiple tasks...
You might also study Chapter 18 - Assembly language - the PPT Slide 10 for this chapter (Sampling Rate 48000 Hz) has some good info and instructions for profiling your software.
Are you able to use an oscilloscope and toggle the XF pin to see where your software is spending all of its time?
Does your software read from the mTouch every loop iteration?
Regards,Mark
Hello Mike,
I have been trying to get the ROM Port working but I'm still having issues. I have followed the wiki page to the t and have been searching all over the forums but haven't seen anything relating to the problem I'm experiencing.
When trying to compile FIR chapter 6 for example, the code compiles (using the adapted files for porting) however when I go to debug and run the program it is stuck at the pll_frequency_setup() function and it never reaches the rest of the lab. All I'm getting on the display is:
PLL frequency 100 MHzREGISTER --- CONFIG VALUES
but nothing further. I've let it sit for minutes at a time but I'm pretty sure it is not supposed to take this long for initialization. Any help would be greatly appreciated!
Cheers,
Andrew