AnsweredAssumed Answered

AD1836 codec in ADSP-BF533 EZkit

Question asked by mbalan on Mar 4, 2011
Latest reply on Mar 10, 2011 by CraigG
I am currently working with the ADSP-BF533 EZ-KIT board. More specifically I am working on the File-In Audio-Out demo project that comes along with VisualDSP++ Development package. This project is found in the following directory:
Analog Devices/SoftwareModules/MPEG-4_HE-AAC_v2_Decoder-BF Rel5.3.3_EVAL/demo/audio/MediaDevice/ADSP-BF533-AD1836/ADSP-BF533-AD1836.dpj
The manual for this project is:
File-In Audio-Out Demostration for BLACKFIN/SHARC EZ-kit (KT-45, Rev 2.12)
The demo project makes use of a USB-LAN EZ-Extender daughter card to stream audio data from the PC. What I am trying to do is to skip the USB and play the audio file directly from the audio codec AD1836. I followed the same procedure as in the demo project by reading MPEG4 files from a .txt file, but I am not able to stream the data. I am not getting any errors or warnings when I compile and run the program. The program stops at one point displaying 
"Configure the Codec Sampling Rate to: 48000 Hz"
I am able to decode the file and store it in the FIFO buffer , but the codec somehow does not enable streaming. A small snippet of the code to enable the codec dataflow is shown below.
if (!audio_codec_configured)
                printf("Sampling Rate : %d Hz\n",sampleRate);
                if ((EnableCodecDataflow(&sampleRate)) != 0)
                    printf("Unable to configure CODEC to %d Hz sampling rate\n", sampleRate);
                    return CODEC_ALGORITHM_ERROR;
                audio_codec_configured = 1;
                printf("Codec configured\n");
And the point marked with an arrow is where the program halts:
int EnableCodecDataflow(int *SamplingRate)
    int Result = ADI_DEV_RESULT_SUCCESS;
    int i = 0;
    int deltaSR = 0xffff;
    int minId = 0;
    // Check if the sampling rate is supported. If not, then configure
    // the audio codec to the closest sampling rate
    for (i = 0;i<(sizeof(SupportedSR)/sizeof(SupportedSR[0]));i++) {
        if (deltaSR > abs(*SamplingRate - SupportedSR[i])){
              deltaSR = abs(*SamplingRate - SupportedSR[i]);
              minId = i;
    *SamplingRate = SupportedSR[minId];
    printf("\nConfigure the Codec Sampling Rate to: %d Hz\n", *SamplingRate);
    /* Disable codec dataflow */
    Result = DisableCodecDataflow();   <-----------------
    printf("Codec dataflow disabled\n");
After doing some research, I found out that the problem is with the adi_dev_control function. When the compiler reaches this point it stops. In order to make sure that the handler is initialized before giving control operations, I used the installaudiodriver() function before EnableCodecDataflow. This in-turn calls the adi_dev_open() function which initializes the handler. But still I am not able to proceed further from this point.
So could someone explain what the problem might be and how I should go about configuring the codec. I have attached a copy of the main source code.
Thanks in advance, your help is appreciated