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.

AM6548: No RHPOUT when aplay stereo sound

Part Number: AM6548
Other Parts Discussed in Thread: AM6528,

We use am6528 + tlv320aic23, now it can work in I2S mode, but only left channel output sound normally, there is no output with RHPOUT, we measure the signal of FS and AXR0 with oscilloscope: no right channel data on AXR0 line when FS signal stay high.

FS: blue color            AXR0: green color

related configure in dts list as follow:

sound {
                compatible = "simple-audio-card";
                simple-audio-card,name = "AM65x-GHMI+";
                simple-audio-card,widgets =
                        "Headphone", "Headphone Jack";
                simple-audio-card,routing =
                        "Headphone Jack",       "LHPOUT",
                        "Headphone Jack",       "RHPOUT";

                simple-audio-card,format = "i2s";
                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 = <&tlv320aic23>;
                        system-clock-frequency = <12000000>;
                };
        };


.........

mcasp1_pins: mcasp1-pins {
                pinctrl-single,pins = <
                        AM65X_IOPAD(0x0244, PIN_INPUT_PULLDOWN, 5) /* (AB28) PRG0_PRU1_GPO0.MCASP1_ACLKX */
                        AM65X_IOPAD(0x0248, PIN_INPUT_PULLDOWN, 5) /* (AC28) PRG0_PRU1_GPO1.MCASP1_AFSX */
                        AM65X_IOPAD(0x0254, PIN_INPUT_PULLDOWN, 5) /* (AA25) PRG0_PRU1_GPO4.MCASP1_AXR0 */
                >;
        };

.........

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

                /* Regulators 
                AVDD-supply = <&codec_vcc_3v3>;
                IOVDD-supply = <&gp_vcc_1v8>;
                DRVDD-supply = <&codec_vcc_3v3>;
                DVDD-supply = <&gp_vcc_1v8>;*/
        };
........

&mcasp1 {
        #sound-dai-cells = <0>;
        status = "okay";

        pinctrl-names = "default";
        pinctrl-0 = <&mcasp1_pins>;
        op-mode = <0>;          /* MCASP_IIS_MODE */
        tdm-slots = <2>;
        /* 16 serializers */
        /* num-serializer = <10>;*/
        serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
                1 0 0 0
                0 0 0 0
                0 0
        >;
        tx-num-evt = <32>;
        rx-num-evt = <32>;
};

are there anything wrong about the configuration of simple-audio-card or mcasp1?

Thanks

