Audio codec interfacing issue with NXP's i.mx6ULL EVK SAI3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Audio codec interfacing issue with NXP's i.mx6ULL EVK SAI3

1,680 Views
jayebc
Contributor II

Dear Technical support team,

I am using NXP i.MX6ULL EVK with NXP's fsl-yocto-L4.9.11_1.0.0.tar yocto BSP's, and trying to interface with TLV320AIC3105 using SAI3 interface, as part of the initial audio codec bringup am unable to get the playback up but able to get MCLK, no BCLK and WCLK and no data, with SAI3 port being configured as I2S port to TLV320AIC3105 with I2C2 as the control interface.

For playback I am getting below errors.

root@imx6ull14x14evk:/# aplay a2002011001-e02-8kHz.wav
aic3x_hw_params(): unable to setup PLL
tlv320aic3x-codec 1-0018: ASoC: can't set tlv320aic3x-hifi hw params: -22
ALSA lib ../../../alsa-lib-1.1.2/src/pcm/pcm_direct.c:1054:(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib ../../../alsa-lib-1.1.2/src/pcm/pcm_dmix.c:1053:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:805: audio open error: Invalid argument

So not sure why I am getting above errors during playback. I have attached my dts and machine driver code.

I am seeing below asrc configuration in dtsi file for SAI2 interface .
So could please guide me, can I use same below configuration for SAI3 interface or is there any change asrc configuration.


Please find below the DTS configurations:


 sound {
        compatible = "fsl,imx-audio-tlv320";
        model = "imx-tlv320";
        cpu-dai = <&sai3>;
        audio-codec = <&tlv320aic3105>;
        asrc-controller = <&asrc>;        
        codec-master;                    
        gpr = <&gpr 4 0x200000 0x200000>;
        audio-routing =

 
                "Headphone Jack",    "HPLOUT",
                "Headphone Jack",    "HPROUT",
                "LINE1L",        "Mic Jack",
                "LINE2L",        "Mic Jack";
       
    };


For &asrc is in dtsi is given as  

        asrc: asrc@02034000 {
                                        compatible = "fsl,imx53-asrc";
                                        reg = <0x02034000 0x4000>;
                                        interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
                                        clocks = <&clks IMX6UL_CLK_ASRC_IPG>,
                                                <&clks IMX6UL_CLK_ASRC_MEM>, <&clks 0>,
                                                <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
                                                <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
                                                <&clks 0>, <&clks 0>, <&clks 0>, <&clks 0>,
                                                <&clks IMX6UL_CLK_SPDIF>, <&clks 0>, <&clks 0>,
                                                <&clks IMX6UL_CLK_SPBA>;
                                        clock-names = "mem", "ipg", "asrck_0",
                                                "asrck_1", "asrck_2", "asrck_3", "asrck_4",
                                                "asrck_5", "asrck_6", "asrck_7", "asrck_8",
                                                "asrck_9", "asrck_a", "asrck_b", "asrck_c",
                                                "asrck_d", "asrck_e", "asrck_f", "spba";
                                        dmas = <&sdma 17 23 1>, <&sdma 18 23 1>, <&sdma 19 23 1>,
                                                <&sdma 20 23 1>, <&sdma 21 23 1>, <&sdma 22 23 1>;
                                        dma-names = "rxa", "rxb", "rxc",
                                                    "txa", "txb", "txc";
                                        fsl,asrc-rate  = <48000>;
                                        fsl,asrc-width = <16>;
                                        status = "okay";
                                };

Eagerly awaiting for your replies

Many Thanks in advance

0 Kudos
3 Replies

1,209 Views
jayebc
Contributor II

Hi Igor,

Thanks for your quick responses,

Is asrc configuraion is correct? (Given above)

This is working already for SAI2.

So could please guide me, can I use same configuration for SAI3 interface or is there any change asrc configuration.

 

Eagerly awaiting for your replies

 

Many Thanks in advance

Jaya

0 Kudos

1,209 Views
igorpadykov
NXP Employee
NXP Employee

Hi jaya

I believe it is correct if it is working with SAI2.

Best regards
igor

0 Kudos

1,209 Views
igorpadykov
NXP Employee
NXP Employee

Hi jaya

as codec is set as master ("codec-master;" in dts file), so BCLK and WCLK

should be produced by TLV320AIC3105 codec, one can debug it in driver

linux/sound/soc/codecs/tlv320aic3x.c. For debugging TLV320AIC one can check

Linux/TLV320AIC3105: Audio routing in DT - Audio Converters Forum - Audio Converters - TI E2E Commun... 

Structure of audio drivers is described in Table 7-1. Stereo Codec SoC Driver Files

attached Linux Manual, for sai operation there is machine layer driver imx-wm8960.c,

intended to work with wm8960 codec used in i.MX6ULL EVK. Seem you need to create

similar machine layer driver for TLV320AIC3105.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos