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.

Configuring audio on DA830/OMAP L137 EVM!

Hi!

The audio sample application contains the code to record one channel (left from Line-in1) and playback one channel (left from line-out1 it seems). I am using PSP 02.00.01 for DA830. How can I configure the audio, to record both left and right channel and playback also both channels on line out. Below is the configuration section of the code to be setup. I could manage the other parts of the code, but there is hardly any documentation on these. How to configure it so that two channels are returned interleaved for both recording and playback? Where do I specify which audio channel on the board (LineIn, LineOut, Mic, etc...) is to be recorded/played back? Later I would like to extend this to four channels for playback and four for recording. Other parameters (sampling frequency, bits etc.. are OK as they are).

Thanks!
Atmapuri

Mcasp_HwSetupData mcaspRcvSetup = {
        /* .rmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
        /* .rfmt     = */ 0x000080F0, /*
                                       * 0 bit delay from framsync
                                       * MSB first
                                       * No extra bit padding
                                       * Padding bit (ignore)
                                       * slot Size is 32
                                       * Reads from DMA port
                                       * NO rotation
                                       */
        /* .afsrctl  = */ 0x00000000, /* burst mode,
                                       * Frame sync is one bit
                                       * Rising edge is start of frame
                                       * externally generated frame sync
                                       */
        /* .rtdm     = */ 0x00000001, /* slot 1 is active (DSP)               */
        /* .rintctl  = */ 0x00000003, /* sync error and overrun error         */
        /* .rstat    = */ 0x000001FF, /* reset any existing status bits       */
        /* .revtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
        {
             /* .aclkrctl  = */ 0x00000000,
             /* .ahclkrctl = */ 0x00000000,
             /* .rclkchk   = */ 0x00000000
        }
} ;

Mcasp_HwSetupData mcaspXmtSetup = {
        /* .xmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
        /* .xfmt     = */ 0x000080F0, /*
                                       * 0 bit delay from framsync
                                       * MSB first
                                       * No extra bit padding
                                       * Padding bit (ignore)
                                       * slot Size is 32
                                       * Reads from DMA port
                                       * NO rotation
                                       */
        /* .afsxctl  = */ 0x00000000, /* burst mode,
                                       * Frame sync is one bit
                                       * Rising edge is start of frame
                                       * externally generated frame sync
                                       */
        /* .xtdm     = */ 0x00000001, /* slot 1 is active (DSP)               */
        /* .xintctl  = */ 0x00000007, /* sync error,overrun error,clK error   */
        /* .xstat    = */ 0x000001FF, /* reset any existing status bits       */
        /* .xevtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
        {
             /* .aclkxctl  = */ 0x00000000,
             /* .ahclkxctl = */ 0x00000000,
             /* .xclkchk   = */ 0x00000000
        },

};


/* McAsp 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_32,
        NULL,
        0,
        NULL,
        NULL,
        1,                        /* number of TDM channels      */
        Mcasp_BufferFormat_1SER_1SLOT,
        TRUE,
        TRUE
    },
    {
        0x0001,                   /* number of serialisers       */
        {Mcasp_SerializerNum_5,},
        &mcaspXmtSetup,
        TRUE,
        Mcasp_OpMode_TDM,
        Mcasp_WordLength_32,      /* word width                  */
        NULL,
        0,
        NULL,
        NULL,
        1,                        /* number of TDM channels      */
        Mcasp_BufferFormat_1SER_1SLOT,
        TRUE,
        TRUE
    }
};

