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.

TDA4VM: McASP

Part Number: TDA4VM
Other Parts Discussed in Thread: PCM3168A,

Tool/software:

Hi expert,

Hardware platform:J721EXSOMG01EVM + J721EXCP01EVM

Software: ti-processor-sdk-linux-edgeai-j721e-evm-09_02_00_05

The board uses pcm3168a codec connected through McASP10 [AXR0-3 for playback, AXR4-6 for capture]
how come there is just one AXR for playback and just one AXR for caputre?

what should I do if want  McASP10 [AXR0-3 for playback, AXR4-6 for capture]?

Thanks a lot!

  • Hello,

    Could you please clarify your question?

    Thank you,

    Fabiana

  • Hello, 

    Sorry, my bad.

    What I mean is if it is possible to have four devices for playback and three devices for capture, such as:

    00-00: CPB PCM3168A Analog pcm3168a-dac-0 : CPB PCM3168A Analog pcm3168a-dac-0 : playback 1

    00-01: CPB PCM3168A Analog pcm3168a-dac-1 : CPB PCM3168A Analog pcm3168a-dac-1 : playback 2

    00-02: CPB PCM3168A Analog pcm3168a-dac-2 : CPB PCM3168A Analog pcm3168a-dac-2 : playback 3

    00-03: CPB PCM3168A Analog pcm3168a-dac-3 : CPB PCM3168A Analog pcm3168a-dac-3 : playback 4


    00-04: CPB PCM3168A Analog pcm3168a-adc-1 : CPB PCM3168A Analog pcm3168a-adc-1 : capture 1

    00-05: CPB PCM3168A Analog pcm3168a-adc-2 : CPB PCM3168A Analog pcm3168a-adc-2 : capture 2

    00-06: CPB PCM3168A Analog pcm3168a-adc-3 : CPB PCM3168A Analog pcm3168a-adc-3 : capture 3


    What I understood is that

    AXR0 corresponds to playback1(pcm3168a's VOUT1&VOUT2--Headphone out1)

    AXR1 corresponds to playback2(pcm3168a's VOUT3&VOUT4--Headphone out2)

    AXR2 corresponds to playback3(pcm3168a's VOUT5&VOUT6--Headphone out3)

    AXR3 corresponds to playback4(pcm3168a's VOUT7&VOUT8--Line out1)

    AXR4 corresponds to capture1(pcm3168a's VIN1&VIN2--Stereo MIC_IN1)

    AXR5 corresponds to capture2(pcm3168a's VIN3&VIN4--Stereo MIC_IN2)

    AXR6 corresponds to capture3(pcm3168a's VIN5&VIN6--Stereo LINE_IN1)

    Thanks a lot, Best Regards!

  • Hi,

    Thank you for clarifying your question. Please allow me some time to consult with our experts about this.

    Thank you,

    Fabiana

  • Hello,

    Thanks. Waiting for your message.

  • Thank you. I will reach back out once I hear back.

    - Fabiana

  • Hello Xi,

    The board uses pcm3168a codec connected through McASP10 [AXR0-3 for playback, AXR4-6 for capture]
    how come there is just one AXR for playback and just one AXR for caputre?

    The current mapping is done for two links only. See: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/sound/soc/ti/j721e-evm.c?h=ti-linux-6.1.y#n646 

    what should I do if want  McASP10 [AXR0-3 for playback, AXR4-6 for capture]?

    This would require modification to the j721e_soc_probe_cpb function to add the necessary widget links.

    Thanks.

  • Hello,
    Thanks for your reply.

    Best Regards!

  • Hi Praveen,

    This would require modification to the j721e_soc_probe_cpb function to add the necessary widget links.

    Can you give more information about how to add the necessary widget links to achieve below:

    00-00: CPB PCM3168A Analog pcm3168a-dac-0 : CPB PCM3168A Analog pcm3168a-dac-0 : playback 1

    00-01: CPB PCM3168A Analog pcm3168a-dac-1 : CPB PCM3168A Analog pcm3168a-dac-1 : playback 2

    00-02: CPB PCM3168A Analog pcm3168a-dac-2 : CPB PCM3168A Analog pcm3168a-dac-2 : playback 3

    00-03: CPB PCM3168A Analog pcm3168a-dac-3 : CPB PCM3168A Analog pcm3168a-dac-3 : playback 4


    00-04: CPB PCM3168A Analog pcm3168a-adc-1 : CPB PCM3168A Analog pcm3168a-adc-1 : capture 1

    00-05: CPB PCM3168A Analog pcm3168a-adc-2 : CPB PCM3168A Analog pcm3168a-adc-2 : capture 2

    00-06: CPB PCM3168A Analog pcm3168a-adc-3 : CPB PCM3168A Analog pcm3168a-adc-3 : capture 3

    I looked into the  j721e_soc_probe_cpb function, the two links are 'McASP10 to pcm3168a_1 DAC' and 'pcm3168a_1 ADC to McASP10', don't mention to AXR0-AXR6. 

    Thanks a lot! 

  • Hi,

    There may some delay in response due to on-site training. Thank you for understanding.

    -Fabiana

  • Hi,

    Okay, waiting for a reply.

    Thanks!

  • Thank you for your patience.

  • Hi Fabiana,

    May I ask how long is the on-site training? When will it be finished?

    Still waiting for some advise about McASP.

    Best Regards!

  • Hi Xi,

    I looked into the  j721e_soc_probe_cpb function, the two links are 'McASP10 to pcm3168a_1 DAC' and 'pcm3168a_1 ADC to McASP10', don't mention to AXR0-AXR6. 

    The TI SDK release does not support adding the above-requested widget, and there is no plan to add this support. If you need to support this, you may have to modify the software independently.

    Can you tell us what use case and end product you need this for? Have you evaluated your design with TI before proceeding?

    Let us know.

    Thanks.

  • Hi Praveen,

    On the J721E CPB there are J40B(LINE1 OUT) J40A(HeadPhone1 OUT) J41A(HeadPhone3 OUT) J41B(HeadPhone2 OUT), just J40A(HeadPhone1 OUT) works, want all these four out work.

    Same as stereo in, just J39A(MIC1) works, J39B(MIC2) and J38(LINE) don't work. Also want these three stereo in all work.

    I'm working with J721EXSOMG01EVM + J721EXCP01EVM, haven't worked with ourselves designed board.

    Can you tell me what should I do to get these three stereo in and four stereo out all works? Such as at which file change what to get this purpose?

    Thanks a million.

    Best Regards!

  • Hi Xi,

    There are currently no steps in the SDK documentation that walk you through achieving this and as Praveen has stated, this is not something that is supported by TI. We apologize for any inconvenience.

    Thank you,

    Fabiana

  • Hi,

    Can you give me some advice or guidance, i will do it on my own.
    Now I've no idea, didn't know what to do, where to start.

    Please give some directions and suggestions, thanks a million.

    Best Regards!

  • Hi Fabiana, Praveen,

    Guys, Please help, I'm a fresher have no idea what to do to get three stereo in and four stereo out works. 
    Just give me some directions and advises, so I can work on.

    Thanks a million.

  • Hello Xi,

    Please note that support for three stereo in and four stereo out is not supported by the PSDK Linux release.  Also, TI do not plan to support this in our software roadmap. 

    We understand that you are new to this, but at the same time we do not have any suggestion or guidance that we can provide.Our suggestion is to look into the kernel/ALSA documents to understand the software driver & framework updates required for this.  Other option is to contact our third-party software vendor who  can work with you to support. Do reach out to your local TI support team for this.

    Thanks.

  • Hi Praveen,

    Thanks a lot for your reply.

  • Hi Praveen,
    Sorry to bother.

    Want to confirm some information:

    Is pcmC0D0p bind to McASP10_AXR4, pcmC0D1c bind to McASP10_AXR0? Where decide these relationship?

    If it's possible to bind pcmC0D0p with McASP10_AXR5(AXR6), pcmC0D1c with  McASP10_AXR1(AXR2\AXR3)?

    Waiting for your reply.
    Best Regards!

  • Hi Xi, 

    We are not sure what pcmC0D0p and pcmC0D01c you are referring to here. We need more details about the reference document you are using so that we comment here.

    Thanks.

  • Hi Praveen,

    I'm using the J721EXSOMG01EVM + J721EXCP01EVM board,software:ti-processor-sdk-linux-adas-j721e-evm-09_02_00_05,

    the schematic and dts are shown below:

    sound0: sound@0 {
    compatible = "ti,j721e-cpb-audio";
    model = "j721e-cpb";

    ti,cpb-mcasp = <&mcasp10>;
    ti,cpb-codec = <&pcm3168a_1>;

    clocks = <&k3_clks 184 1>,
    <&k3_clks 184 2>, <&k3_clks 184 4>,
    <&k3_clks 157 371>,
    <&k3_clks 157 400>, <&k3_clks 157 401>;
    clock-names = "cpb-mcasp-auxclk",
    "cpb-mcasp-auxclk-48000", "cpb-mcasp-auxclk-44100",
    "cpb-codec-scki",
    "cpb-codec-scki-48000", "cpb-codec-scki-44100";
    };

    pcm3168a_1: audio-codec@44 {
    compatible = "ti,pcm3168a";
    reg = <0x44>;

    #sound-dai-cells = <1>;

    reset-gpios = <&exp3 0 GPIO_ACTIVE_LOW>;

    /* C_AUDIO_REFCLK2 -> RGMII6_RXC (W26) */
    clocks = <&k3_clks 157 371>;
    clock-names = "scki";

    /* HSDIV3_16FFT_MAIN_4_HSDIVOUT2_CLK -> REFCLK2 */
    assigned-clocks = <&k3_clks 157 371>;
    assigned-clock-parents = <&k3_clks 157 400>;
    assigned-clock-rates = <24576000>; /* for 48KHz */

    VDD1-supply = <&vsys_3v3>;
    VDD2-supply = <&vsys_3v3>;
    VCCAD1-supply = <&vsys_5v0>;
    VCCAD2-supply = <&vsys_5v0>;
    VCCDA1-supply = <&vsys_5v0>;
    VCCDA2-supply = <&vsys_5v0>;
    };

    &mcasp10 {
    #sound-dai-cells = <0>;

    pinctrl-names = "default";
    pinctrl-0 = <&mcasp10_pins_default>;

    op-mode = <0>; /* MCASP_IIS_MODE */
    tdm-slots = <2>;
    auxclk-fs-ratio = <256>;

    serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
    1 1 1 1
    2 2 2 0
    >;
    tx-num-evt = <0>;
    rx-num-evt = <0>;
    };

    When power on the board, look into /dev/snd , there is one device pcmC0D0p for playback and one device pcmC0D1c for capture,

    is there are relationship between McASP10_AXRn and pcmC0D0p(pcmC0D1c) ?

    What i understand is that:

    AXR0 corresponds to playback1(pcm3168a's VOUT1&VOUT2--Headphone out1)

    AXR1 corresponds to playback2(pcm3168a's VOUT3&VOUT4--Headphone out2)

    AXR2 corresponds to playback3(pcm3168a's VOUT5&VOUT6--Headphone out3)

    AXR3 corresponds to playback4(pcm3168a's VOUT7&VOUT8--Line out1)

    AXR4 corresponds to capture1(pcm3168a's VIN1&VIN2--Stereo MIC_IN1)

    AXR5 corresponds to capture2(pcm3168a's VIN3&VIN4--Stereo MIC_IN2)

    AXR6 corresponds to capture3(pcm3168a's VIN5&VIN6--Stereo LINE_IN1)

    am i right?

    Thanks a lot.

  • Hi Xi,

    Ok, Based on your pointer, we see that they are defined by the Linux kernel ALSA documentation. 

    Suggest looking into https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/Documentation/sound/alsa-configuration.rst?h=ti-linux-6.1.y 

    Generally, the understanding is that /dev/snd/pcmC0D0p denotes the PCM playback, and /dev/snd/pcmC0D0c denotes the PCM Capture. 

    Your best reference is the Linux Kernel ALSA/Sound driver.

    Thanks.

  • Hi Praveen,

    Can you tell me is there are relationship between McASP10_AXRn and pcmC0D0p(pcmC0D1c) ?

    If it's possible to use pcmC0D0p to playback at pcm3168a's DOUT4(VOUT7&VOUT8)?

    ps: there is a infotainment expansion board for J721EXCP01EVM, but couldn't find any information in SDK_09_02, where can find the corresponding software?

    Thanks.

    Best Regards!

  • Hi Xi,

    The infotainment expansion board for J721EXCP01EVM is not supported anymore, so we recommend not using it.

    Thanks.

  • Hi Praveen,

    1. Can you tell me is there are relationship between McASP10_AXRn and pcmC0D0p(pcmC0D1c) ? If it's possible  to playback at pcm3168a's DOUT4(VOUT7&VOUT8)?

    2. When use aplay to playback wav file, only J40A(HeadPhone1 OUT) can hear the sound, the other J40B(LINE1 OUT)  J41A(HeadPhone3 OUT) J41B(HeadPhone2 OUT) can't hear sound.

    If it's possible to hear at  J40B(LINE1 OUT) J41A(HeadPhone3 OUT) J41B(HeadPhone2 OUT), how to do?

    Thanks & BestRegards! 

  • Hi Xi,

    Can you tell me is there are relationship between McASP10_AXRn and pcmC0D0p(pcmC0D1c) ?

    what does "aplay -L" and "arecord -L" show?.  Its possible your sound devices are multichannel, i,e the play is 8ch and the record is 6ch rather than multiple stereo play/record devices.

    -steve

  • Hi Stephen,

    Could you please tell me where decide the sound devices are multichannel or not?

    thanks&best regards!

  • Try something similar to this - https://unix.stackexchange.com/questions/749881/how-to-get-audio-input-device-info-channels-serial
    to figure out how many channels your device has - although pcm3168a-dac-0 seems to indicate its is only stereo.

    Also, TI has indicated proper McASP support will appear in the 10.0 SDK due in AUgust.

    -steve

  • Hi Stephen,

    cat /proc/asound/j721ecpb/pcm0p/sub0/hw_params, the result is closed.

    Also, TI has indicated proper McASP support will appear in the 10.0 SDK due in AUgust.

    1. what do you mean 'proper' ?

    2. Still want to ask:

    When use aplay to playback wav file, only J40A(HeadPhone1 OUT) can hear the sound, the other J40B(LINE1 OUT)  J41A(HeadPhone3 OUT) J41B(HeadPhone2 OUT) can't hear sound.

    If it's possible to hear at  J40B(LINE1 OUT) J41A(HeadPhone3 OUT) J41B(HeadPhone2 OUT), how to do?

    Thanks & Best Regards!

  • Have you tried using aplay to play a multi-channel file?.  You could also use SOX, if you can get that installed, to generate a multi-channel sinewave.  Also - do you see audio data on the 2nd two I2S lines.  Maybe the CODEC is not being initialized correctly by the DTS?

  • Also, TI has indicated proper McASP support will appear in the 10.0 SDK due in AUgust.

    Let's not mix devices here. The device discussed in this E2E thread is TDA4VM. No additional McASP driver support is planned for the TDA4VM driver in the 10.0 SDK.

    Thanks.

  • Hi Praveen,

    The device discussed in this E2E thread is TDA4VM. No additional McASP driver support is planned for the TDA4VM driver in the 10.0 SDK

    Sorry about that. 

    Hi Xi

    How about cat /proc/asound/card0/pcm0c/sub0/hw_params ?

  • looks like you'll need to open your alsa device before the above will work, like using aplay

  • Hi Praveen,

    1. Could you please tell me if it's possible to hear at  J40B(LINE1 OUT) J41A(HeadPhone3 OUT) J41B(HeadPhone2 OUT), how to do?

    When aplay a file, why J40A(HeadPhone1 OUT) can hear the sound rather than the other three?

    2. I can use arecord to capture sound through J39A(MIC1) , If it's possible to capture sound through  J39B(MIC2) and J38(LINE)?

    Please give an answer directly, please.

    Thanks & Best Regards!

  • Hi Stephen,

    When playing wav file can cat hw_parameters, but it seems to be decided by the file.

    The DTS configuration is as below:

    is these configuration right?
    Can you tell the relationship between McASP10_AXRn and pcmC0D0p(pcmC0D1c)\pcm3168a-dac-0(pcm3168a-adc-1)?

    Is there are relationship or not? I'm really confused.

    Thanks & Best regards!