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.

How to replace audio device (I2S master->slave) in AM1707 EVM?

Other Parts Discussed in Thread: AM1707, TLV320AIC3106, AM1705

In AM1707 EVM, I want to remove the audio codec(TLV320AIC3106) and add the device like a simple ADC instead.

This device can work only as a I2S slave, so CPU has to supply the BCLK and LRCLK for this as a I2S master. 

Now CPU is configured as a I2S slave because the codec(TLV320AIC3106) is I2S master device. 

 

Q1. How should I configure the setting of I2S from slave into master? 

 

Q2. Finally I want to capture the output of this device via ALSA. 

    What should I do for this?

 

The detail of the output format of this device is the following.

----------------------------

data format      : I2S

sample rate      : 48000Hz

sample precision : 16bit

data bit rate    : 1.536Mbps

channel          : stereo

----------------------------

  • Changing from I2S master to slave can be done by modifying the McASP. For the Linux ALSA driver, this is implemented in "davinci-mcasp.c:, located under the sound/soc/davinci folder of the Linux kernel that comes with the SDK.  You can see how the low-level (bottom half) part of the driver initialize the different but related H/W components by following the code in davinci-evm.c. For more details on which register bits and their meaning, unfortunately you need to look into the UG SPRUFM1.

     

     

    You can record the output of the ALSA audio driver using the ALSA "arecord" command. It's available with the AM1707 SDK's target file system under /usr/bin folder. There are other alsa commands. More info is at http://processors.wiki.ti.com/index.php/Omapl137_linux_audio_driver#ALSA_Utils 

  • Thank you for your information.

     

    I could change the direction of BCLK/LRCLK from slave-mode 

    to master-mode by modifying the McASP. Then, CPU can supply 

    the correct BCLK(1.526MHz)/LRCLK(48kHz) for the device. 

    The audio device also can output the audio data(48kHz) to CPU.

     

    But I still have a problem about capturing the audio output. 

    I confirmed the sound via ALSA was obviously strange. 

    The setting of ALSA is the following.

    ---------------------------------------------------------

    arecord -f dat

    // Signed 16 bit Little Endian, Rate 48000 Hz, Stereo)

    ---------------------------------------------------------

     

    To get a correct input data, should I set any other registers?

    I'll continue to evaluate this problem. 

  • Sorry for my late reply.  

    The rootcause of that strange sound is coming from a wrong setting of the audio device.

    By fixing its setting, I can capture the audio output correctly in AM1707EVM.

    Thanks!

     

    By the way, I'd like to change the CPU to AM1705 for my custom board. 

    I'm using ACLKX1, AHCLK1, and AXR1[5] for I2S pins in AM1707EVM.

    I'd like to change this pin layout to ACLKX0, AHCLK0, and AXR0[11] for I2S.

     

    But I don't know how to configure the CPU registers for this changing.

    Could you give me your kindly advice?

  • Now, I got the signals of ACLKX0 and AFSX0 after changing kernel codes.
    But there is a error message from console.
    The Error is as below.

     

    kernel> arecord: pcm_read:1617: read error: Input/output error
    kernel> ...done streaming

     

    I don't know the cause of this.
    Please let me know about this.

  • Ryo Suzuki said:

    By the way, I'd like to change the CPU to AM1705 for my custom board. 

    I'm using ACLKX1, AHCLK1, and AXR1[5] for I2S pins in AM1707EVM.

    I'd like to change this pin layout to ACLKX0, AHCLK0, and AXR0[11] for I2S.

     

    But I don't know how to configure the CPU registers for this changing.

    Could you give me your kindly advice?

     

    Suzuki-san,

          Configuring the AM1705 Registers to your specifications is done by configuring the AM1705 McASP0 registers as well as few other device registers. For this, you will want to reference the following documents

    [1] AM1705 Data Sheet:  Contains the Memory Map of the Peripheral Configuration Registers for the AM1705. You will need to configure the McASP0 Control Registers using the memory mapped base address of the McASP0 Peripheral found in this document.

    [2] AM17x/AM18x ARM Microprocessor McASP User Guide: Contains the summary of the AM17x/18x McASPx Configuration Registers. I would recommend that you reference the current McASP1 settings of the AM1707 as you will be able to port most of these register settings to the McASP0 Peripheral of the AM1705

    [3] ARM1705 System Reference Guide  Contains the summary of the Pinmux Registers Settings for the AM1705. You will need to configure the pinmux registers accordingly so  the AXR0[11] is now configured as an output.

     You will also have to remap the audio data from the DMA to the correct serializer buffer (of FIFO buffer) register. I would recommend that you reference how this is currently done for the AM1707 McASP1 module for a starting point.

     

    Let us know if you run into any trouble doing this.

     

     

  • Dear Drew-san,

    Thank you very much for your answer.

     

    The code of McASP1 module is very helpful for my questions. 

    I referred it and found my mistake about McASP0 setting.

    Now McASP0 works correctly in my AM1705 board. Thanks for your help!