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.

Linux/TLV320AIC3106: Unable to sync register issue

Part Number: TLV320AIC3106

Tool/software: Linux

Hi Community Members,

I am working on  the latest TI-SDK ti-am335x-03.02.00.05 on our custom board. We have migrated from previous ti-sdk-am335x-evm-7.0 to the latest one due to customer requirements.

The codec was working on the previous SDK.But after doing the same changes in the new SDK we are getting error.

Here is the log for speaker-test:

root@ngt:~/test# speaker-test 

speaker-test 1.0.26
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise[  254.885924] tlv320aic3x-codec 1-001b: Unable to sync registers 0x1-0x1. -121
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 256 to 32768
Period size range from 128 to 16384
Using max buffer size 32768
Periods = 4
was set period_size = 8192
was set buffer_size = 32768
 0 - Front Left

When I checked from the logs it was coming from file drivers/base/regmap/regcache.c.


This regmap concept is present in the new tlv320aic3x.c driver file. We are compiling the drivers as a module.

We can see the cards in cat /proc/asound/cards

When we detect the i2c device using i2cdetect we get the following output

 

root@ngt:~/audio_routing_scripts# i2cdetect -r -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: 10 -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
20: 20 21 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- 4d -- -- 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- 6c -- -- -- 
70: -- -- -- -- -- -- -- --                         

After using rmmod we are getting the following logs

root@ngt:~/audio_routing_scripts# rmmod -f snd_soc_tlv320aic3x
[  838.273808] Disabling lock debugging due to kernel taint
root@ngt:~/audio_routing_scripts# i2cdetect -r -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 21 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- 4d -- -- 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- 6c -- -- -- 
70: -- -- -- -- -- -- -- --                         

We see that after removing the module even the i2c address of codec (0x1b) is not seen.

I am attaching my dts and dtsi files. Please have a look.

I am stuck here since 2 weeks.

 

Thanks