Audio_ChannelConfig audioIfChanDefaultInfo[2]=
{
   /*  channel 0 (RX)                                             */
    &mcasp_chanparam[0],      /* channel params                   */
    {   /* codec [0]                                              */
        {
            44100,            /* sampling rate                    */
            30,               /* gain                             */
            0x00,
            0x00
        }
    },
    /*  channel 1 (TX)                                            */
    &mcasp_chanparam[1],      /* channel params                   */
    {
        /* codec [0]                                              */
        {
            44100,            /* sampling rate                    */
            70,               /* gain                             */
            0x00,
            0x00
        }
    }
};

  • I'll ask the PSP team to look at this...

  • Hi,

    The current audio application is configured to read the 2 channels (left and right  "each of 16 bit") in a single 32 bit read and subsequently write the same in a 32 bit write.

    please let me know the exact configuration you are looking for

    1. No of serializers

    2. No of slots

    3. No of bits per slot.

    regards,

    imtiaz

  • Dear Imtiaz,

    >The current audio application is configured to read the 2 channels (left and right  "each of 16 bit")  in a single 32 bit read and subsequently write the same in a 32 bit write.

    I am using the EVM DA830 PSP 02.00.01 with DSP/BIOS 6.2 and this PSP records 1 channel only. The board is without the daughter boards (DSK830 only). I dont know how that can be that you are mentioning two channels. I have run the example, and examined the read and write buffers. What I sent to the board LineIn1-left and right was a sine signal. That sine showed up in signed 32bit format on the left (0) channel of the LineIn1. The right channel was not picked up. If it helps I can post an image of the 32bit range sine displayed in CCS. Maybe the recording is 16bit and only storage is 32bit, but there is definitely only one channel in the stream buffer. I also tried out various options to make sure that LineIn1 Left is in fact the only thing picked up.

    What I would like to have:

    1.) There is only one DSP/BIOS input stream object. The 2 channels are multiplexed (interleaved) in the same stream using 32bit signed integer storage format for each channel. Input pins are LineIn left and right.

    2.) There is only one DSP/BIOS output stream object. The 2 channels are multiplexed (interleaved) in the same stream using 32bit signed integer storage format for each channel. Output pins are LineOut. (See the DSK 830 board labels).

    Please note that I am new to mcASP and I dont know how many serializers I would need to acheive that. I guess I woud need 2 serializers (one for input and one for output channels) with 2 slots (one for left and for right channel) and with 32bits per slot.

    Maybe the audio daugther board is configured differently on DSK830 as it is on DA830. Anyhow, I have only DSK830, which has 4 banana plugs, 1 LineIN, 1LineOut, 1Mix and 1HPOut.

    Thanks!
    Atmapuri

  • Dear Imtiaz,

    I forgot that the code is in LSB format and so you were correct about the two channels. I was looking at 32bit samples and the other channel was nicely hidden. I also figured out that serializer is associated with the connection across which the data is transfered. That would mean that only 2 serializers are neeeded. One for receive and one for send. I tried to modify from:

    Aic31Prms.acSlotWidth = Aic31.SlotWidth_16;

    to

    Aic31Prms.acSlotWidth = Aic31.SlotWidth_32;

    but that was not sufficient to switch the acquisiton to 32bit storage format (and full ADC accuracy).

    Thanks!
    Atmapuri

  • Hi,

    The driver is configured to receive the input through Line - in and output the same through both the HP OUT and LINEOUT. you can use the codec driver ioctls to change this selection.

    Regarding the configuration please find the required settings given below.

    in ti/psp/platforms/evmDa830/audio.cfg file add the following

    aic31Prms.acSerialDataType       = Aic31.DataType_DSP;
    aic31Prms.acSlotWidth            = Aic31.SlotWidth_32;

    in audioSample_io.c add the following

    Mcasp_HwSetupData mcaspRcvSetup = {
            /* .rmask    = */ 0xFFFFFFFF,
            /* .rfmt     = */ 0x000080F0,
            /* .afsrctl  = */ 0x00000101,
            /* .rtdm     = */ 0x00000003,
            /* .rintctl  = */ 0x00000003,
            /* .rstat    = */ 0x000001FF,
            /* .revtctl  = */ 0x00000000,
            {
                 /* .aclkrctl  = */ 0x00000000,
                 /* .ahclkrctl = */ 0x00000000,
                 /* .rclkchk   = */ 0x00000000
            }
    } ;

    Mcasp_HwSetupData mcaspXmtSetup = {
            /* .xmask    = */ 0xFFFFFFFF,
            /* .xfmt     = */ 0x000080F0,
            /* .afsxctl  = */ 0x00000101,
            /* .xtdm     = */ 0x00000003,
            /* .xintctl  = */ 0x00000003,
            /* .xstat    = */ 0x000001FF,
            /* .xevtctl  = */ 0x00000000,
            {
                 /* .aclkxctl  = */ 0x00000000,
                 /* .ahclkxctl = */ 0x00000000,
                 /* .xclkchk   = */ 0x00000000
            },
    };


    /* McAsp 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_32,
            NULL,
            0,
            NULL,
            NULL,
            2,                        /* number of TDM channels      */
            Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,
            TRUE,
            TRUE
        },
        {
            0x0001,                   /* number of serialisers       */
            {Mcasp_SerializerNum_5,},
            &mcaspXmtSetup,
            TRUE,
            Mcasp_OpMode_TDM,
            Mcasp_WordLength_32,      /* word width                  */
            NULL,
            0,
            NULL,
            NULL,
            2,                        /* number of TDM channels      */
            Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,
            TRUE,
            TRUE
        }
    };

     

     

    regards,

    imtiaz

  • Dear Imtiaz,

    Thank you for very much for taking a look at this. I tried to see how to access the IOCTL that you mention:

    1.) In the .cfg file it is written:

    var aic310 = Aic31.create(Aic31Prms);

    I assume that this is the IDriver based object. If so, how can I access this object from my code?

    2.) I have studied the registers for Aic3106 chip and the correct IDriver functions to call would be:

    Void control ( Ptr chanHandle, DriverTypes.ControlCmd cmd, UArg cmdArgs, Error.Block *eb );  

     and the call would be:

    aic310.control(chanHandle, AC_IOCTL_REG_WRITE, Arg, &eb);

    Now, the Arg probably contains the register address. Still somehow the value for the register has to be communicated. chanHandel is also a mistery, because in the example application, the data is written by opening a stream and there are no operations performed on the IDriver. Now I cant tell, if the handle is already stored somewhere, and need to obtain it somehow (how?) or it is possible to call the aic310.open function without somehow interfering with the work done by the Stream object.

    Once I can write individual registers, then all the features are open. Did you have something else in mind? The board has Line IN and Mic IN and I would like to record from both in stereo and output both to the two outputs (HPOut and LineOut).

    Thanks!

     
    Atmapuri

     

  • Hi,

    I am busy in some release work. i will get back to you soon on this.

    Also please refer to the following post for some more information on usgae of IOCTLS in audio interface.

    http://e2e.ti.com/support/dsp/tms320c6000_floating-point_dsps/f/115/p/12198/119612.aspx#119612

    regards,

    imtiaz

  •  

    Hi,

    please  refer to the following post on using the IOCTL commands in the audio driver. Please note that there is a Bug as mentioned in the post and needs to be fixed.

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/12198/116954.aspx

    regards,

    imtiaz