Kenn

  • Hi Kenn,

    Give me a day/two to respond back, as the codec you are using is gone obsolete, I will check internally and get back.

    In the meantime, did you see the same behavior if you change it to LOUT and ROUT (Lineout instead of headphone)?

    Also, if you can provide the register dumps in order to debug.

    Best Regards,

    Suren

  • Thanks, Suren,

    I had changed it to LOUT and ROUT, but the result is the same, and  also: no right channel data on AXR0 line when FS signal stay high

    can you provide us with the exact register address you want?

    Thanks

    Kenn

  • Hi Kun

    Can you offer amixer log with me?

  • Hi, Shenghao Ding

    root@am65xx-evm:~# amixer scontrols
    Simple mixer control 'Sidetone',0
    Simple mixer control 'Line',0
    Simple mixer control 'Line Input',0
    Simple mixer control 'Mic',0
    Simple mixer control 'Mic Booster',0
    Simple mixer control 'Mic Input',0
    Simple mixer control 'Playback De-emphasis',0
    Simple mixer control 'Digital',0
    Simple mixer control 'Output Mixer',0
    Simple mixer control 'Output Mixer Line Bypass',0
    Simple mixer control 'Output Mixer Mic Sidetone',0
    root@am65xx-evm:~# dmesg | grep amixer
    root@am65xx-evm:~# [ 129.704289] Initializing XFRM netlink socket
    
    root@am65xx-evm:~# amixer scontents
    Simple mixer control 'Sidetone',0
    Capabilities: volume volume-joined
    Playback channels: Mono
    Capture channels: Mono
    Limits: 0 - 4
    Mono: 3 [75%] [-9.00dB]
    Simple mixer control 'Line',0
    Capabilities: cswitch cswitch-joined cswitch-exclusive
    Capture exclusive group: 0
    Capture channels: Mono
    Mono: Capture [off]
    Simple mixer control 'Line Input',0
    Capabilities: volume pswitch
    Playback channels: Front Left - Front Right
    Capture channels: Front Left - Front Right
    Limits: 0 - 31
    Front Left: 23 [74%] [0.00dB] Playback [off]
    Front Right: 23 [74%] [0.00dB] Playback [off]
    Simple mixer control 'Mic',0
    Capabilities: cswitch cswitch-joined cswitch-exclusive
    Capture exclusive group: 0
    Capture channels: Mono
    Mono: Capture [on]
    Simple mixer control 'Mic Booster',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'Mic Input',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'Playback De-emphasis',0
    Capabilities: enum
    Items: 'None' '32Khz' '44.1Khz' '48Khz'
    Item0: '44.1Khz'
    Simple mixer control 'Digital',0
    Capabilities: pvolume pswitch pswitch-joined
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 127
    Mono:
    Front Left: Playback 112 [88%] [-9.00dB] [on]
    Front Right: Playback 112 [88%] [-9.00dB] [on]
    Simple mixer control 'Output Mixer',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'Output Mixer Line Bypass',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'Output Mixer Mic Sidetone',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    
    
    root@am65xx-evm:~# amixer controls
    numid=3,iface=MIXER,name='Line Input Switch'
    numid=4,iface=MIXER,name='Line Input Volume'
    numid=6,iface=MIXER,name='Mic Booster Switch'
    numid=5,iface=MIXER,name='Mic Input Switch'
    numid=9,iface=MIXER,name='Capture Source'
    numid=8,iface=MIXER,name='Playback De-emphasis'
    numid=2,iface=MIXER,name='Digital Playback Switch'
    numid=1,iface=MIXER,name='Digital Playback Volume'
    numid=10,iface=MIXER,name='Output Mixer Line Bypass Switch'
    numid=11,iface=MIXER,name='Output Mixer Mic Sidetone Switch'
    numid=12,iface=MIXER,name='Output Mixer Playback Switch'
    numid=7,iface=MIXER,name='Sidetone Volume'
    
    
    root@am65xx-evm:~# amixer contents
    numid=3,iface=MIXER,name='Line Input Switch'
    ; type=BOOLEAN,access=rw------,values=2
    : values=off,off
    numid=4,iface=MIXER,name='Line Input Volume'
    ; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
    : values=23,23
    | dBscale-min=-17.25dB,step=0.75dB,mute=0
    numid=6,iface=MIXER,name='Mic Booster Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=5,iface=MIXER,name='Mic Input Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=on
    numid=9,iface=MIXER,name='Capture Source'
    ; type=ENUMERATED,access=rw------,values=1,items=2
    ; Item #0 'Line'
    ; Item #1 'Mic'
    : values=1
    numid=8,iface=MIXER,name='Playback De-emphasis'
    ; type=ENUMERATED,access=rw------,values=1,items=4
    ; Item #0 'None'
    ; Item #1 '32Khz'
    ; Item #2 '44.1Khz'
    ; Item #3 '48Khz'
    : values=2
    numid=2,iface=MIXER,name='Digital Playback Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=on
    numid=1,iface=MIXER,name='Digital Playback Volume'
    ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
    : values=112,112
    | dBscale-min=-121.00dB,step=1.00dB,mute=0
    numid=10,iface=MIXER,name='Output Mixer Line Bypass Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=11,iface=MIXER,name='Output Mixer Mic Sidetone Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=12,iface=MIXER,name='Output Mixer Playback Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=on
    numid=7,iface=MIXER,name='Sidetone Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=4,step=0
    : values=3
    | dBscale-min=-18.00dB,step=3.00dB,mute=0

    are these info enough?

  • Kindly use amixer to set output to stereo instead of mono.

  • Hi, Shenghao Ding

    I tried to change the value of " Output Mixer", but it didn't work.

    How to use amixer to set output to stereo instead of mono?  is there a document about it? 

    I also felt strange that tlv320aic23.c indicate its minimal playback channels = 2, but actually, it is Mono mode, what's wrong with it?

    Thanks

    Kenn

  • Kindly dump the register to me.

    Have you set the amixer before aplay?

  • Thanks, Shenghao Ding

    Yes, I set the amixer before aplay,  but I didn't find the right amixer command to configure it to work in stereo mode, it seemed no simple control or control to configure stereo mode, or it was just because I didn't know.

    By the way, I can use devmem2 to dump some related Mcasp registers, but I don't know how to dump related registers on codec tlv320aic23, I had tried to use I2C read command to read its register, but the system indicated that the I2C device was occupied, can you tell us other methods to dump codec's registers?

    MCASP_GBLCTL
    
    root@am65xx-evm:~# devmem2 0x02B10044
    /dev/mem opened.
    Memory mapped at address 0xffff9d3c0000.
    Read at address 0x02B10044 (0xffff9d3c0044): 0x00000000
    
    MCASP_AMUTE
    
    root@am65xx-evm:~# devmem2 0x02B10048
    /dev/mem opened.
    Memory mapped at address 0xffffbdb50000.
    Read at address 0x02B10048 (0xffffbdb50048): 0x00000000
    
    MCASP_PID
    
    root@am65xx-evm:~# devmem2 0x02B10000
    /dev/mem opened.
    Memory mapped at address 0xffff82b50000.
    Read at address 0x02B10000 (0xffff82b50000): 0x44307B02
    
    MCASP_PFUNC
    
    root@am65xx-evm:~# devmem2 0x02B10010
    /dev/mem opened.
    Memory mapped at address 0xffff88990000.
    Read at address  0x02B10010 (0xffff88990010): 0x00000000
    
    MCASP_XRSRCTL0
    
    root@am65xx-evm:~# devmem2 0x02B10180
    /dev/mem opened.
    Memory mapped at address 0xffff99f90000.
    Read at address  0x02B10180 (0xffff99f90180): 0x00000019
    
    MCASP_TXSTAT
    
    root@am65xx-evm:~# devmem2 0x02B100C0
    /dev/mem opened.
    Memory mapped at address 0xffff95a10000.
    Read at address  0x02B100C0 (0xffff95a100c0): 0x0000010C
    
    MCASP_GBLCTLX
    
    root@am65xx-evm:~# devmem2 0x02B100A0
    /dev/mem opened.
    Memory mapped at address 0xffff97e30000.
    Read at address  0x02B100A0 (0xffff97e300a0): 0x00000000
    
    MCASP_GBLCTLR
    
    root@am65xx-evm:~# devmem2 0x02B10060
    /dev/mem opened.
    Memory mapped at address 0xffff88b30000.
    Read at address  0x02B10060 (0xffff88b30060): 0x00000000
    
    MCASP_TXMASK
    root@am65xx-ghmi:~# devmem2 0x02B100A4
    /dev/mem opened.
    Memory mapped at address 0xffffb64a0000.
    Read at address  0x02B100A4 (0xffffb64a00a4): 0x0000FFFF
    
    MCASP_TXFMT
    root@am65xx-ghmi:~# devmem2 0x02B100A8
    /dev/mem opened.
    Memory mapped at address 0xffffa09a0000.
    Read at address  0x02B100A8 (0xffffa09a00a8): 0x00008074
    
    MCASP_TXFMCTL
    root@am65xx-ghmi:~# devmem2 0x02B100AC
    /dev/mem opened.
    Memory mapped at address 0xffff991b0000.
    Read at address  0x02B100AC (0xffff991b00ac): 0x00000100
    
    MCASP_ACLKXCTL
    root@am65xx-evm:~# devmem2 0x02B100B0
    /dev/mem opened.
    Memory mapped at address 0xffffb8490000.
    Read at address  0x02B100B0 (0xffffb84900b0): 0x00180000
    
    MCASP_AHCLKXCTL
    root@am65xx-evm:~# devmem2 0x02B100B4
    /dev/mem opened.
    Memory mapped at address 0xffff93dd0000.
    Read at address  0x02B100B4 (0xffff93dd00b4): 0x00000000
    

    Thanks

    Kenn

  • #i2cdump -y -f 0 4c
    0 is i2c bus no
    4c is 7-bit i2c device address

    Can you tell me the left amixer you used?
  • The am6528 is not sending data on right channel.

    Make sure the driver and am6528 are configured to send stereo data.

  • Hi Kenn,

    Can you also try changing the audio_format to dsp_b instead of i2s.

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

    Best Regards

    Suren

  • Thanks Shenghao Ding

    I had tried the method you given, but it appeared error as follow:

    root@am65xx-evm:/dev# i2cdump -y -f 3 0x1b
    No size specified (using byte-data access)
    [  380.890446] omap_i2c 2010000.i2c: Arbitration lost
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: XX [  383.921159] omap_i2c 2010000.i2c: controller timed out
    XX [  383.941260] omap_i2c 2010000.i2c: Arbitration lost
    XX [  386.993146] omap_i2c 2010000.i2c: controller timed out
    XX [  387.021290] omap_i2c 2010000.i2c: Arbitration lost
    XX [  390.065156] omap_i2c 2010000.i2c: controller timed out
    XX [  390.085270] omap_i2c 2010000.i2c: Arbitration lost
    XX [  393.137154] omap_i2c 2010000.i2c: controller timed out
    XX [  393.165261] omap_i2c 2010000.i2c: Arbitration lost
    XX [  396.209148] omap_i2c 2010000.i2c: controller timed out
    XX [  396.229269] omap_i2c 2010000.i2c: Arbitration lost
    XX [  399.281148] omap_i2c 2010000.i2c: controller timed out
    XX [  399.309262] omap_i2c 2010000.i2c: Arbitration lost
    XX [  402.353147] omap_i2c 2010000.i2c: controller timed out
    XX [  402.381275] omap_i2c 2010000.i2c: Arbitration lost
    XX [  405.425149] omap_i2c 2010000.i2c: controller timed out
    XX    XXXXXXXXXXXXXXXX
    10: [  405.453274] omap_i2c 2010000.i2c: Arbitration lost
    XX [  408.497165] omap_i2c 2010000.i2c: controller timed out
    XX [  408.525272] omap_i2c 2010000.i2c: Arbitration lost
    XX [  411.569151] omap_i2c 2010000.i2c: controller timed out
    XX [  411.597271] omap_i2c 2010000.i2c: Arbitration lost
    XX [  414.641148] omap_i2c 2010000.i2c: controller timed out
    XX [  414.661271] omap_i2c 2010000.i2c: Arbitration lost
    XX [  417.713151] omap_i2c 2010000.i2c: controller timed out
    XX [  417.741272] omap_i2c 2010000.i2c: Arbitration lost
    XX [  420.785164] omap_i2c 2010000.i2c: controller timed out
    XX [  420.813267] omap_i2c 2010000.i2c: Arbitration lost
    XX [  423.857146] omap_i2c 2010000.i2c: controller timed out
    XX [  423.877271] omap_i2c 2010000.i2c: Arbitration lost
    XX [  426.929153] omap_i2c 2010000.i2c: controller timed out
    XX [  426.957270] omap_i2c 2010000.i2c: Arbitration lost
    XX [  430.001177] omap_i2c 2010000.i2c: controller timed out
    XX    XXXXXXXXXXXXXXXX
    20: [  430.029276] omap_i2c 2010000.i2c: Arbitration lost
    XX [  433.073154] omap_i2c 2010000.i2c: controller timed out
    XX [  433.093274] omap_i2c 2010000.i2c: Arbitration lost
    XX [  436.145150] omap_i2c 2010000.i2c: controller timed out
    XX [  436.173271] omap_i2c 2010000.i2c: Arbitration lost
    XX [  439.217148] omap_i2c 2010000.i2c: controller timed out
    XX [  439.245270] omap_i2c 2010000.i2c: Arbitration lost
    XX [  442.289153] omap_i2c 2010000.i2c: controller timed out
    XX [  442.309272] omap_i2c 2010000.i2c: Arbitration lost
    XX [  445.361148] omap_i2c 2010000.i2c: controller timed out
    XX [  445.389290] omap_i2c 2010000.i2c: Arbitration lost
    XX [  448.433149] omap_i2c 2010000.i2c: controller timed out
    XX [  448.461267] omap_i2c 2010000.i2c: Arbitration lost
    XX [  451.505154] omap_i2c 2010000.i2c: controller timed out
    XX [  451.533267] omap_i2c 2010000.i2c: Arbitration lost
    XX [  454.577164] omap_i2c 2010000.i2c: controller timed out
    XX    XXXXXXXXXXXXXXXX
    30: [  454.605271] omap_i2c 2010000.i2c: Arbitration lost
    XX [  457.649153] omap_i2c 2010000.i2c: controller timed out
    XX [  457.677268] omap_i2c 2010000.i2c: Arbitration lost
    XX [  460.721153] omap_i2c 2010000.i2c: controller timed out
    XX [  460.749275] omap_i2c 2010000.i2c: Arbitration lost
    XX [  463.793154] omap_i2c 2010000.i2c: controller timed out
    XX [  463.821263] omap_i2c 2010000.i2c: Arbitration lost
    XX [  466.865149] omap_i2c 2010000.i2c: controller timed out
    XX [  466.885270] omap_i2c 2010000.i2c: Arbitration lost
    XX [  469.937150] omap_i2c 2010000.i2c: controller timed out
    XX [  469.957273] omap_i2c 2010000.i2c: Arbitration lost
    XX [  473.009151] omap_i2c 2010000.i2c: controller timed out
    XX [  473.037267] omap_i2c 2010000.i2c: Arbitration lost
    XX [  476.081154] omap_i2c 2010000.i2c: controller timed out
    XX [  476.109264] omap_i2c 2010000.i2c: Arbitration lost
    XX [  479.153160] omap_i2c 2010000.i2c: controller timed out
    XX    XXXXXXXXXXXXXXXX
    40: [  479.181266] omap_i2c 2010000.i2c: Arbitration lost
    ........
    
    XX    XXXXXXXXXXXXXXXX
    f0: [  749.517281] omap_i2c 2010000.i2c: Arbitration lost
    XX [  752.561162] omap_i2c 2010000.i2c: controller timed out
    XX [  752.589267] omap_i2c 2010000.i2c: Arbitration lost
    XX [  755.633178] omap_i2c 2010000.i2c: controller timed out
    XX [  755.653278] omap_i2c 2010000.i2c: Arbitration lost
    XX [  758.705150] omap_i2c 2010000.i2c: controller timed out
    XX [  758.733270] omap_i2c 2010000.i2c: Arbitration lost
    XX [  761.777148] omap_i2c 2010000.i2c: controller timed out
    XX [  761.805269] omap_i2c 2010000.i2c: Arbitration lost
    XX [  764.849147] omap_i2c 2010000.i2c: controller timed out
    XX [  764.877262] omap_i2c 2010000.i2c: Arbitration lost
    XX [  767.921148] omap_i2c 2010000.i2c: controller timed out
    XX [  767.949268] omap_i2c 2010000.i2c: Arbitration lost
    XX [  770.993160] omap_i2c 2010000.i2c: controller timed out
    XX [  771.021263] omap_i2c 2010000.i2c: Arbitration lost
    XX [  774.065148] omap_i2c 2010000.i2c: controller timed out
    XX    XXXXXXXXXXXXXXXX
    
    

    is it a timing issue? do we need to check I2C timing issue? there are also other two devices on this i2c bus, these two devices works fine, it's strange!

    Thanks

    Kenn

  • The am6528 is not sending data on right channel.

    Make sure the driver and am6528 are configured to send stereo data.

    Thanks pdjuandi, 

    How to make sure that am6528 are configured to send stereo data? the only setting in dts I found is to set its mode in "i2s", now its output is mono because of waveform and amixer's result,  can you tell me the other setting about this stereo output?

    Thanks

    Kenn

  • Hello Suren

    Can you also try changing the audio_format to dsp_b instead of i2s.

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

     Its rhpout will output noise when I change its mode from "i2s" to "dsp_b", but lhpout output is good .

    Thanks

    Kenn

  • Yes, it is impossible. Other i2c devices can work fine, while the code can't work.

  • II check the dts setting for the code, it is set as the master. Pls check whether the audio data from AP to codec is stereo.

  • II check the dts setting for the code, it is set as the master. Pls check whether the audio data from AP to codec is stereo.

    In I2S mode, when FS signal stay high, AXR0 signal should output  Right channel data, but the signal on our board didn't have any data on AXR0 at that time, you can see the waveform on my first post.

    Thanks

    Kenn

  • I'm not familiar with AM6528 or the driver, from codec point of view the data coming in on right channel is empty.

    Suren/Shenghao might be able to direct you.

  • Can you share the schematic on the connection between tlv320aic23 and AM6528?

  • Thanks Shenghao Ding!

    Kenn

  • Confirm from you that, the signal is from SDIN, right?

  • the signal from DIN, SDIN is I2C data pin。

  • Have you measured the waveform on DIN pin with scope?

  • DIN is the AXR0 signal, you can see this waveform in my first post.

  • I'm not familiar with AM6528 or the driver, from codec point of view the data coming in on right channel is empty.

    Suren/Shenghao might be able to direct you.

    Thanks a lot, pdjuandi

  • In the wave form, there's no signal in the right channel of DIN. The right channel of audio source is no signal, so why do you want RHPOUT to generate the signal?

  • our product needs stereo output, now only the left channel has sound, it is unacceptable.

    is it a bug for I2S mode on am6528?  I didn't find it in the " known issues " from the release note.

    Thanks

    Kenn

  • Can you share the wav file you tested?

  • it's not the problem with the wav file, I tested it in my old product(am335x), and that's fine, and I also downloaded the other stereo wav file from the internet, the same behaviour.

  • Hi, Shenghao Ding

    why is there no rhpout data in I2S mode? it's a bug or not.

    Thanks

    Kenn

  • Kindly consult the platform vendor on the no signal from the right channel of the audio source.

  • Kindly consult the platform vendor on the no signal from the right channel of the audio source.

     I don't understand what's your means about " the platform vendor", am6528 and tlv320aic23 are both from TI, right? or you found that the audio source(wave file) had a problem?

    Thanks

  • I belong to LPA, focus on audio codec support. So far, your question is to ask for the am6528 support to help fix the issue of audio data only in left channel, none in right channel. After that fixing, we can go on check no sound in RHPOUT.

  • Ok, got it, thank you for your info.

  • Hi  Kenn,

    Can you point us which file are you referring to create the dts file? Please refer the below link for reference:

    https://lore.kernel.org/linux-arm-kernel/9d22e2a9-ed36-8687-cc99-e0798bac4d68@ti.com/T/

    Also, can you take the oscilloscope waveform for Data Out and Frame Sync on AM335x, where audio seems to be working fine along with McASP register dumps.

    As far as I know, MCASP on AM6548 supports dsp_b format only. Please share the dts file with modifying to dsp_b format as simple-audio-format and share us the oscilloscope waveforms.

    Best Regards,

    Suren

  • Hi, Suren

    Thanks for your info, we had confirmed the content of the link you provided.

    Also, can you take the oscilloscope waveform for Data Out and Frame Sync on AM335x, where audio seems to be working fine along with McASP register dumps.

    C1-BCLK; C2-AXR0;C3-FS

    Please share the dts file with modifying to dsp_b format as simple-audio-format and share us the oscilloscope waveforms.

    sound {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "AM65x-GHMI+";
                    simple-audio-card,widgets =
                            "Headphone", "Headphone Jack";
                    simple-audio-card,routing =
                            "Headphone Jack",       "LHPOUT",
                            "Headphone Jack",       "RHPOUT";
    
                    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 = <&tlv320aic23>;
                            system-clock-frequency = <12000000>;
                    };
            };
    
    
    .........
    
    mcasp1_pins: mcasp1-pins {
                    pinctrl-single,pins = <
                            AM65X_IOPAD(0x0244, PIN_INPUT_PULLDOWN, 5) /* (AB28) PRG0_PRU1_GPO0.MCASP1_ACLKX */
                            AM65X_IOPAD(0x0248, PIN_INPUT_PULLDOWN, 5) /* (AC28) PRG0_PRU1_GPO1.MCASP1_AFSX */
                            AM65X_IOPAD(0x0254, PIN_INPUT_PULLDOWN, 5) /* (AA25) PRG0_PRU1_GPO4.MCASP1_AXR0 */
                    >;
            };
    
    .........
    
    tlv320aic23: tlv320aic23@1b {
                    #sound-dai-cells = <0>;
                    compatible = "ti,tlv320aic23";
                    reg = <0x1b>;
                    status = "okay";
    
                    /* Regulators 
                    AVDD-supply = <&codec_vcc_3v3>;
                    IOVDD-supply = <&gp_vcc_1v8>;
                    DRVDD-supply = <&codec_vcc_3v3>;
                    DVDD-supply = <&gp_vcc_1v8>;*/
            };
    ........
    
    &mcasp1 {
            #sound-dai-cells = <0>;
            status = "okay";
    
            pinctrl-names = "default";
            pinctrl-0 = <&mcasp1_pins>;
            op-mode = <0>;          /* MCASP_IIS_MODE */
            tdm-slots = <2>;
            /* 16 serializers */
            /* num-serializer = <10>;*/
            serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
                    1 0 0 0
                    0 0 0 0
                    0 0
            >;
            tx-num-evt = <32>;
            rx-num-evt = <32>;
    };

    C1-FS;C2-AXR0

    Related Mcasp1 and codec's register on am335x platform list as follow:

    root@am335x-evm:~# devmem2 0x4803C0A0
    /dev/mem opened.
    Memory mapped at address 0xb6fdc000.
    Read at address  0x4803C0A0 (0xb6fdc0a0): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0A4
    /dev/mem opened.
    Memory mapped at address 0xb6f26000.
    Read at address  0x4803C0A4 (0xb6f260a4): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0A8
    /dev/mem opened.
    Memory mapped at address 0xb6f6c000.
    Read at address  0x4803C0A8 (0xb6f6c0a8): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0AC
    /dev/mem opened.
    Memory mapped at address 0xb6fce000.
    Read at address  0x4803C0AC (0xb6fce0ac): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0B0
    /dev/mem opened.
    Memory mapped at address 0xb6f45000.
    Read at address  0x4803C0B0 (0xb6f450b0): 0x00000060
    root@am335x-evm:~# devmem2 0x4803C0B4
    /dev/mem opened.
    Memory mapped at address 0xb6fbc000.
    Read at address  0x4803C0B4 (0xb6fbc0b4): 0x00008000
    root@am335x-evm:~# devmem2 0x4803C0B8
    /dev/mem opened.
    Memory mapped at address 0xb6f70000.
    Read at address  0x4803C0B8 (0xb6f700b8): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0BC
    /dev/mem opened.
    Memory mapped at address 0xb6f3a000.
    Read at address  0x4803C0BC (0xb6f3a0bc): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0C0
    /dev/mem opened.
    Memory mapped at address 0xb6f2a000.
    Read at address  0x4803C0C0 (0xb6f2a0c0): 0x0000010C
    root@am335x-evm:~# devmem2 0x4803C0C4
    /dev/mem opened.
    Memory mapped at address 0xb6f10000.
    Read at address  0x4803C0C4 (0xb6f100c4): 0x0000017F
    root@am335x-evm:~# devmem2 0x4803C0C8
    /dev/mem opened.
    Memory mapped at address 0xb6fd6000.
    Read at address  0x4803C0C8 (0xb6fd60c8): 0x00000000
    root@am335x-evm:~# devmem2 0x4803C0CC
    /dev/mem opened.
    Memory mapped at address 0xb6f32000.
    Read at address  0x4803C0CC (0xb6f320cc): 0x00000000
    
    --------------------------------------------------------------------
    root@am335x-evm:~# i2cdump -y -f 0 0x1b
    No size specified (using byte-data access)[   85.629665] omap_i2c 44e0b000.i2c: Arbitration lost
    
         0  1  2  3  4  5  6  7  8  9  a  b  c  d [   85.638401] omap_i2c 44e0b000.i2c: Arbitration lost
     e  f    0123456789abcdef
    00: XX XX [   85.647486] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.655923] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.673395] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.693442] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.713397] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.733462] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.753382] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.773427] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.793385] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.813428] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.833385] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.853411] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.873382] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.893415] omap_i2c 44e0b000.i2c: Arbitration lost
    XX    XXXXXXXXXXXXXXXX
    10: [   85.913465] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.933424] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.953373] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.973431] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   85.993383] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.013427] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.033377] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.053453] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.073394] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.093437] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.113391] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.133426] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.153372] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.173436] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.193384] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.213429] omap_i2c 44e0b000.i2c: Arbitration lost
    XX    XXXXXXXXXXXXXXXX
    20: [   86.233432] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.253416] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.273380] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.293419] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.313388] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.333425] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.353378] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.373429] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.393393] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.413428] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.433381] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.453415] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.473381] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.493423] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.513389] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.533416] omap_i2c 44e0b000.i2c: Arbitration lost
    XX    XXXXXXXXXXXXXXXX
    30: [   86.553419] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.573424] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.593398] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.613439] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.618820] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.643378] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.663393] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.683372] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.703383] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.723443] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.743397] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.763387] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.783383] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.803378] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.823383] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.843374] omap_i2c 44e0b000.i2c: Arbitration lost
    XX    XXXXXXXXXXXXXXXX
    40: [   86.863437] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.883373] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.903374] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.923381] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.943385] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.963383] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   86.983379] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.003378] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.023384] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.044138] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.063397] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.083375] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.103376] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.123631] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.143385] omap_i2c 44e0b000.i2c: Arbitration lost
    XX [   87.163390] omap_i2c 44e0b000.i2c: Arbitration lost
    XX    XXXXXXXXXXXXXXXX
    
    
    

    Thanks

    Kenn

  • Suren,

    I compared the register dump of AM335x and AM654x, there are difference, not sure what is wrong in AM654x .dts configuration:

    Reg Name

    offset AM335x    AM654x  
    XGBLCTL A0h 0x0000 1F00
    TXMASK A4h  0xffffffff   0x0000FFFF  
    TXFMT A8h  0x0000 80f0

     bit[7:4]=fh: slot size is 32bits

    bit[2:0]=0: no rotate

    0x00008074 bit 15: XRVRS=1 MSB first
    bit[7:4] 7h: slot size is 16bits
    bit[2:0]=4: rotate right by 16bit position
    AFSXCTL ACh 0x0000 0100

    bit[15:7]=2: 2-slot(I2S mode)

    bit 1=0: Externally-generated transmit frame sync

    0x0000 0100

    bit[15:7]-2: 2-slot(I2S mode)

    bit1=0: Externally-generated transmit frame sync

    ACLKXCTL B0h 0x0000 0000 bit 6=1 ASYNC Separate clock and frame sync used by transmit
    and receive sections.
    bit 5=0 CLKXM: External transmit clock source from ACLKX pin
    0x0018 0000 bit 6=0: SYNC: Transmit clock and frame sync provides the
    source for both the transmit and receive sections.
    bit 5=0: CLKXM: External transmit clock source from ACLKX pin
    AHCLKXCTL B4h 0x0000 8000 bit 15=1: Internal transmit high-frequency clock source from output of programmable high clock divider 0x0 bit 15=0: HCLKXM: External transmit high-frequency clock source from AHCLKX pin.
               
    TXTDM B8h 0x03      
    TXSTAT C0h 0x156 bit 8: XERR    
    bit3: XTDMSLOT
    bit 2: XCKFAIL.
    TXTDMSLOT C4h 0x0000 017F Current XMT time slot count during reset the value of this register is    
    0b0101111111 [0x17f] and after reset 0
    TXCLKCHK C8h 0x00000000      
    XEVTCTL CCh 0x00000000      

  • Hi Kenn,

    I saw the MMR in McASP in your previous replies:

    MCASP_TXFMCTL
    root@am65xx-ghmi:~# devmem2 0x02B100AC
    /dev/mem opened.
    Memory mapped at address 0xffff991b0000.
    Read at address 0x02B100AC (0xffff991b00ac): 0x00000100

    From the TRM:  Section 12.5.4.2.3

    Frame sync mode - the appropriate frame sync generation pattern for the selected transfer mode is defined in the MCASP_TXFMCTL[15-7] XMOD bit field, as follows:

    – For DIT mode (384 slots) - MCASP_TXFMCTL[15-7] XMOD = 0x180

    For I2S mode (2 TDM slots) - MCASP_TXFMCTL[15-7] XMOD = 0x2

    – For TDM mode (from 3 to 32 TDM slots) - MCASP_TXFMCTL[15-7] XMOD bit field set in range 0x3 - 0x20

    Also XTDM should have 0x00000003 in  it to indicate transmit is active in both slots.

    You can also check XSTAT for any error bits set.

    If you were to write the registers with correct values, can you confirm playing the output in stereo?

    Best Regards,

    Suren 

  • Hi, Suren

    The current value of MCASP_TXFMCTL is 0x00000100, its MCASP_TXFMCTL[15-7] XMOD = 0x2 (I2S mode), do you want us to configure it to MCASP_TXFMCTL[15-7] XMOD = 0x3(3 TDM slots)?  change the value of MCASP_TXFMCTL to 0x00000180?

    if yes, I didn't understand your intention. lhpout and rhpout need two slots for transferring data, what's the usage of the rest slot?

    Thanks

    Kenn

  • With the help of Tony, we configured the MCASP_TXTDM(0x02B100B8) register to the value of 0x00000003, but the rhpout is still noise.

    Thanks

    Kenn

  • I did same test on AM62-sk board. can here stereo, during play audio read codec register, it show codec is master. after audio ended, read codec register again, it return to default value. 

    root@am62xx-evm:~# aplay -Dplughw:0,0 4426.test.wav&
    [1] 504056
    root@am62xx-evm:~# Playing WAVE '4426.test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    root@am62xx-evm:~# i2cget -f 1 0x1b 8
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will read from device file /dev/i2c-1, chip address 0x1b, data address
    0x08, using read byte data.
    Continue? [Y/n] y
    0xc0


    root@am62xx-evm:~# i2cget -f 1 0x1b 9
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will read from device file /dev/i2c-1, chip address 0x1b, data address
    0x09, using read byte data.
    Continue? [Y/n] y
    0x40


    root@am62xx-evm:~# [ 4556.689706] ti-bcdma 485c0100.dma-controller: chan1 teardown timeout!
    ^C
    [1]+ Done aplay -Dplughw:0,0 4426.test.wav
    root@am62xx-evm:~# i2cget -f 1 0x1b 9
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will read from device file /dev/i2c-1, chip address 0x1b, data address
    0x09, using read byte data.
    Continue? [Y/n] y
    0x00
    root@am62xx-evm:~#

    but can't read McASP registers, no matter from command line devmem2 or from CCS JTAG physical address view. Even read from M4, all are 0.

    root@am62xx-evm:~#
    root@am62xx-evm:~# devmem2 0x02b10000
    /dev/mem opened.Unhandled Exception in EL3.
    x30 = 0x000000009e780f88
    x0 = 0x0000ffffcb3b89a0
    x1 = 0x0000000000401030
    x2 = 0x0000000000000008
    x3 = 0x0000000000000000
    x4 = 0x0000000000000000
    x5 = 0x000000003353a2c9
    x6 = 0x000000000000002e
    x7 = 0x000000000000000a
    x8 = 0x0000000000000040
    x9 = 0xffffff80ffffffc8
    x10 = 0x0000000000000000
    x11 = 0x0000ffffcb3b8820
    x12 = 0x000000000000000c
    x13 = 0x0000000000000010
    x14 = 0x0000000000000001
    x15 = 0x0000000000000000
    x16 = 0x0000000000412068
    x17 = 0x0000ffff9c79ad58
    x18 = 0x0000000000000000
    x19 = 0x0000ffff9c8d1000
    x20 = 0x0000000000001000
    x21 = 0x0000000002b10000
    x22 = 0x0000000000000002
    x23 = 0x0000000000000003
    x24 = 0x0000ffffcb3b89a0
    x25 = 0x0000ffffcb3b8b68
    x26 = 0x0000ffff9c8d1000
    x27 = 0x0000000000412000
    x28 = 0x0000000000000000
    x29 = 0x0000ffffcb3b8930
    scr_el3 = 0x000000000000073d
    sctlr_el3 = 0x0000000030cd183f
    cptr_el3 = 0x0000000000000000
    tcr_el3 = 0x0000000080803520
    daif = 0x00000000000002c0
    mair_el3 = 0x00000000004404ff
    spsr_el3 = 0x0000000060000000
    elr_el3 = 0x0000000000400ab4
    ttbr0_el3 = 0x000000009e7910c0
    esr_el3 = 0x0000000092000010
    far_el3 = 0x0000ffff9c8d1000
    spsr_el1 = 0x0000000020000000
    elr_el1 = 0x0000ffff9c7f83d0
    spsr_abt = 0x0000000000000000
    spsr_und = 0x0000000000000000
    spsr_irq = 0x0000000000000000
    spsr_fiq = 0x0000000000000000
    sctlr_el1 = 0x0000000034d4d91d
    actlr_el1 = 0x0000000000000000
    cpacr_el1 = 0x0000000000300000
    csselr_el1 = 0x0000000000000000
    sp_el1 = 0xffff8000153dc000
    esr_el1 = 0x0000000056000000
    ttbr0_el1 = 0x000000008b916000
    ttbr1_el1 = 0x1ef6000082eb9000
    mair_el1 = 0x000c0400bb44ffff
    amair_el1 = 0x0000000000000000
    tcr_el1 = 0x00000032b5d03590
    tpidr_el1 = 0xffff80006ec46000
    tpidr_el0 = 0x0000ffff9c8a52f0
    tpidrro_el0 = 0x0000000000000000
    par_el1 = 0x0000000000000000
    mpidr_el1 = 0x0000000080000000
    afsr0_el1 = 0x0000000000000000
    afsr1_el1 = 0x0000000000000000
    contextidr_el1 = 0x0000000000000000
    vbar_el1 = 0xffff800010010800
    cntp_ctl_el0 = 0x0000000000000005
    cntp_cval_el0 = 0x00000001e51eb6e0
    cntv_ctl_el0 = 0x0000000000000000
    cntv_cval_el0 = 0x0000000000000000
    cntkctl_el1 = 0x00000000000000d6
    sp_el0 = 0x0000ffffcb3b8930
    isr_el1 = 0x0000000000000040
    dacr32_el2 = 0x0000000000000000
    ifsr32_el2 = 0x0000000000000000
    cpuectlr_el1 = 0x0000000000000040
    cpumerrsr_el1 = 0x0000000008000239
    l2merrsr_el1 = 0x0000000010247508
    cpuactlr_el1 = 0x00001000090ca000

    Probed signals: BCLK, WCLK, DIN: it is burst format, there are 32bit of one frame.

    put the dts of AM335x and AM654x in below for comparing, reminding they are using different driver of different version SDK.

    AM335x:

     sound {

                            compatible = "ti,am33xx-evm-audio";

                            ti,model = "AM33xx_EVM";

                            ti,audio-codec = <&tlv320aic23>;

                            ti,mcasp-controller = <&mcasp1>;

                            ti,codec-clock-rate = <12000000>;

                            ti,audio-routing =

                                    "Headphone Jack",       "HPLOUT",

                                    "Headphone Jack",       "HPROUT";

                    };

     

    &mcasp1 {

                    pinctrl-names = "default";

                    pinctrl-0 = <&mcasp1_pins>;

                     status = "okay";

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

                    tdm-slots = <2>;

                    /* 16 serializer */

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

                            1 0 0 0

                    >;

                    tx-num-evt = <32>;

                    rx-num-evt = <32>;

    };

      tlv320aic23: tlv320aic23@1b {

                                    compatible = "ti,tlv320aic23";

                                    reg = <0x1b>;

                                    status = "okay";

     

                                    /* Regulators */

                                    AVDD-supply = <&vaux2_reg>;

                                    IOVDD-supply = <&vaux2_reg>;

                                    DRVDD-supply = <&vaux2_reg>;

                                    DVDD-supply = <&vbat>;

                            };

     AM654x:

     sound {

                    compatible = "simple-audio-card";

                    simple-audio-card,name = "AM65x-evm";

                    simple-audio-card,widgets =

                            "Headphone", "Headphone Jack";

                    simple-audio-card,routing =

                            "Headphone Jack",       "LHPOUT",

                            "Headphone Jack",       "RHPOUT";

                     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 = <&tlv320aic23>;

                            system-clock-frequency = <12000000>;

                    };

            };

     .........

     mcasp1_pins: mcasp1-pins {

                    pinctrl-single,pins = <

                            AM65X_IOPAD(0x0244, PIN_INPUT_PULLDOWN, 5) /* (AB28) PRG0_PRU1_GPO0.MCASP1_ACLKX */

                            AM65X_IOPAD(0x0248, PIN_INPUT_PULLDOWN, 5) /* (AC28) PRG0_PRU1_GPO1.MCASP1_AFSX */

                            AM65X_IOPAD(0x0254, PIN_INPUT_PULLDOWN, 5) /* (AA25) PRG0_PRU1_GPO4.MCASP1_AXR0 */

                    >;

            };

    .........

     

    tlv320aic23: tlv320aic23@1b {

                    #sound-dai-cells = <0>;

                    compatible = "ti,tlv320aic23";

                    reg = <0x1b>;

                    status = "okay";

     

                    /* Regulators

                    AVDD-supply = <&codec_vcc_3v3>;

                    IOVDD-supply = <&gp_vcc_1v8>;

                    DRVDD-supply = <&codec_vcc_3v3>;

                    DVDD-supply = <&gp_vcc_1v8>;*/

            };

    ........

     &mcasp1 {

            #sound-dai-cells = <0>;

            status = "okay";

     

            pinctrl-names = "default";

            pinctrl-0 = <&mcasp1_pins>;

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

            tdm-slots = <2>;

            /* 16 serializers */

            /* num-serializer = <10>;*/

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

                    1 0 0 0

                    0 0 0 0

                    0 0

            >;

            tx-num-evt = <32>;

            rx-num-evt = <32>;

    }; 

  • Shenghao,

    Is AIC23B register readable via I2C?

  • Hi Tony

    Sure, 2-wire in the datasheet means i2c. Following link can tell your more.

    A Guide to Arduino & the I2C Protocol (Two Wire) | Arduino Documentation

    @Peter kindly add your comments on 2-wire. Thanks.

  • Shenghao,

    I am asking if AIC23B register can only be wrote in I2C mode, can't read out register via I2C. if so, i2cdump, i2cget doesn't work can be explained. 

    Maybe AIC23 is too old for today's engineer know the details.

  • Kenn,

    Suggest provide a scope waveform include FS, CLK, DATA, and detail frequency information. the first AM335x waveform looks strange, there are 128bit in one frame? did not find such configuration in AIC23 datasheet. 

  • ok, please see the photo below:

    C1--BCLK; C2--AXR0; C4--FS

  • I think I found the problem from wave form, not sure where result in the error, but can give you a hint, should be driver configured wrong.