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.

Codec on DM6446

Genius 4530 points


Hi,

I am working  on DM6446 EVM board and trying to implement codec on it.

I have successfully configured the registers of Codec AIC33.

For basic testing, I started with Digital Loopback which was done successfully.

Now when I try to send, an internally generated pattern of sine wave to Line Out, i get neither output nor clock.

I am using ASP internal clock generator and while reading the application note, I found a line

A DSP reset selects the ASP internal input clock as the input clock and forces the CLKG frequency
to 1/2 the ASP internal input clock frequency.

Does this mean that I have to ensure that DSP is out of reset ? How do I do it? Is this the reason why I dont get a clock on CLKX pin and correspondingly the output?

Thanks and Regards,

Sidharth

  • Are you aware that we have an AIC33 Linux driver available in DM644X DVSDK?  If you are controlling this periheral from the ARM side, there is no need to take DSP out of reset.  DSP in this platform is primarily used to run math intensive algorithms such as mpeg4, mp3, ...  If you are using these algorithms to compress/uncompress data, then yes you will need to take DSP out of reset, but to simply record or play raw uncompressed audio via IAC33, you can do thins entirely on ARM via Linux drivers.

  • Hi Juan,

    Thanks for your reply.

    But I am using CCS 3.3 for the implementation and not Linux.

    SO I dont have access to the Linux drivers, though I intend to shift to Linux in the future.

    Any other suggestions?

    Thanks and Regards,

    Sidharth

  • If you plan to change to Linux eventually, I would encourage you move there sooner rather than later.  It is certainly possible to develop code in CCS, but I am concerned that much of this will eventually be unused when you move to Linux.  If you must write code in CCS, the linux drivers could certainly be used as reference code. 

  • Hi,

    I am currently trying to run a audio loopback on DM6446 EVM board , but i am unable to do it. It would be helpful if you can please tell the CODEC AIC33 configration(to be done in the codec registers ) so that the audio loopback works.can you tell some ode/link for digital loopback.

  • Hi Akash,

    Assuming you are working on Linux driver,

    I doubt DAI driver of DM6446 EVM works or not. We tested audio for DM6446 EVM with our in house driver.

    Basically DAI is part of ASOC architecture. ASOC has other components of,

    Machine driver - davinci-evm.c

    PCM driver - davinci-pcm.c

    DAI driver - davinci-i2s.c

    CODEC driver - tlv320aic3x.c

    Of all the components, I changed only DAI driver and got some audio playing on head-phone out. i.e In case you are not getting some audio on headphone jack, your DAI driver is not working properly.

    For initial debugging, put some print statements in probe of tlv320aic3x.c and davinci-i2s.c to check whether your machine driver is configured properly or not.

     

  • Hi Abhijit Naik,

    thanks for your reply.Actually i am new to davinci processors.However we have a EVM board for 6446 ,and CCS VERSION 5.1.As i have to develop an application for DSP side(without using the ARM and linux os (in any form)).AS CCS 5.1 does not have a library/functions/files for the dm6446,so i downloaded the zipped files from

    http://c6000.spectrumdigital.com/davincievm/revd/

    i made the loopback application from this source.Can you send the DAI driver/can you give some clue regarding how to test DAI driver.

    thanks and regards

    akash

  • Hi,

    Following is the register dump of ASP modules when driver was tested with aplay 

    Playing WAVE 'pcm3208s.wav' : Signed 32 bit Little Endian, Rate 8000 Hz, Stereo

    SPCR: 0x58000
    RCR: 0x0
    XCR: 0x80400040
    SRGR: 0x201f007c
    PCR: 0x3

    Following is the register dump of ASP modules when driver was tested with arecord

    Recording WAVE 'pcm3208s_rec.wav' : Signed 32 bit Little Endian, Rate 8000 Hz, Stereo

    SPCR: 0x108000
    RCR: 0x80400040
    XCR: 0x80400040
    SRGR: 0x201f007c
    PCR: 0x3

    The register dump is when CODEC is configured as master, i.e CODEC supplying bit clock and frame clock.

    Also note that there is some sequence to be followed when starting play-back or record which is mentioned in section 2.7.1 of "TMS320DM644x DMSoCAudio Serial Port (ASP)", this procedure is present in main line linux driver also http://lxr.free-electrons.com/source/sound/soc/davinci/davinci-i2s.c?v=3.8  davinci_mcbsp_start function

    On Linux environment, ASP modules receives input clock so much high that, even setting ASP's clock divider value to maximum won't supply bit rate in the range of audio clock. That means, in order to listen some sound on headphone jack you must use CODEC as master on Linux.

    For initial testing, you can configure ASP as master and in loop-back mode. You can enable the interrupt and write some data in driver itself and check whether you are getting same data back.

    Later you can write full fledged application to test your driver. 

    At the same time please let me know what is the clock frequency that is being supplied to ASP i.e sysclk5 output

    Hope this helps, All the best

  • Hi Abhijit Naik3,

    Thanks for your reply.It was quite knowledgefull .I just wanted to ask that the ASP module registers configuration(that you have shown in the dump) have you done this configuartion while opening the codec (in codec_open function) and why is it different  SPCR register config for the record/play.Also i wanted to ask that are you using the ARM part or DSP OR BOTH.Can you please tell the codec config(the configration of 102 registers of the AIC33 vocoder IC that acts as front end for capturing /playing the audio via ASP).

    thanks and regards

    akash

  • Actually I gave you the log by running aplay and arecord separately instead of running simultaneously.

    Here is the log of proper loop back

    aplay:

       PCR 0x3
       SRGR 0x201f0059
       XCR 0x80400040
       RCR 0x80400040
       SPCR 0x8007

    arecord:

     PCR 0x3
     SRGR 0x201f0059
     XCR 0x80400040
     RCR 0x80400040
     SPCR 0x38007

    Configuration of ASP is independent of CODEC. Usually ASP will be prepared for data transfer mode, bits/sample and interrupt setting.

    The ASP module will be taken out of reset when user presses start play-back or start capture. 

    The setting has been done using ARM side interface but, register configuration value will be same whether your using ARM or DSP.

    For CODEC register value, it will take some time for me, as I have to add print statements in the working CODEC driver.