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.

DA830 Multichannel Audio Application using BIOS PSP

Other Parts Discussed in Thread: PCM1802

Hi all,

   I am planning to develop a 7.1 channel audio application in DA830 EVM. For this I am going to use BIOS PSP audio driver.

When I checked the audio sample application for DA830, in the driver packages, I found that its support only stereo channels. How can I configure the audio sample application to support 7.1 channels (ie configurations for Mcasp serializer, buffer format etc). 

I am not sure whether  Its the correct place for post this question. If not please move this post to appropriate forum.

Please help me. Any suggestions will be appreciated :)

Thanks in advance,

- paul.

  • Paul Isaac,

    Paul Isaac said:
     I am planning to develop a 7.1 channel audio application in DA830 EVM. For this I am going to use BIOS PSP audio driver.

    I guess, you are referring to BIOSPSP 1.30.01, am i right?

     

    Paul Isaac said:

    When I checked the audio sample application for DA830, in the driver packages, I found that its support only stereo channels. How can I configure the audio sample application to support 7.1 channels (ie configurations for Mcasp serializer, buffer format etc). 

    Since the DA830EVM has codec which supports only I2S mode, we have provided example for it.

    You can configure the mcasp serializers (i.e number of serializer, its number etc), number of channels and the buffer format in the application configuration "Mcasp_ChanParams".

    If you are using the single serializer and multi-channel then use buffer format "Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED".

    If you are using the multiple serializer then use the buffer format either "Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1" or "Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_2".

    Please go through the userguide "C6747_BIOSPSP_Userguide.pdf" chapter 9 for details.

    Paul Isaac said:

    I am not sure whether  Its the correct place for post this question. If not please move this post to appropriate forum.

    If you are using the BIOSPSP (driver package based on DSP/BIOS), then this is the right forum.

    Regards,

    Sandeep K

  • Hi Sandeep,

       Thanks for your reply.

     Currently I am using BIOSPSP 1.30.01. Using that psp, I developed a stereo application for OMAP L138, and it working fine.

    Now my requirement is, develop an application which support 7.1 channel audio capturing and 7.1 channel playback. Thats why I am going to use DA830. But now I realized that, the DA830 EVM has only stereo codec(AIC3106) and the 8 channel support is with its Audio Support board.

    How can I use the BIOSPSP audio sample application with the Audio support board's codec(AK4588 combo Codec) ?

    -regards

    paul

  • Paul,

    Paul Isaac said:

    How can I use the BIOSPSP audio sample application with the Audio support board's codec(AK4588 combo Codec) ?

    You can configure the mcasp serializers (i.e number of serializer, its number etc), number of channels and the buffer format in the application configuration "Mcasp_ChanParams".

    If you are using the single serializer and multi-channel then use buffer format "Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED".

    If you are using the multiple serializer then use the buffer format either "Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1" or "Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_2".

    Please go through the userguide "C6747_BIOSPSP_Userguide.pdf" chapter 9 for details.

    Regards,

    Sandeep K

  • Hi Sandeep,

       I will definitely try with your suggestions, and let you know what I am getting. I think It will take one more week, why because, the purchasing process of DA830 EVM is still in progress. 

    I think my previous post made some confusion for you. Sorry for that.

    I will try to clear it. In DA830 EVM base board, there is a stereo codec(ADC/DAC) ie AIC3106. I can use it for giving stereo input. Since I need 8 channel support I have to use DA830 EVM's audio support board. The codec in its AK4588 combo Codec. My question is, If I connect the audio support board to the base board and run the audio sample application, whether it will configure and run the AIC3106 Stereo Codec or AK4588 combo Codec ?

    Please clear this point.

    -regards,

    paul

  • Paul,

    Paul Isaac said:
    My question is, If I connect the audio support board to the base board and run the audio sample application, whether it will configure and run the AIC3106 Stereo Codec or AK4588 combo Codec ?

    The sample application will configure the AIC3106 stereo code. 

    To have the AK4588 combo codec working, you might have to write a driver for it and then use it. You can also modify the existing codec driver available in the PSP and then use it. For all the codec configurations you need to find out and specify the codec I2C slave address.

    Regards,

    Sandeep K

  • Hi Sandeep,

      Is there any driver support for the Multichannel Audio Expansion board from TI ?

    - regards

    paul.

  • Hi Paul,

    There is no BIOS PSP drivers to support Audio Expansion board.

    Regards,

    Sandeep K

  • Paul,

    Please search the forum.  I and a few others have successfully used the multichannel audio I/O board with the C6747 (same DSP as a DA830).

    Fawad


  • Hi Fawad,
    Thanks for your reply. I had gone through your posts in this community. Now I modified the PSP sample program for the multichannel audio board.
    These are the changes I made in the psp program.
    1. Rebuild the Audio interface driver and removed Aic31 codec configuration part.
    2. From 'audioSample.tci' , removed the static initialization of codec(Aic31).
    3. Added the functions 'DSKDA830_init()(initializing bsl for audio support board)' , and ak4588 initialization and configuration functions in main.
    4. Modified values for mcaspRcvSetup,mcaspXmtSetup and mcasp_chanparam.

    Now I am not going with all the 8 serialisers as in the audio board test code. So I am using 2 of the serialiser for input and output and "Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED" format.

    These are the configurations that I did,
    Mcasp_HwSetupData mcaspRcvSetup = {
    /* .rmask = */ 0xFFFFFFFF, /* All the data bits are to be used */
    /* .rfmt = */ 0x00018070, /*0x000080F0,*/ /*
    * 1 bit delay from framsync
    * MSB first
    * No extra bit padding
    * Padding bit (ignore)
    * slot Size is 32
    * Reads from DMA port
    * NO rotation
    */
    /* .afsrctl = */ 0x00000112,/*0x00000000,*//* 2slot TDM,
    * Frame sync is one word
    * Rising edge is start of frame
    * internally generated frame sync
    */
    /* .rtdm = */ 0x00000003,/*0x00000001,*/ /* Slots 0,1 */
    /* .rintctl = */ 0x00000003,/* sync error and overrun error */
    /* .rstat = */ 0x000001FF, /* reset any existing status bits */
    /* .revtctl = */ 0x00000000, /* DMA request is enabled or disabled */
    {
    /* .aclkrctl = */ 0x000000A3,/*0x00000000,*/ /* Rising INTRERNAL CLK, div-by-4 */
    /* .ahclkrctl = */ 0x00000000, /* EXTERNAL CLK */
    /* .rclkchk = */ 0x00FF0008/*0x00000000*/ /* 255-MAX 0-MIN, div-by-256 */
    }
    } ;

    Mcasp_HwSetupData mcaspXmtSetup = {
    /* .xmask = */ 0xFFFFFFFF, /* All the data bits are to be used */
    /* .xfmt = */ 0x00018070,/*0x000080F0,*/ /*
    * 1 bit delay from framsync
    * MSB first
    * No extra bit padding
    * Padding bit (ignore)
    * slot Size is 32
    * Reads from DMA port
    * NO rotation
    */
    /* .afsxctl = */ 0x00000112,/*0x00000000,*/ /* 2slot TDM,
    * Frame sync is one word
    * Rising edge is start of frame
    * internally generated frame sync
    */
    /* .xtdm = */ 0x00000003,/*0x00000001,*/ /* Slots 0,1 */
    /* .xintctl = */ 0x00000007, /* sync error,overrun error,clK error */
    /* .xstat = */ 0x000001FF, /* reset any existing status bits */
    /* .xevtctl = */ 0x00000000, /* DMA request is enabled or disabled */
    {
    /* .aclkxctl = */ 0x000000E3,/*0x00000000,*//* ASYNC, Rising INTERNAL CLK, div-by-4 */
    /* .ahclkxctl = */ 0x00000000, /* EXTERNAL CLK */
    /* .xclkchk = */ 0x00FF0008/*0x00000000*/ /* 255-MAX 0-MIN, div-by-256 */
    },

    };


    /* McBsp channel parameters */
    Mcasp_ChanParams mcasp_chanparam[Audio_NUM_CHANS]=
    {
    {
    0x0001, /* number of serialisers */
    {Mcasp_SerializerNum_0,}, /* serialiser index */
    &mcaspRcvSetup,
    TRUE,
    Mcasp_OpMode_TDM, /* Mode (TDM/DIT) */
    Mcasp_WordLength_16,/*Mcasp_WordLength_16,*/
    NULL,
    0,
    NULL,
    NULL,
    2,/*1,*/ /* number of TDM channels */
    Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,/*Mcasp_BufferFormat_1SER_1SLOT,*/
    TRUE,
    TRUE
    },
    {
    0x0001, /* number of serialisers */
    {Mcasp_SerializerNum_5,},
    &mcaspXmtSetup,
    TRUE,
    Mcasp_OpMode_TDM,
    Mcasp_WordLength_16,/*Mcasp_WordLength_16,*/ /* word width */
    NULL,
    0,
    NULL,
    NULL,
    2,/*1,*/ /* number of TDM channels */
    Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,/*Mcasp_BufferFormat_1SER_1SLOT,*/
    TRUE,
    TRUE
    }
    };

    But this code is not working. When I checked the reclaimed buffer from input stream, its all zeros. I found that, I didn't mapped the serialiser data pins with the input and output pins of ak5588 dac and stereo adc's. How can I do this and where..?, and also whether the above configurations are sufficient for enabling the multichannel audio support board?
    Please help me. Thanks in advance.

  • Paul,

    I see some issues in your setup.  Here are my McASP channel parameters:  I get 32-bit audio instead of 16.

    /* McBsp channel parameters                                  */
    Mcasp_ChanParams  mcasp_chanparam[Audio_NUM_CHANS]=
    {
        {
            0x4,                    /* number of serialisers  Mcasp_SerializerNum_1,Mcasp_SerializerNum_2,Mcasp_SerializerNum_10,    */
    //        {Mcasp_SerializerNum_0,Mcasp_SerializerNum_1,Mcasp_SerializerNum_2,Mcasp_SerializerNum_10,}, /* serialiser index           */
            {Mcasp_SerializerNum_12,Mcasp_SerializerNum_13,Mcasp_SerializerNum_14,Mcasp_SerializerNum_15,}, /* serialiser index           */
            &mcaspRcvSetup,
            TRUE,
            Mcasp_OpMode_TDM,          /* Mode (TDM/DIT)             */
            Mcasp_WordLength_32,
            NULL,
            0,
            NULL,
            NULL,
            1,                        /* number of TDM channels      */
            Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1, /* ,*/
            TRUE,
            TRUE
        },
        {
            0x4,                    /* number of serialisers  ,Mcasp_SerializerNum_6,Mcasp_SerializerNum_7,Mcasp_SerializerNum_8,     */
            {Mcasp_SerializerNum_5,Mcasp_SerializerNum_6,Mcasp_SerializerNum_7,Mcasp_SerializerNum_8,},
            &mcaspXmtSetup,
            TRUE,
            Mcasp_OpMode_TDM,
            Mcasp_WordLength_32,      /* word width                  */
            NULL,
            0,
            NULL,
            NULL,
            1,                        /* number of TDM channels      */
            Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
            TRUE,
            TRUE
        }
    };

    Regards,

    Fawad

  • Hi Fawad,

       Thanks for your reply. As you suggested, I modified my program. But the problem still exists. The buffer reclaimed from the input stream is still zero.

    But I found that, the output section is working fine. I copied a sine tone into the output buffer, and issued it into output stream. Now I can hear the tone through all the four output jacks of the audio board. I think the problem is with input section, not sure. In my code I didn't do anything to configure the four ADC's. In multichannel board test code also I didn't find any code for that.

    Here I am attaching my code and configuration files. Please take a look into them.

    0474.Multichannel_audioSample.zip

    The McASP serialiser pins and codecs are mapped in the function 'codec_mcasp_ser_mapping()', in file audioSample_io.c. Please check that also. 

    - regards, 

    Paul

  • Paul,

    Can you use a oscilloscope to look the the output of the AKM i2s data pins?  That way you can confirm valid data is being fed to the McASP.

    Fawad

  • Hi Fawad,

      I checked the McASP pins using oscilloscope. These are my findings.

    1. There is no data from pins AXR1[0], AXR1[1], AXR1[1],AXR1[10](Rx pins) and  AXR1[5],AXR1[6],AXR1[7] and AXR1[8](Tx pins). But AHCLKR1,ACLKR1,AFSR1, AHCLKX1,ACLKX1,AFSX1 are clocking.

    2. If I copy sine tone into the output buffer, then I am getting data from AXR1[5],AXR1[6],AXR1[7] and AXR1[8](Tx pins).

    Since I am not getting data from ADC to McASP Rx pins,I think the problem is between PCM1802(ADC) and McASP. I checked MCASP's GBLCTL register value. Its 0x00001F1E, ie receive clock divider is in reset. In the stereo PSP program itself its value is 0x00001F1E. But in the multi channel test application, its 0x00001F1F, means clock divider is active.  

    In one of your previous post I read that, all the I2C activities of codec has to be removed from the driver code. Is it needed at this stage, since my transmitting side is working fine..? 

    -regards 

    paul

  • Paul,

    As the PCM1802 ADCs have no HW control (i2c or SPI) and the AKM part uses SPI control there is no need to have i2c driver enabled.

    You say there is no data on the AXR1[0], AXR1[1], AXR1[1],AXR1[10](Rx pins).  This is driven by the PCM1802 ADC.  So there should always be data on these pins (as noise on the analog input is always there).  So you are right to look at this first.  Look at the bit, word and master clocks on the PCM1802s again to see if they are valid.  word clock should be 48 kHz, bit clocks should be 3.072MHz and master clocks should be 12.288 MHz.

    Also are you initializing the AKM part correctly?  I have this code in main()


         
         ak4588_init();
         ak4588_rset(1,0,0x0C);    // 24-bit I2S mode    // see page 39 of akm4588 data sheet
         ak4588_rset(1,1,0x02);        // auto clock mode    // see page 40 of akm4588 data sheet
        ak4588_rset(1,2,0x0);    // set attenuation to 0 dB
        ak4588_rset(1,9,0x01);    // Take AK4588 DAC out of reset // see page 42 of akm4588 data sheet
        ak4588_rset(0,0,0x4B);    // Double AHCLKX1 frequency
     

    Fawad

  • Hi Fawad,

      I checked the Tx, Rx clocks. I got following values.

    Transmitter Side: Master clock - 9.6MHz, Bitclock- 2.7MHz, Frame clock - 86.9kHz

    Receiver Side     : Master clock - 9.6MHz, Bitclock- 9.6MHz, Frame clock - 344kHz

    In my previous post I mentioned that, the receiver side bit clock divider is in reset mode, that may be the reason for getting same bit clock and master clock in receiver side. Now I am debugging on that part.

    For initializing AKM, I am using the same codes in the audio boars test application, it is

    ak4588_init( );

    ak4588_rset(1,0,0x0C); // 24-bit I2S mode
    ak4588_rset(1,1,0x80);
    ak4588_rset(1,9,0x01); // Take AK4588 DAC out of reset
    ak4588_rset(0,0,0x4B); // Double AHCLKX1 frequency

    I modified it with your code, but the same result. Whether I missed any pinmux configuration for enabling PCM1802..?

    Are you used the same values for 'mcaspRcvSetup' and 'mcaspXmtSetup', that I am using.?

    -regards

    paul

  • Paul,

    It has been a while since I used the multichannel audio board.  Are you using i2s mode at 48 kHz?  If so then the clocks should be as I mentioned i.e. 48khz, 3.072Mhz and 12.288MHz.  I don't think there is anything to setup on the PCM1802.  Please look at the schematics of the multichannel board to conform. But if I remember correctly all 4 of the PCM1802 are in slave mode and get the bit, word and master clocks from the McASP in i2s mode and only send out data.

    There are some differences between my mcaspRcvSetup and mcaspXmtSetup compared to yours:

    In the mcaspRcvSetup:

    /* .rfmt = */ 0x00018070, <-- I uses 32bit data

    .rintctl  = */ 0x00000000,<--- ignore errors

    In mcaspXmtSetup

    xfmt     = */ 0x000180F0, <---- I uses 32-bit data

    xintctl  = */ 0x00000000, <--- ignore errors

    Try this but double the size of your buffers as you will see 32-bit data.

    Look at the gel file to make sure all your appropriate McASP pins are enabled and are not setup as GPIO.

    Also I had left the multichannel audio board Mcasp setup and echo input to output code in main().  I don't exactly remember now why I did it but initially I also could not get audio IO to work.  So my code calls this after the AKM is setup

         //    Initialize MCASP1
        PINMUX11 = PINMUX11 | 0x11100000;  // Set pins for their McASP functions
        mcasp = &MCASP_MODULE_1;           // Choose McASP1


         //McASP is in MASTER mode.        
         //     BCLK & WCLK come from McASP                                 
     
        mcasp->regs->GBLCTL  = 0;       // Reset
        mcasp->regs->RGBLCTL = 0;       // Reset RX
        mcasp->regs->XGBLCTL = 0;       // Reset TX
           mcasp->regs->PWRDEMU = 1;       // Free-running

        // RX
        mcasp->regs->RMASK      = 0xffffffff; // No padding used
        mcasp->regs->RFMT       = 0x000180f8; // MSB 32bit, 1-delay, no pad, CFGBus
        mcasp->regs->AFSRCTL    = 0x00000112; // 2TDM, Rising, INTERNAL FS, word
        mcasp->regs->ACLKRCTL   = 0x000000A3; // Rising INTRERNAL CLK, div-by-4
         mcasp->regs->AHCLKRCTL  = 0x00000000; // EXTERNAL CLK
        mcasp->regs->RTDM       = 0x00000003; // Slots 0,1
        mcasp->regs->RINTCTL    = 0x00000000; // Not used
        mcasp->regs->RCLKCHK    = 0x00FF0008; // 255-MAX 0-MIN, div-by-256

        // TX
       mcasp->regs->XMASK      = 0xffffffff; // No padding used
        mcasp->regs->XFMT       = 0x000180f8; // MSB 32bit, 1-delay, no pad, CFGBus
        mcasp->regs->AFSXCTL    = 0x00000112; // 2TDM, Rising edge INTERNAL FS, word
        mcasp->regs->ACLKXCTL   = 0x000000E3; // ASYNC, Rising INTERNAL CLK, div-by-4
        mcasp->regs->AHCLKXCTL  = 0x00000000; // EXTERNAL CLK
        mcasp->regs->XTDM       = 0x00000003; // Slots 0,1
        mcasp->regs->XINTCTL    = 0x00000000; // Not used
        mcasp->regs->XCLKCHK    = 0x00FF0008; // 255-MAX 0-MIN, div-by-256
       // Outputs to DAC
        mcasp->regs->SRCTL5     = 0x000D;     // MCASP1.AXR1[5] --> SDTI1 [Rb/Lb]
        mcasp->regs->SRCTL6     = 0x000D;     // MCASP1.AXR1[6] --> SDTI2 [SW/CTR]
        mcasp->regs->SRCTL7     = 0x000D;     // MCASP1.AXR1[7] --> SDTI3 [Rs/Ls]
        mcasp->regs->SRCTL8     = 0x000D;     // MCASP1.AXR1[8] --> SDTI4 [Rf/Lf]
        // Inputs from ADC
        mcasp->regs->SRCTL0     = 0x000E;     // MCASP1.AXR1[0] <-- DOUT [0:1]
        mcasp->regs->SRCTL1     = 0x000E;     // MCASP1.AXR1[1] <-- DOUT [2:3]
        mcasp->regs->SRCTL2     = 0x000E;     // MCASP1.AXR1[2] <-- DOUT [4:5]
        mcasp->regs->SRCTL10    = 0x000E;     // MCASP1.AXR1[10]<-- DOUT [6:7]

       mcasp->regs->PFUNC      = 0;          // All MCASPs
        mcasp->regs->PDIR       = 0xB40001E0; // All inputs except AXR1[5], AXR1[6], AXR1[7], AXR1[8], ACLKX1, AFSX1

        mcasp->regs->DITCTL     = 0x00000000; // Not used
        mcasp->regs->DLBCTL     = 0x00000000; // Not used
        mcasp->regs->AMUTE      = 0x00000000; // Not used


        // Starting sections of the McASP
        mcasp->regs->XGBLCTL |= GBLCTL_XHCLKRST_ON;                                    // HS Clk
        while ( ( mcasp->regs->XGBLCTL & GBLCTL_XHCLKRST_ON ) != GBLCTL_XHCLKRST_ON );  
        mcasp->regs->RGBLCTL |= GBLCTL_RHCLKRST_ON;                                    // HS Clk
        while ( ( mcasp->regs->RGBLCTL & GBLCTL_RHCLKRST_ON ) != GBLCTL_RHCLKRST_ON );
       
        mcasp->regs->XGBLCTL |= GBLCTL_XCLKRST_ON;                                     // Clk
        while ( ( mcasp->regs->XGBLCTL & GBLCTL_XCLKRST_ON ) != GBLCTL_XCLKRST_ON );
        mcasp->regs->RGBLCTL |= GBLCTL_RCLKRST_ON;                                     // Clk
        while ( ( mcasp->regs->RGBLCTL & GBLCTL_RCLKRST_ON ) != GBLCTL_RCLKRST_ON );

        mcasp->regs->XSTAT = 0x0000ffff;        // Clear all
        mcasp->regs->RSTAT = 0x0000ffff;        // Clear all

        mcasp->regs->XGBLCTL |= GBLCTL_XSRCLR_ON;                                   // Serialize
        while ( ( mcasp->regs->XGBLCTL & GBLCTL_XSRCLR_ON ) != GBLCTL_XSRCLR_ON );
        mcasp->regs->RGBLCTL |= GBLCTL_RSRCLR_ON;                                   // Serialize
        while ( ( mcasp->regs->RGBLCTL & GBLCTL_RSRCLR_ON ) != GBLCTL_RSRCLR_ON );

        // Write a 0, so that no underrun occurs after releasing the state machine
        mcasp->regs->XBUF5 = 0;
        mcasp->regs->XBUF6 = 0;
        mcasp->regs->XBUF7 = 0;
        mcasp->regs->XBUF8 = 0;
        //mcasp->regs->RBUF0 = 0;

        mcasp->regs->XGBLCTL |= GBLCTL_XSMRST_ON;                                       // State Machine
        while ( ( mcasp->regs->XGBLCTL & GBLCTL_XSMRST_ON ) != GBLCTL_XSMRST_ON );
        mcasp->regs->RGBLCTL |= GBLCTL_RSMRST_ON;                                       // State Machine
        while ( ( mcasp->regs->RGBLCTL & GBLCTL_RSMRST_ON ) != GBLCTL_RSMRST_ON );

        mcasp->regs->XGBLCTL |= GBLCTL_XFRST_ON;                                        // Frame Sync
        while ( ( mcasp->regs->XGBLCTL & GBLCTL_XFRST_ON ) != GBLCTL_XFRST_ON );
        mcasp->regs->RGBLCTL |= GBLCTL_RFRST_ON;                                        // Frame Sync
        while ( ( mcasp->regs->RGBLCTL & GBLCTL_RFRST_ON ) != GBLCTL_RFRST_ON );

         // Start by sending a dummy write
        while( ! ( mcasp->regs->SRCTL5 & 0x10 ) );  // Check for Tx ready
        mcasp->regs->XBUF5 = 0;
        while( ! ( mcasp->regs->SRCTL6 & 0x10 ) );  // Check for Tx ready
        mcasp->regs->XBUF6 = 0;
        while( ! ( mcasp->regs->SRCTL7 & 0x10 ) );  // Check for Tx ready
        mcasp->regs->XBUF7 = 0;
        while( ! ( mcasp->regs->SRCTL8 & 0x10 ) );  // Check for Tx ready
        mcasp->regs->XBUF8 = 0;

    // echo
       for ( sec = 0 ; sec < 5 ; sec++ )    //500
        {
            for ( msec = 0 ; msec < 1000 ; msec++ )
            {
                for ( sample = 0 ; sample < 48 ; sample++ )
                {
                    // Read then write sample to the right channel rf
                    while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
                        sample_data = MCASP1_RBUF0_32BIT;
                    while ( ! ( MCASP1_SRCTL8 & 0x10 ) );
                        MCASP1_XBUF8_32BIT = sample_data;
                    // Read then write sample to the right channel rs
                    while ( ! ( MCASP1_SRCTL1 & 0x20 ) );
                        sample_data = MCASP1_RBUF1_32BIT;
                    while ( ! ( MCASP1_SRCTL7 & 0x10 ) );
                        MCASP1_XBUF7_32BIT = sample_data;
                    // Read then write sample to the right channel c
                    while ( ! ( MCASP1_SRCTL2 & 0x20 ) );
                        sample_data = MCASP1_RBUF2_32BIT;
                    while ( ! ( MCASP1_SRCTL6 & 0x10 ) );
                        MCASP1_XBUF6_32BIT = sample_data;
                    // Read then write sample to the right channel rb
                    while ( ! ( MCASP1_SRCTL10 & 0x20 ) );
                        sample_data = MCASP1_RBUF10_32BIT;
                    while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
                        MCASP1_XBUF5_32BIT = sample_data;
                  
                    // Read then write sample to the left channel lf
                    while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
                        sample_data = MCASP1_RBUF0_32BIT;
                    while ( ! ( MCASP1_SRCTL8 & 0x10 ) );
                        MCASP1_XBUF8_32BIT =  sample_data;
                    // Read then write sample to the left channel ls
                    while ( ! ( MCASP1_SRCTL1 & 0x20 ) );
                        sample_data = MCASP1_RBUF1_32BIT;
                    while ( ! ( MCASP1_SRCTL7 & 0x10 ) );
                        MCASP1_XBUF7_32BIT = sample_data;
                    // Read then write sample to the left channel sw
                    while ( ! ( MCASP1_SRCTL2 & 0x20 ) );
                        sample_data = MCASP1_RBUF2_32BIT;
                    while ( ! ( MCASP1_SRCTL6 & 0x10 ) );
                        MCASP1_XBUF6_32BIT = sample_data;
                    // Read then write sample to the left channel lb
                    while ( ! ( MCASP1_SRCTL10 & 0x20 ) );
                        sample_data = MCASP1_RBUF10_32BIT;
                    while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
                        MCASP1_XBUF5_32BIT = sample_data;

                }
            }
        }

    Regards,

    Fawad

  • Hi Fawad,

      

    Fawad Nackvi62335 said:
    Are you using i2s mode at 48 kHz?

    Yes. I2S and 48kHz.

    I also read that, we don't need to do anything to setup PCM1802. 

    Fawad Nackvi62335 said:

    In the mcaspRcvSetup:

    /* .rfmt = */ 0x00018070, <-- I uses 32bit data

    .rintctl  = */ 0x00000000,<--- ignore errors

    I think you wrongly entered the value for rfmt in previous reply. Or whether you configured it for 16bit ?.

    Fawad Nackvi62335 said:
    Look at the gel file to make sure all your appropriate McASP pins are enabled

    I checked it. Pins are configured for McASP.

    I changed RFMT and XFMT values to 0x000180F0, and inserted the code for loop playback after AKM setup, now I am getting data in Rx pins(AXR1[0], AXR1[1], AXR1[1],AXR1[10]). Also my Tx, Rx clocks are same and correct to the values you mentioned. The buffer reclaimed from the input stream showing some data, but still I am not getting any audio out from the board. If I copy sine tone into output buffer, instead of reclaimed buffer,then I can hear the tone. I think still I have some problem with McASP buffer format or data width.

    I am attaching my current audioSample_io.c file here, can you please verify it.

    6102.audioSample_io.c

    -regards

    paul

  • Hi Fawad,

      Now program is working. Actually the problem is with input-output data mapping. I am getting data  corresponding to input-LF/RF in ouput LB/RB. Likewise all the data channels are reversed. This is the channel mapping now I am getting.

    Input        Output       
    LF/RF LB/RB
    LS/RS C/SW
    C/SW LS/RS
    LB/RB LF/RF

    Do you have any idea on this..? Please share your thoughts in this regard.

    Thanks a lot for support .

    -Regards

    Paul 

  • Paul,

    Congrats.  Now you are up and running.  Did you do 16 bit data or 32 bit data?  I remember when I worked on this many moons ago I was getting some kind of channel swap too.  I moved to 32 bit and everything was fine.  Swapping channels around is pretty easy in the DSP and uses very few cycles.  If you are going to be processing the data in float you probably need to make another buffer (internal?) anyway so you can do the swap there. 

    Your next step should be input test signals like 0dB, -6 dB, -90 dB sine waves etc to make sure you don't have anything wrong in the passthru.  I know I did early in my development. If you have an AP (Audio Precision) then this is very easy to do.

    Regards,

    Fawad

  • Hi Fawad,

        Thanks :)

    I am using 32bit data. These are my configurations regarding data format.

    Receiver:

    /* .rfmt     = */ 0x000180F0 //slot Size is 32

    /* .afsrctl  = */ 0x00000112 // 2slot TDM

    /* .rtdm     = */ 0x00000003 // Slots 0,1 

    Transmitter:

    /* .xfmt     = */ 0x000180F0  //slot Size is 32

    /* .afsxctl  = */ 0x00000112 // 2slot TDM

    /* .xtdm     = */ 0x00000003 // Slots 0,1 

    Also I am using 'Mcasp_WordLength_32', 'Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1', and no of TDM channels as 1. I think by this configuration, each channel is of 32bit width. ie If I am going with 8 channels and 128 as BUFLEN, I will get  64 samples/channel for each buffer, and following will be the format of data coming from McASP serializers. 

    [Ser 1- channel 1-32bit] [Ser 2-channel 1-32bit] [Ser 3- channel 1-32bit] [Ser 4- channel 1-32bit] [Ser 1- channel 2-32bit] [Ser 2-channel 2-32bit] [Ser 3- channel 2-32bit] [Ser 4- channel 2-32bit]

    Is it right..?

    -regards

    paul

  • Paul,

    I think this looks right.  It is a minor convenience to swap channels.  Maybe someone from the TI PSP team can contribute here.  TI can you hear me?

    Regards,

    Fawad