Deepika1781.am335x-bone-common.dtsi.txt4861.am335x-boneblack.dts.txt

 

 

  • Hi Deep,

    Could you please specify what hardware differences you have between your custom board and AM335x TI EVM regarding audio?

    Can you also check with minimal playback application and/or aplay tool, instead of speaker-test?

    Regards,
    Pavel
  • Hi Pavel,

    We were using beagle bone  as the EVM.  The power amplifier used is tas5424 at i2c1.

    We are enabling the power amplifier.

    This codec is working with older SDK.

    root@ngt:/home# aplay -l

    **** List of PLAYBACK Hardware Devices ****
    card 0: EVM [DA830 EVM], device 0: AIC3X tlv320aic3x-hifi-0 []
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    root@ngt:/home# aplay audiocheck1_10th_copy_converted.wav

    Playing WAVE 'audiocheck1_10th_copy_converted.wav' : Signed 16 bit[ 2125.417792] tlv320aic3x-codec 1-001b: Unable to sync registers 0x1-0x1. -121
      Little Endian, Rate 44100 Hz, Stereo
    Aborted by signal Interrupt...
    These are my dtsi  configuration:
    &i2c1 {
            pinctrl-names = "default";
            pinctrl-0 = <&i2c1_pins>;
            status = "okay";
            clock-frequency = <100000>;

            tlv320aic3106: tlv320aic3106@1b {
                    compatible = "ti,tlv320aic3106";
                    reg = <0x1b>;
                    gpio-reset = <&gpio0 8 0>;
                    status = "okay";
                    };
            
            sound {
                    compatible = "ti,da830-evm-audio";
                    ti,model = "DA830 EVM";
                    ti,audio-codec = <&tlv320aic3106>;
                    ti,mcasp-controller = <&mcasp0>;
                    ti,codec-clock-rate = <24000000>;
                    ti,audio-routing =
                                    "Headphone Jack",       "HPLOUT",
                                    "Headphone Jack",       "HPROUT";
                    clocks = <&clk_mcasp0>;
                    clock-names = "mclk";

                    };


    &mcasp0 {
            #sound-dai-cells = <0>;
            pinctrl-names = "default";
            pinctrl-0 = <&mcasp0_pins>;
            pinctrl-1 = <&mcasp0_sleep_pins>;
            status = "okay";
            op-mode = <0>;  /* MCASP_IIS_MODE */
            tdm-slots = <2>;
            serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
                            1 2 0 0  
                    >;
            tx-num-evt = <32>;
            rx-num-evt = <32>;
    };

       mcasp0_pins: mcasp0_pins {
                    pinctrl-single,pins = <
                         
                            0x60 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x64 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x68 (PIN_OUTPUT_PULLDOWN | MUX_MODE6)
                            0x6C (PIN_INPUT_PULLDOWN | MUX_MODE6)
                    >;
            };

     
    Please let me know what am I missing in software configurations.
    Thanks
  • One more thing,

    I was referring this post

    It is showing sound-dai as mcasp1 then why mcasp0 is configured instead as shown below:

    simple-audio-card,cpu {
    sound-dai = <&mcasp1>;
    };

    &mcasp0 { //it is possible to use other MCASP module
    #sound-dai-cells = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&mcasp0_pins>;
    status = "okay";
    op-mode = <0>; /* MCASP_IIS_MODE */ //set mcasp mode to meet their use case
    tdm-slots = <2>;
    serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
    0 0 1 0
    >;
    tx-num-evt = <32>;
    rx-num-evt = <32>;
    };

    Thanks

  • deep ter said:
    We were using beagle bone  as the EVM

    I am not sure I understand this. You have AM335x custom board, right? And this custom board is based on EVM, SK, BeagleBone, BBB, ICE or DC?

    deep ter said:
    These are my dtsi  configuration:

    deep ter said:
            tlv320aic3106: tlv320aic3106@1b {
                    compatible = "ti,tlv320aic3106";
                    reg = <0x1b>;
                    gpio-reset = <&gpio0 8 0>;
                    status = "okay";
                    };

    In AM335x TI EVM DTS (am335x-evm.dts) we have:

    tlv320aic3106: tlv320aic3106@1b {
            #sound-dai-cells = <0>;
            compatible = "ti,tlv320aic3106";
            reg = <0x1b>;
            status = "okay";

            /* Regulators */
            AVDD-supply = <&vaux2_reg>;
            IOVDD-supply = <&vaux2_reg>;
            DRVDD-supply = <&vaux2_reg>;
            DVDD-supply = <&vbat>;
        };

    By what reason you decide to remove Regulators settings?

    deep ter said:
    sound {
                    compatible = "ti,da830-evm-audio";
                    ti,model = "DA830 EVM";
                    ti,audio-codec = <&tlv320aic3106>;
                    ti,mcasp-controller = <&mcasp0>;
                    ti,codec-clock-rate = <24000000>;
                    ti,audio-routing =
                                    "Headphone Jack",       "HPLOUT",
                                    "Headphone Jack",       "HPROUT";
                    clocks = <&clk_mcasp0>;
                    clock-names = "mclk";

                    };

    This looks very out dated, see below what we have in the latest DTS:

    sound {
            compatible = "simple-audio-card";
            simple-audio-card,name = "AM335x-EVM";
            simple-audio-card,widgets =
                "Headphone", "Headphone Jack",
                "Line", "Line In";
            simple-audio-card,routing =
                "Headphone Jack",    "HPLOUT",
                "Headphone Jack",    "HPROUT",
                "LINE1L",        "Line In",
                "LINE1R",        "Line In";
            simple-audio-card,format = "dsp_b";
            simple-audio-card,bitclock-master = <&sound_master>;
            simple-audio-card,frame-master = <&sound_master>;
            simple-audio-card,bitclock-inversion;

            simple-audio-card,cpu {
                sound-dai = <&mcasp1>;
            };

            sound_master: simple-audio-card,codec {
                sound-dai = <&tlv320aic3106>;
                system-clock-frequency = <12000000>;
            };

  • In latest AM335x EVM DTS (am335x-evm.dts), mcasp1 is used:

    mcasp1_pins: mcasp1_pins {

    pinctrl-single,pins = <

    0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */

    0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */

    0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */

    0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */

    >;

    };

    mcasp1_pins_sleep: mcasp1_pins_sleep {

    pinctrl-single,pins = <

    0x10c (PIN_INPUT_PULLDOWN | MUX_MODE7)

    0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)

    0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7)

    0x144 (PIN_INPUT_PULLDOWN | MUX_MODE7)

    >;

    };

    &mcasp1 {

    #sound-dai-cells = <0>;

    pinctrl-names = "default", "sleep";

    pinctrl-0 = <&mcasp1_pins>;

    pinctrl-1 = <&mcasp1_pins_sleep>;

    status = "okay";

    op-mode = <0>;          /* MCASP_IIS_MODE */

    tdm-slots = <2>;

    /* 4 serializers */

    serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */

    0 0 1 2

    >;

    tx-num-evt = <32>;

    rx-num-evt = <32>;

    };

    simple-audio-card,cpu {

    sound-dai = <&mcasp1>;

    };

     

    See also below wiki pages (regarding McASP1 usage):

     

    http://processors.wiki.ti.com/index.php/Linux_Core_Audio_User's_Guide

    http://processors.wiki.ti.com/index.php/AM335x_Audio_Driver's_Guide 

  • Hi Pavel,

    Thanks for your reply.

    We were using Beaglebone Black as the reference board. In the dts file of beaglebone we did not had the tlv configurations.So I had to add them explicitly.
    Regarding regulators, We are not using the tps PMIC on our custom board so I have removed all the regulator settings.

    I will do the above dtsi configuration as mentioned by you.
    Let me know if the removal of the regulators have any affect.

    Thanks

    Deep
  • Hi Pavel,

    After the above modifications in the am335x-boneblack.dts  also I am getting the same   tlv320aic3x-codec 1-001b: Unable to sync registers 0x1-0x1. -121


    Can you suggest the solution.

    Thanks

    Deep

  • deep ter said:
    We were using Beaglebone Black as the reference board. In the dts file of beaglebone we did not had the tlv configurations.So I had to add them explicitly.

    In BBB we do not have audio codec. Audio is available only through HDMI. So you should add these, like in AM335x EVM and SK (am335x-evm.dts, am335x-evmsk.dts).

    You should check which I2C instance is used, at which I2C address, and which McASP instance is used on your custom board.

    deep ter said:
    Regarding regulators, We are not using the tps PMIC on our custom board so I have removed all the regulator settings.

    deep ter said:
    Let me know if the removal of the regulators have any affect.

    Looks correct regarding Audio.

    Regards,
    Pavel

  • deep ter said:
    After the above modifications in the am335x-boneblack.dts  also I am getting the same   tlv320aic3x-codec 1-001b: Unable to sync registers 0x1-0x1. -121

    Please provide your latest version of the DTS file

  • Hi Pavel

    When we were using the previous sdk we were using the same am335x-boneblack.dts. It was working with it.We were using mcasp0 for codec.

    As shown in the above logs ,the codec is on i2c 1.

    It is shown as UU  in i2cdetect. But after removing the module the device address is not visible.

    I will share you my complete dts and dtsi tommorow

    Thanks

    Deep

  • Check your previous sdk (where everything works fine), check mcasp0/i2c0 pinmux and compare the settings with the latest sdk. On EVM mcasp1 pins used are - aclkx,fsx,axr2,axr3 (axr2 for tx, axr3 for rx), check if the same apply to your custom board mcasp0 pins.

    Regards,
    Pavel
  • Hi Pavel,

    Sorry for late reply. I was on OoO.

    I have checked from schematic and past sdk dts. We have configured mcasp0 for audio. This is the part of the schematic.

    Also I checked the DRA6XX.pdf

    So we are using ,mcasp0_aclkx, mcasp0_fsx,mcasp0_axr0   (Fot Tx)   ,mcasp0_axr1 (For Rx).

    So I have modified device tree parameter for serializer to  [ 1 2 0 0] 

    The pin muxing for mcasp0 is

                    mcasp0_pins: mcasp0_pins {
                    pinctrl-single,pins = <
         
                            0x60 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x64 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x68 (PIN_OUTPUT_PULLDOWN | MUX_MODE6)
                            0x6C (PIN_INPUT_PULLDOWN | MUX_MODE6)
                    >;
            };

             mcasp0_sleep_pins: mcasp0_sleep_pins {
                            pinctrl-single,pins = <
               
                                    0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                                    0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                                    0x68 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)

    0x6C (PIN_INPUT_PULLDOWN | MUX_MODE7)

    Can anyone please verify it. Also i am sending my dtsi and dts files.

    Please look into it as I need to solve it ASAP.

    5417.am335x-boneblack.dts.txt

             7774.am335x-bone-common.dtsi.txt

  • This is the part of schematic and pin muxing which I forgot to attach

  • The screenshot is not showing up.

    I am attaching the png.

  • Deep,

    What about the AIC3106 MCLK source? I see in your DTS you have:

    simple-audio-card,codec {
    sound-dai = <&tlv320aic3106>;
    system-clock-frequency = <24000000>;
    };

    Do you have external clock generator (like in AM335x TI EVM) which generates 24MHz to supply AIC3106 MCLK? In AM335x TI EVM we have external 12MHz clock generator to supply AIC3106 MCLK (pin 37), and in DTS we have:

    sound_master: simple-audio-card,codec {
    sound-dai = <&tlv320aic3106>;
    system-clock-frequency = <12000000>;
    };

    Or in AM335x SK, the AIC3106 MCLK (pin 37) is supplied by the AM335x CLKOUT1 (pin A15) at freq of 24MHz, and in DTS file we have:

    sound_master: simple-audio-card,codec {
    sound-dai = <&tlv320aic3106>;
    system-clock-frequency = <24000000>;
    };

    Please provide more details regarding your AIC3106 MCLK setup.

    Regards,
    Pavel
  • Hi Pavel,

    I need to check with the hardware team. I will let you know.

    Thanks
  • Hi Pavel,

    Thanks for your suggestion. Our clock source is from CLKOUT1 from the A15 pin as per the schematics

    So this is not configured in the dtsi.

    I will configure the clock source and let you know.

    Thanks

    Deep

  • Hi Pavel,

    I have added the clockout1 in the dtsi file as shown below,

    But still I am getting the same "Unable to sync Register" error as I have mentioned above.

    I have read something regarding the clkout1 source

    What I need to do with the LCD_DATA5 ?

    Can you please let me know.

    Thanks

    Deep

  • deep ter said:
    Thanks for your suggestion. Our clock source is from CLKOUT1 from the A15 pin as per the schematics

    CLKOUT1 comes from the main OSC0, make sure you have 24MHz on this oscillator.

    Regards,
    Pavel

  • deep ter said:
    I have added the clockout1 in the dtsi file as shown below,

    deep ter said:
    But still I am getting the same "Unable to sync Register" error as I have mentioned above.

    Please check this clkout1 pin with oscilloscope (during execution of aplay), you should have there 24MHz.

    deep ter said:
    What I need to do with the LCD_DATA5 ?

    On AM335x StarterKit DTS files, there is no explicit pinmux for the XDMA_EVENT_INTR0.clkout1 setup (like you do in your DTS file), as this is handled by the hardware. See the AM335x StarterKit schematics below. LCD_DATA5 (sysboot5) has externall pull up, which enables CLKOUT1 by default (no need to make XDMA_EVENT_INTR0.clkout1 in DTS file).

    For more details see also:

    AM335x datasheet, Table 4-1. Pin Attributes

    A15 XDMA_EVENT_INTR0


    (4) If sysboot[5] is low on the rising edge of PWRONRSTn, this terminal has an internal pulldown turned on after reset is released. If sysboot[5] is high on the rising edge or PWRONRSTn, this terminal will initially be driven low after reset is released then it begins to toggle at the same frequency of the XTALIN terminal.

    (5) LCD_DATA[15:0] terminals are respectively SYSBOOT[15:0] inputs, latched on the rising edge of PWRONRSTn.

    (9) Reset Release Mode = 7 if sysboot[5] is low. Mode = 3 if sysboot[5] is high.

    AM335x TRM, Table 26-7. SYSBOOT Configuration Pins, and section 8.1.7.3.2 PORz Sequence



    Regards,
    Pavel

  • Hi Pavel,

    Thanks for your suggestions. Our CLKOUT1 is disabled in the schematics so I had to enable it explicitly in the DTSI file.

    I will check MCLK signal of the codec while play a song with the oscilloscope and let you know.

    Thanks

    Deep

  • Deep,

    Check also you have the expected value in conf_xdma_event_intr0/0x44E109B0. Check it from user space with devme2 tool.

    Regards,
    Pavel
  • Hi Pavel,

    The value of conf_xdma_event_intr0/0x44E109B0 is shown:

  • Hi Pavel,

    I have probed pin 37 of AIC3106 Codec (i .e the MCLK)

    Below is the waveform:

    Thanks

  • deep ter said:

    The pin muxing for mcasp0 is

                    mcasp0_pins: mcasp0_pins {
                    pinctrl-single,pins = <
         
                            0x60 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x64 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x68 (PIN_OUTPUT_PULLDOWN | MUX_MODE6)
                            0x6C (PIN_INPUT_PULLDOWN | MUX_MODE6)
                    >;
            };

    Check these registers from user space with devmem2 tool to verify the settings are correct:

    conf_gpmc_a8/0x44E10860

    conf_gpmc_a9/0x44E10864

    conf_gpmc_a10/0x44E10868

    conf_gpmc_a11/0x44E1086C

    deep ter said:
    Also i am sending my dtsi and dts files.

    I am looking into your DTS file (am335x-boneblack.dts)

    I do not think you need the below lines in your DTS:

    clk_mcasp0_fixed: clk_mcasp0_fixed {
            #clock-cells = <0>;
            compatible = "fixed-clock";
            clock-frequency = <24576000>;
        };

        clk_mcasp0: clk_mcasp0 {
            #clock-cells = <0>;
            compatible = "gpio-gate-clock";
            clocks = <&clk_mcasp0_fixed>;
            enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
        };

    Also you should update the sound node as below:

    sound {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "TI BeagleBone Black";


                      -simple-audio-card,format = "i2s";

                      +simple-audio-card,format = "dsp_b";        

       
            simple-audio-card,widgets =
                                    "Headphone", "Headphone Jack",
                                    "Line", "Line In";
                    simple-audio-card,routing =
                                    "Headphone Jack",    "HPLOUT",
                                    "Headphone Jack",    "HPROUT",
                                    "LINE1L",        "Line In",
                                    "LINE1R",        "Line In";
                    -simple-audio-card,bitclock-master = <&dailink0_master>;

                    +simple-audio-card,bitclock-master = <&sound_master>;


                    -simple-audio-card,frame-master = <&dailink0_master>;

                   +simple-audio-card,frame-master = <&sound_master>;

                     simple-audio-card,bitclock-inversion;

                    -dailink0_master: simple-audio-card,cpu {

                   +simple-audio-card,cpu {


                            sound-dai = <&mcasp0>;
                    };

                    -simple-audio-card,codec {

                   +sound_master: simple-audio-card,codec {
                            sound-dai = <&tlv320aic3106>;
                system-clock-frequency = <24000000>;
                    };

         };           

  • I2s mode, gpio1_27 and 24.576MHz fixed clock are used for HDMI audio in BeagleBoneBlack, you do not need for AIC3x codec
  • Also I see you have:

    tlv320aic3106: tlv320aic3106@1b {
    #sound-dai-cells = <0>;
    compatible = "ti,tlv320aic3106";
    reg = <0x1b>;
    gpio-reset = <&gpio0 8 0>; /* GPIO_1 AUDIO_CODEC_RST */
    status = "okay";
    };

    Do you reset the codec through GPIO0_8? On the EVM and SK, the codec is reset by pushbutton.
  • Hi Pavel
    The codec reset is taken by the tlv320aic3x.c driver. Isnt't it?
    Correct me if I am wrong

    Thanks
  • Hi Pavel,

    I have taken the dump of gpmc_8 ,gpmc_9, gpmc_10 and gpmc_11 .

    .

    Please check it.

    Also I am sharing my DTS and DTSI changes for sound and codec again

    In the DTS:

    sound {
            compatible = "simple-audio-card";
                    simple-audio-card,name = "TI BeagleBone Black";
            simple-audio-card,widgets =
                                    "Headphone", "Headphone Jack",
                                    "Line", "Line In";
                    simple-audio-card,routing =
                                    "Headphone Jack",    "HPLOUT",
                                    "Headphone Jack",    "HPROUT",
                                    "LINE1L",        "Line In",
                                    "LINE1R",        "Line In";
                    simple-audio-card,format = "dsp_b";
                    simple-audio-card,bitclock-master = <&sound_master>;
                    simple-audio-card,frame-master = <&sound_master>;
            simple-audio-card,bitclock-inversion;

                    simple-audio-card,cpu {
                            sound-dai = <&mcasp0>;
                    };

                    sound_master:simple-audio-card,codec {
                            sound-dai = <&tlv320aic3106>;
                system-clock-frequency = <24000000>;
                    };

    In the dtsi:

    &i2c1 {
            pinctrl-names = "default";
            pinctrl-0 = <&i2c1_pins>;
            status = "okay";
            clock-frequency = <100000>;

            tlv320aic3106: tlv320aic3106@1b {
            #sound-dai-cells = <0>;
                    compatible = "ti,tlv320aic3106";
                    reg = <0x1b>;
                    gpio-reset = <&gpio0 8 0>; /* GPIO_1 AUDIO_CODEC_RST  */
                    status = "okay";
                    };

    Thanks

  • deep ter said:
    The codec reset is taken by the tlv320aic3x.c driver. Isnt't it?

    Yes, it looks like this is correct. Note that AIC3x codec specific questions are handled in Audio forum.

    Regards,
    Pavel

  • Hi Pavel,

    Is McASP register settings are correct?

    Then where am I going wrong?
    We cannot doubt the hardware as it is running with previous sdk

    Thanks
  • Hi Pavel,

    We had posted the question to the Audio Convertors Forum.
    But we did'nt get any reply.

    e2e.ti.com/.../574579

    Thanks
  • I have taken the dump of gpmc_8 ,gpmc_9, gpmc_10 and gpmc_11 .

    .

    Please check it.

    This does not look correct. You set all the pins in muxmode 7 (GPIO1), not in muxmode 6 (McASP0). Also you set bit 5 of conf_gpmc_a10 to 1, which means mcasp0_axr0 will be input (when muxmode 6 will be selected), while in AM335x EVM/SK axr2 is used as output, goes to DIN pin of the codec.

    Regards,
    Pavel

  • deep ter said:
               sound_master:simple-audio-card,codec {

    There should be a space:

    sound_master: simple-audio-card,codec {

    The rest looks fine.

    Regards,
    Pavel

  • deep ter said:
    Is McASP register settings are correct?

    Which McASP registers settings? Have you ever provide McASP registers settings in this e2e thread? In which post exactly?

    deep ter said:
    Then where am I going wrong?

    For sure McASP0 pinmux is wrong. There might be more things of course.

    Regards,
    Pavel

  • deep ter said:
    We had posted the question to the Audio Convertors Forum.
    But we did'nt get any reply.

    I mean questions specific for the reset management of the Audio Codec in the driver tlv320aic3x.c. I do not mean that you should double ask what we discuss here in the Audio forum (as you do).

    Regards,
    Pavel 

  • HI Pavel,

    I have posted the devmem2 results of the gpmc registers.
    Can you please verify.. Also Can you provide me the pinmux for mcasp0.

    Thanks
  • deep ter said:
    I have posted the devmem2 results of the gpmc registers.
    Can you please verify

    deep ter said:
    Also Can you provide me the pinmux for mcasp0

    Can you send me the latest versions of your DTS file for review? I suspect you overwrite your McASP0 pinmux settings with GPMC pinmux settings.

    Regards,
    Pavel

  • Hi Pavel,

    I have added some printk in davinci-mcasp.c driver. These are the logs I am getting after aplay:

    root@ngt:~# aplay audiocheck1_10th_copy_converted.wav
    Playing WAVE 'audiocheck1_10th_copy_converted.wav' : [ 78.920639] *********Entered davinci_mcasp_set_dai_fmt()1*************
    Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    [ 78.928380] *********Entered davinci_mcasp_set_dai_fmt()2*************
    [ 78.939283] *********SND_SOC_DAIFMT_DSP_B************
    [ 78.944355] *********SND_SOC_DAIFMT_AC97*************
    [ 78.949441] ************case SND_SOC_DAIFMT_CBM_CFM************
    [ 78.955397] ************case SND_SOC_DAIFMT_IB_NF************
    [ 78.961760] tlv320aic3x-codec 1-001b: Unable to sync registers 0x1-0x1. -121

    Thanks
    Deep
  • Hi Pavel,

    One more thing,

    In the working  sdk when I am reading mcasp0 register ( Address: 0x48038000)

    We are getting the following:

    Now, In the new SDK i am not able to access MCASP0 address 0x48038000

    I am getting the following errror:

    Can you explain What is the issue?

    Thanks

  • deep ter said:

    (Please visit the site to view this file)(Please visit the site to view this file)Hi Pavel,

    Please find my dtsi and dts files

    I see in am335x-bone-common.dtsi the below line:

    leds {

    compatible = "gpio-leds";

    gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;

    Which GPIO pins you are using for these leds? There might be a conflict here. Pin V16 (pad GPMC_A8) is used for mcasp0_aclkx (mode 6) and gpio1_24 (mode 7).

    Do you have more DTS/DTSI files that are in use? If yes, please attach. You should look for GPIO1 pins settings that overwrite the McASP0 pins settings.


    Regards,
    Pavel

  • deep ter said:
    In the working  sdk when I am reading mcasp0 register ( Address: 0x48038000)

    deep ter said:
    Now, In the new SDK i am not able to access MCASP0 address 0x48038000

    deep ter said:
    Can you explain What is the issue?

    Check register CM_PER_MCASP0_CLKCTRL. In the new SDK, McASP0 is enabled when aplay/arecord is executed, then disabled when aplay/arecord finish.

    Regards,
    Pavel

  • Thanks Pavel

    I will check and let u know
  • Hi Pavel,

    The gpio-leds in my dtsi file is not used. If you see that portion of dtsi you willl see it is commented.

    There are another two dtsi am33xx.dtsi and am33xx-clocks.dtsi which I have not modified.

    I am attaching the two.

    3426.am33xx-clocks.dtsi.txt

    4530.am33xx.dtsi.txt

    Thanks

    Deep

  • Hi Pavel,

    I have checked the  CM_PER_MCASP0_CLKCTRL Register( Address : 0x44e00000) while playing a song using aplay. Its value suggests that MCASP0 is functional. Kindly see the screen shot

    I have attaching the result.

  • deep ter said:

    The gpio-leds in my dtsi file is not used. If you see that portion of dtsi you willl see it is commented.

    There are another two dtsi am33xx.dtsi and am33xx-clocks.dtsi which I have not modified.

    I am attaching the two.

    I have review your DTS files. In your am335x-boneblack.dts I see the below:

    &mcasp0    {
        #sound-dai-cells = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&mcasp0_pins>;
        pinctrl-1 = <&mcasp0_sleep_pins>;
        status = "okay";
        op-mode = <0>;    /* MCASP_IIS_MODE */
        tdm-slots = <2>;
        serial-dir = <    /* 0: INACTIVE, 1: TX, 2: RX */
                1 2 0 0   /* Changing from 0 0 1 0 to 1 2 0 0 Deshvir [20022017] */
            >;
        tx-num-evt = <32>;
        rx-num-evt = <32>;
    };

    mcasp0_pins: mcasp0_pins {
            pinctrl-single,pins = <
            
                           0x60 (PIN_INPUT_PULLDOWN | MUX_MODE6)/* NGT for codec Deshvir [20022017] */
                            0x64 (PIN_INPUT_PULLDOWN | MUX_MODE6)
                            0x68 (PIN_OUTPUT_PULLDOWN | MUX_MODE6)    
                0x6C (PIN_INPUT_PULLDOWN | MUX_MODE6)         

            
            >;
        };
        
         mcasp0_sleep_pins: mcasp0_sleep_pins {
                            pinctrl-single,pins = <
                
                    0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7) /*NGT for codec Deshvir [20022017]*/
                                    0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                                    0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                                    0x6C (PIN_INPUT_PULLDOWN | MUX_MODE7)
                            >;
                    };

    While in the original am335x-boneblack.dts file we have:

    &mcasp0    {
        #sound-dai-cells = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&mcasp0_pins>;
        status = "okay";
        op-mode = <0>;    /* MCASP_IIS_MODE */
        tdm-slots = <2>;
        serial-dir = <    /* 0: INACTIVE, 1: TX, 2: RX */
                0 0 1 0
            >;
        tx-num-evt = <32>;
        rx-num-evt = <32>;
    };

    mcasp0_pins: mcasp0_pins {
            pinctrl-single,pins = <
                AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */
                AM33XX_IOPAD(0x99c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/
                AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */
                AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */
                AM33XX_IOPAD(0x86c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */
            >;
        };


    Can you try these two things:

    - remove sleep pinmux setup

    - use the approach form the original file to make the pinmux:

    AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE6) /* gpmc_a8.mcasp0_ahclkx */

    or

    AM33XX_IOPAD(0x60, PIN_INPUT_PULLDOWN | MUX_MODE6) /* gpmc_a8.mcasp0_ahclkx */

    You should use 0x60 or 0x860 depending on the base address you have selected.

    Regards,
    Pavel

  • I have checked the  CM_PER_MCASP0_CLKCTRL Register( Address : 0x44e00000) while playing a song using aplay. Its value suggests that MCASP0 is functional. Kindly see the screen shot

    I have attaching the result.

    Can you dump the McASP0 pinmux registers in the beginning of mcasp_start_tx() function?

    Regards,
    Pavel

  • Hi Pavel,

    Please find the MCASP0 Register dump in the logs:

    root@ngt:~# Playing WAVE 'audiocheck1_10th_copy_converted.wav' : [   91.191808] *********Entered davinci_mcasp_set_dai_fmt()1*************
    Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    [   91.199435] *********Entered davinci_mcasp_set_dai_fmt()2*************
    [   91.210605] *********SND_SOC_DAIFMT_DSP_B************
    [   91.215701] *********SND_SOC_DAIFMT_AC97*************
    [   91.220774] ************case SND_SOC_DAIFMT_CBM_CFM************
    [   91.226733] ************case SND_SOC_DAIFMT_IB_NF************
    [   91.253227] tlv320aic3x-codec 1-001b: Unable to sync registers 0x1-0x1. -121
    [   91.260346] **********The bias level is********2
    [   91.266175] **********The bias level is********3
    [   91.279895] The value of addr 0x48038000 is 44307b02
    [   91.284734] Register with address 0x48038010 is  PIN FUNC REG)  0
    [   91.290853] Register with address 0x480380a0 is  DAVINCI_MCASP_GBLCTLX_REG 1f00
    [   91.298191] Register with address 0x48038014 is PDIR Register  1
    [   91.304220] Register with address 0x48038018 is PDOUT Register  0
    [   91.310335] Register with address 0x4803801c is PDIN Register  0

     

    I have checked in the AM335x TRM, these values looks fine.

    I am not understanding the issue :(

    Thanks

     

  • deep ter said:
    Please find the MCASP0 Register dump in the logs:

    I asked about McASP0 pinmux register dump, not McASP0 module register dump.

    deep ter said:
    I am not understanding the issue :(

    I explained several times, but you aways debug in the wrong undefined direction. McASP0 pinmux is the issue.