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.

Beaglebone Black and TLV320AIC3254 codec

Other Parts Discussed in Thread: TLV320AIC3254

Hi,

I'm using a BeagleBone Black running under the latest available Debian and a TLV320AIC3254 evaluation board. I'm struggling to make this codec as an ALSA sound card.

I used the BB-BONE-AUDI-02 DTS file (with a little bit of modification to suit my hardware), the device is found and mounted as an ALSA sound card. I know that the AIC3x is not compatible with the AIC3254.

So I drifted this .dts file to suit my application by replacing tlv320aic3x by tlv320aic32x4 (as the driver seems already available in this linux core). See below.

/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;
/plugin/;

/ {
        compatible = "ti,beaglebone", "ti,beaglebone-black";

        /* identification */
        part-number = "BB-BONE-AUDI-02";
        version = "00A0", "A0";

        /* state the resources this cape uses */
        exclusive-use =
                /* the pin header uses */
                "P9.31",        /* mcasp0: mcasp0_aclkx */
                "P9.29",        /* mcasp0: mcasp0_fsx */
                "P9.28",        /* mcasp0: mcasp0_axr2 */
                "P9.25",        /* mcasp0: mcasp0_ahclkx */
                /* the hardware ip uses */
                "gpio1_18", "gpio1_19",
                "mcasp0";

        fragment@0 {
                target = <&am33xx_pinmux>;
                __overlay__ {

                        i2c2_pins: pinmux_i2c2_pins {
                                pinctrl-single,pins = <
                                        0x17c 0x73      /*spi0_scl.i2c2_sda,SLEWCTRL_SLOW | INPUT_PULLUP |MODE2*/
                                        0x178 0x73      /*spi0_d0.i2c2_scl,SLEWCTRL_SLOW | INPUT_PULLUP | MODE2*/
                                >;
                        };

                        bone_audio_cape_audio_pins: pinmux_bone_audio_cape_audio_pins {
                                pinctrl-single,pins = <
                                        0x1ac 0x00      /* mcasp0_ahclkx,             MODE0 | INPUT */
                                        0x19c 0x22              /* mcasp0_ahclkr, */
                                        0x194 0x20      /* mcasp0_fsx,                MODE0 | OUTPUT  */
                                        0x190 0x20      /* mcasp0_aclkr.mcasp0_aclkx, MODE0 | OUTPUT_PULLDOWN */
                                        0x198 0x20
                                >;
                        };
                };
        };

        fragment@1 {
                target = <&i2c2>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        clock-frequency = <100000>;
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <&i2c2_pins>;


                        tlv320aic32x4: tlv320aic32x4@18 {
                                compatible = "ti,tlv320aic32x4";
                                reg = <0x18>;
                                status = "okay";
                        };
                };
        };

        fragment@2 {
                target = <&mcasp0>;
                __overlay__ {
                        pinctrl-names = "default";
                        pinctrl-0 = <&bone_audio_cape_audio_pins>;

                        status = "okay";

                        op-mode = <0>;          /* MCASP_IIS_MODE */
                        tdm-slots = <2>;
                        num-serializer = <16>;
                        serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
                                2 0 1 0
                                0 0 0 0
                                0 0 0 0
                                0 0 0 0
                        >;
                        tx-num-evt = <1>;
                        rx-num-evt = <1>;
                };
        };

        fragment@3 {
                target = <&ocp>;
                __overlay__ {
                        sound {
                                compatible = "ti,da830-evm-audio";
                                ti,model = "DA830 EVM";
                                ti,audio-codec = <&tlv320aic32x4>;
                                ti,mcasp-controller = <&mcasp0>;
                                ti,codec-clock-rate = <24000000>;
                                ti,audio-routing =
                                        "Headphone Jack",       "HPLOUT",
                                        "Headphone Jack",       "HPROUT",
                                        "LINE1L",               "Line In",
                                        "LINE1R",               "Line In";
                        };
                };

        };
};

After loading this device tree file, the dmesg differs from the previously pseudo-working file:

[ 249.639414] davinci_evm sound.12: ASoC: CODEC (null) not registered
[ 249.647617] davinci_evm sound.12: snd_soc_register_card failed (-517)
[ 249.662908] platform sound.12: Driver davinci_evm requests probe deferral

When trying to use the ALSA sound card, I get multiple errors such as ALSA lib confmisc.c:768:(parse_card) cannot find card '0'.

I've been looking every relevent forum or website but I couldn't find any applicable or working suggestion. I'm a beginner in beaglebone/linux programming so please be indulgent.

I don't know what can be wrong, any help would be very appreciated.

Thanks