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.

TLV320AIC3007: TLV320aic3007 codec interface with i2S lines

Part Number: TLV320AIC3007


Hi,

I am trying to interface TLV320aic3007 codec with i2S interface on atmel chip.I am using 4.9.151 kernel version.Please let me know  tlv320aic3007 codec will work with default driver provided by source or it require any driver changes for working with i2s interface.

Thanks & Regrads,

  Prasanth

  • Hello,

    The upstreamed drivers you'll find in the github repositories will provide the base ALSA commands to record/play audio with the CODEC.  You can select the audio interface modes of operation, including I2S, through the driver as well.  You will likely have to modify parts of the device tree and HAL to connect the ATMEL resources to the driver commands.

  • Hi ,

    Thank you for  response ,I  interfaced tlv320aic3007(i2c/i2s) to my soc(a5d27).when i am playing sound with aplay command i am getting below error.Please have a look on below detaills.

    Error:

    aplay Sample_BeeMoved_48kHz16bit.m4a -v
    Playing raw data 'Sample_BeeMoved_48kHz16bit.m4a' : Unsigned 8 bit, Rate
    8000 Hz, Mono
    tlv320aic3x-codec 0-0018: Unable to sync registers 0x33-0x36. -121
    Plug PCM: Route conversion PCM (sformat=S16_LE)
       Transformation table:
         0 <- 0
         1 <- 0
    Its setup is:
       stream       : PLAYBACK
       access       : RW_INTERLEAVED
       format       : U8
       subformat    : STD
       channels     : 1
       rate         : 8000
       exact rate   : 8000 (8000/1)
       msbits       : 8
       buffer_size  : 4000
       period_size  : 1000
       period_time  : 125000
       tstamp_mode  : NONE
       tstamp_type  : MONOTONIC
       period_step  : 1
       avail_min    : 1000
       period_event : 0
       start_threshold  : 4000
       stop_threshold   : 4000
       silence_threshold: 0
       silence_size : 0
       boundary     : 2097152000
    Slave: Hardware PCM card 0 'Simple Audio' device 0 subdevice 0
    Its setup is:
       stream       : PLAYBACK
       access       : MMAP_INTERLEAVED
       format       : S16_LE
       subformat    : STD
       channels     : 2
       rate         : 8000
       exact rate   : 8000 (8000/1)
       msbits       : 16
       buffer_size  : 4000
       period_size  : 1000
       period_time  : 125000
       tstamp_mode  : NONE
       tstamp_type  : MONOTONIC
       period_step  : 1
       avail_min    : 1000
       period_event : 0
       start_threshold  : 4000
       stop_threshold   : 4000
       silence_threshold: 0
       silence_size : 0
       boundary     : 2097152000
       appl_ptr     : 0
       hw_ptr       : 0

     

    Please have a look on below devicetree configuration and let me know the issue.

     tlv320_mclk: oscillator {
                         compatible = "fixed-clock";
                         #clock-cells = <0>;
                         clock-frequency = <19200000>;
                         clock-output-names = "tlv320-mclk";
                            };

                            i2c0: i2c@f8028000 {
                                    dmas = <0>, <0>;
                                    pinctrl-names = "default";
                                    pinctrl-0 = <&pinctrl_i2c0_default>;
                                    status = "okay";

                    tlv320aic3007: tlv320aic3007@18 {
                                                    #sound-dai-cells = <0>;
                                                    compatible = "ti,tlv320aic3007";
                                                    reg = <0x18>;
                                                    AVDD-supply = <&vddin_3v3>;
                                                    IOVDD-supply = <&vddin_3v3>;
                                                    DRVDD-supply = <&vddin_3v3>;
                                                    DVDD-supply = <&vcc_1v8_reg>;
                                                    status = "okay";
                                                    };

                    };

    sound {
       compatible = "simple-audio-card";
                    simple-audio-card,name = "Simple Audio";
                    simple-audio-card,format = "i2s";
                    simple-audio-card,bitclock-master = <&dailink_master>;
                    simple-audio-card,frame-master = <&dailink_master>;
                    bitclock-inversion = <1>;
            /*      simple-audio-card,mclk-fs = <256>;*/
                    simple-audio-card,widgets =
                            "Line", "Line In",
                            "Line", "Line Out",
                            "Speaker", "Speaker";
                    simple-audio-card,routing =
                            "Line Out", "LLOUT",
                            "Line Out", "RLOUT",
                            "Speaker", "SPOP",
                            "Speaker", "SPOM",
                            "LINE1L", "Line In",
                            "LINE1R", "Line In";
                    status = "okay";

                    simple-audio-card,cpu {
                            sound-dai = <&i2s0>;
                            bitclock-inversion = <0>;
                                               };

                                };
                    dailink_master: simple-audio-card,codec {
                            sound-dai = <&tlv320aic3007 0>;
                            clocks = <&tlv320_mclk>;
                            system-clock-frequency = <12000000>;

                    };
                    };


     

  • Hello,

    Unfortunately we are not Linux experts and will need to focus our support around the TLV320AIC device that we know well.  Can you confirm you can read/write registers in the CODEC, and if so, please send us the register dump and also an image of the I2S audio serial lines as well if possible while trying to record.