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.

AM5728: Linux/AM5728: AUDIO codec TLV320AIC3104 support

Part Number: AM5728
Other Parts Discussed in Thread: BEAGLEBOARD-X15, TLV320AIC3104, TPIC2810, TLV320AIC3106

hi everyone

we designed our custom board with AM5728 and it has interface with audio codec TLV320AIC3104.

We refer to am57xx-beagle-x15-common.dtsi to modify the device tree file

0020.am57xx-idk-common_dtsi.txt
/*
 * Copyright (C) 2015-2016 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.
 */

#include "am57xx-industrial-grade.dtsi"

/ {
	aliases {
		rtc0 = &mcp_rtc;
		rtc1 = &tps659038_rtc;
		rtc2 = &rtc;
		display0 = &hdmi0;
		display1 = &lcd0;

                                sound0 = &hdmi;
                                sound1 = &sound0;
	};

	chosen {
		stdout-path = &uart3;
	};

	vmain: fixedregulator-vmain {
		compatible = "regulator-fixed";
		regulator-name = "VMAIN";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		regulator-boot-on;
	};

	v3_3d: fixedregulator-v3_3d {
		compatible = "regulator-fixed";
		regulator-name = "V3_3D";
		vin-supply = <&smps9_reg>;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		regulator-boot-on;
	};

                vdd_3v3: fixedregulator-vdd_3v3 {
                               compatible = "regulator-fixed";
                               regulator-name = "vdd_3v3";
                               vin-supply = <&regen1>;
                               regulator-min-microvolt = <3300000>;
                               regulator-max-microvolt = <3300000>;
                               regulator-always-on;
                               regulator-boot-on;
                 };

                 aic_dvdd: fixedregulator-aic_dvdd {
                               compatible = "regulator-fixed";
                               regulator-name = "aic_dvdd_fixed";
            
                               vin-supply = <&v3_3d>;
                               regulator-min-microvolt = <1800000>;
                               regulator-max-microvolt = <1800000>;
                               regulator-always-on;
                               regulator-boot-on;
                 };

	vtt_fixed: fixedregulator-vtt {
		/* TPS51200 */
		compatible = "regulator-fixed";
		regulator-name = "vtt_fixed";
		vin-supply = <&v3_3d>;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
		regulator-boot-on;
	};

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

	leds-iio {
		status = "disabled";
		compatible = "gpio-leds";
		led-out0 {
			label = "out0";
			gpios = <&tpic2810 0 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out1 {
			label = "out1";
			gpios = <&tpic2810 1 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out2 {
			label = "out2";
			gpios = <&tpic2810 2 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out3 {
			label = "out3";
			gpios = <&tpic2810 3 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out4 {
			label = "out4";
			gpios = <&tpic2810 4 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out5 {
			label = "out5";
			gpios = <&tpic2810 5 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out6 {
			label = "out6";
			gpios = <&tpic2810 6 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};

		led-out7 {
			label = "out7";
			gpios = <&tpic2810 7 GPIO_ACTIVE_HIGH>;
			default-state = "off";
		};
	};

	lcd0: display {
		compatible = "osddisplays,osd070t1718-19ts", "panel-dpi";

		label = "lcd";

		enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;

		panel-timing {
			clock-frequency = <33000000>;
			hactive = <800>;
			vactive = <480>;
			hfront-porch = <210>;
			hback-porch = <16>;
			hsync-len = <30>;
			vback-porch = <10>;
			vfront-porch = <22>;
			vsync-len = <13>;
			hsync-active = <0>;
			vsync-active = <0>;
			de-active = <1>;
			pixelclk-active = <1>;
		};

		port {
			lcd_in: endpoint {
				remote-endpoint = <&dpi_out>;
			};
		};
	};

	hdmi0: connector@0 {
		compatible = "hdmi-connector";
		label = "hdmi";

		type = "a";

		port {
			hdmi_connector_in: endpoint {
				remote-endpoint = <&tpd12s015_out>;
			};
		};
	};

	tpd12s015: encoder@0 {
		compatible = "ti,tpd12s016", "ti,tpd12s015";

		gpios = <0>, /* optional CT_CP_HPD */
			<0>, /* optional LS_OE */
			<&gpio7 12 GPIO_ACTIVE_HIGH>;	/* HPD */

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;

				tpd12s015_in: endpoint@0 {
					remote-endpoint = <&hdmi_out>;
				};
			};

			port@1 {
				reg = <1>;

				tpd12s015_out: endpoint@0 {
					remote-endpoint = <&hdmi_connector_in>;
				};
			};
		};
	};

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

          sound0: sound@0 {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "BeagleBoard-X15";
                    simple-audio-card,widgets =
                              "Line", "Line Out",
                              "Line", "Line In";
                    simple-audio-card,routing =
                              "Line Out",	"LLOUT",
                              "Line Out",	"RLOUT",
                              "MIC2L",	"Line In",
                              "MIC2R",	"Line In";
                    simple-audio-card,format = "dsp_b";
                    simple-audio-card,bitclock-master = <&sound0_master>;
                    simple-audio-card,frame-master = <&sound0_master>;
                    simple-audio-card,bitclock-inversion;

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

                    sound0_master: simple-audio-card,codec {
                              sound-dai = <&tlv320aic3104>;
                               system-clock-frequency = <24500000>;
                              //clocks = <&clkout2_clk>;
                    };
          };


};

&dra7_pmx_core {
	dcan1_pins_default: dcan1_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x37d0, PIN_OUTPUT_PULLUP | MUX_MODE0)	/* dcan1_tx */
			DRA7XX_CORE_IOPAD(0x37d4, PIN_INPUT_PULLUP | MUX_MODE0)		/* dcan1_rx */
		>;
	};

	dcan1_pins_sleep: dcan1_pins_sleep {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x37d0, MUX_MODE15 | PULL_UP)	/* dcan1_tx.off */
			DRA7XX_CORE_IOPAD(0x37d4, MUX_MODE15 | PULL_UP)	/* dcan1_rx.off */
		>;
	};

	i2c1_pins_default: i2c1_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3800, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_sda.sda */
			DRA7XX_CORE_IOPAD(0x3804, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl.scl */
		>;
	};

	i2c4_pins_default: i2c4_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3440, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a0.i2c4_scl */
			DRA7XX_CORE_IOPAD(0x3444, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a1.i2c4_sda */
		>;
	};

          i2c5_pins_default: i2c5_pins_default {
                    pinctrl-single,pins = <
                              DRA7XX_CORE_IOPAD(0x3450, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a4.i2c4_scl */
                              DRA7XX_CORE_IOPAD(0x3454, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a5.i2c4_sda */
                    >;
          };

	spi2_pins: spi2_pins {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x37c0, (INPUT_EN | MUX_MODE0))          /* spi2_sclk.spi2_sclk (A26) */
			DRA7XX_CORE_IOPAD(0x37c4, (INPUT_EN | MUX_MODE0))          /* spi2_d1.spi2_d1 (B22) */
			DRA7XX_CORE_IOPAD(0x37c8, (INPUT_EN | MUX_MODE0))          /* spi2_d0.spi2_d0 (G17) */
			DRA7XX_CORE_IOPAD(0x37cc, (PIN_OUTPUT_PULLUP | MUX_MODE0)) /* spi2_cs0.spi2_cs0 (B24) */
			DRA7XX_CORE_IOPAD(0x37b4, (PIN_OUTPUT_PULLUP | MUX_MODE3)) /* spi1_cs1.spi2_cs1 (A22) */
		>;
	};

	uart1_pins_default: uart1_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x37e0, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */
			DRA7XX_CORE_IOPAD(0x37e4, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_txd.uart1_txd */
		>;
	};
	
	uart2_pins_default: uart2_pins_default {
		pinctrl-single,pins = <
			0x3f0 (PIN_INPUT_PULLUP | MUX_MODE4) /* uart2_rxd.uart2_rxd */
			0x3f4 (PIN_INPUT_PULLUP | MUX_MODE4) /* uart2_txd.uart2_txd */
		>;
	};

	uart9_pins_default: uart9_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3560, PIN_INPUT_PULLUP | MUX_MODE7) /* vin2a_hsync0.uart9_rxd */
			DRA7XX_CORE_IOPAD(0x3564, PIN_INPUT_PULLUP | MUX_MODE7) /* vin2a_vsync0.uart9_txd */
		>;
	};

	gpio2_pins_default: gpio2_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x34dc, (PIN_INPUT_PULLUP | MUX_MODE14)) /* vin1a_clk0.gpio2_30 (AG8) */
		>;
	};

	gpio3_pins_default: gpio3_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x354c, PIN_INPUT_PULLUP | MUX_MODE14) /* vin1a_d22.gpio3_26 */
			DRA7XX_CORE_IOPAD(0x3550, PIN_INPUT_PULLUP | MUX_MODE14) /* vin1a_d23.gpio3_27 */
			DRA7XX_CORE_IOPAD(0x3528, (PIN_INPUT_PULLUP | MUX_MODE14)) /* vin1a_d13.gpio3_17 (AF6) */
			DRA7XX_CORE_IOPAD(0x350c, (PIN_INPUT_PULLUP | MUX_MODE14)) /* vin1a_d6.gpio3_10 (AG6) */
			DRA7XX_CORE_IOPAD(0x352c, (PIN_INPUT_PULLUP | MUX_MODE14)) /* vin1a_d14.gpio3_18 (AF3) */
		>;
	};

	gpio4_pins_default: gpio4_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3578, (PIN_INPUT_PULLUP | MUX_MODE14)) /* vin2a_d4.gpio4_5 (D2) */
		>;
	};

	gpio5_pins_default: gpio5_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3644, PIN_INPUT_PULLUP | MUX_MODE14) /* RMII_MHZ_50_CLK.gpio5_17 */
		>;
	};

	gpio6_pins_default: gpio6_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3684, PIN_INPUT_PULLUP | MUX_MODE14) /* usb2_drvvbus.gpio6_13 */
		>;
	};

	gpio7_pins_default: gpio7_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x37ec, (PIN_OUTPUT_PULLDOWN | MUX_MODE14)) /* uart1_rtsn.gpio7_25 (C27) */
			DRA7XX_CORE_IOPAD(0x37b0, (PIN_INPUT_PULLUP | MUX_MODE14)) /* spi1_cs0.gpio7_10 (A24) */
		>;
	};

	ads7846_pins: ads7846_pins {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3548, (PIN_INPUT_PULLUP | MUX_MODE14)) /* vin1a_d21.gpio3_25 */
		>;
	};

         am572x_idk_audio_pins: am572x_idk_audio_pins {
                    pinctrl-single,pins = <
                             DRA7XX_CORE_IOPAD(0x3724, (PIN_INPUT_PULLDOWN | MUX_MODE0)) /* mcasp3_aclkx */
                             DRA7XX_CORE_IOPAD(0x3728, (PIN_INPUT_PULLDOWN | MUX_MODE0)) /* mcasp3_fsx */
                             DRA7XX_CORE_IOPAD(0x372C, (PIN_INPUT_PULLDOWN | MUX_MODE0)) /* mcasp3_axr0 */
                             DRA7XX_CORE_IOPAD(0x3730, (PIN_OUTPUT_PULLDOWN | MUX_MODE0)) /* mcasp3_axr1 */
                     >;

         };


};

&i2c1 {
	status = "okay";
	clock-frequency = <400000>;

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

	tps659038: tps659038@58 {
		compatible = "ti,tps659038";
		reg = <0x58>;
/*
		interrupts-extended = <&gpio6 16 IRQ_TYPE_LEVEL_HIGH
			       &dra7_pmx_core 0x418>;
*/
		#interrupt-cells = <2>;
		interrupt-controller;
		ti,system-power-controller;
		ti,palmas-override-powerhold;

		tps659038_pmic {
			compatible = "ti,tps659038-pmic";

			smps12-in-supply = <&vmain>;
			smps3-in-supply = <&vmain>;
			smps45-in-supply = <&vmain>;
			smps6-in-supply = <&vmain>;
			smps7-in-supply = <&vmain>;
			smps8-in-supply = <&vmain>;
			smps9-in-supply = <&vmain>;
			ldo1-in-supply = <&vmain>;
			ldo2-in-supply = <&vmain>;
			ldo3-in-supply = <&vmain>;
			ldo4-in-supply = <&vmain>;
			ldo9-in-supply = <&vmain>;
			ldoln-in-supply = <&vmain>;
			ldousb-in-supply = <&vmain>;
			ldortc-in-supply = <&vmain>;

			regulators {
				smps12_reg: smps12 {
					/* VDD_MPU */
					regulator-name = "smps12";
					regulator-min-microvolt = <850000>;
					regulator-max-microvolt = <1250000>;
					regulator-always-on;
					regulator-boot-on;
				};

				smps3_reg: smps3 {
					/* VDD_DDR EMIF1 EMIF2 */
					regulator-name = "smps3";
					regulator-min-microvolt = <1350000>;
					regulator-max-microvolt = <1350000>;
					regulator-always-on;
					regulator-boot-on;
				};

				smps45_reg: smps45 {
					/* VDD_DSPEVE on AM572 */
					/* VDD_IVA + VDD_DSP on AM571 */
					regulator-name = "smps45";
					regulator-min-microvolt = <850000>;
					regulator-max-microvolt = <1060000>;
					regulator-always-on;
					regulator-boot-on;
				};

				smps6_reg: smps6 {
					/* VDD_GPU */
					regulator-name = "smps6";
					regulator-min-microvolt = <850000>;
					regulator-max-microvolt = <1060000>;
					regulator-always-on;
					regulator-boot-on;
				};

				smps7_reg: smps7 {
					/* VDD_CORE */
					regulator-name = "smps7";
					regulator-min-microvolt = <850000>;
					regulator-max-microvolt = <1150000>;
					regulator-always-on;
					regulator-boot-on;
				};

				smps8_reg: smps8 {
					/* 5728 - VDD_IVAHD */
					/* 5718 - N.C. test point */
					regulator-name = "smps8";
					regulator-min-microvolt = <1060000>;
					regulator-max-microvolt = <1060000>;
					regulator-always-on;
					regulator-boot-on;
				};

				smps9_reg: smps9 {
					/* VDD_3_3D */
					regulator-name = "smps9";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
					regulator-boot-on;
				};

				ldo1_reg: ldo1 {
					/* VDDSHV8 - VSDMMC  */
					/* NOTE: on rev 1.3a, data supply */
					regulator-name = "ldo1";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <3300000>;
					regulator-boot-on;
					regulator-always-on;
				};

				ldo2_reg: ldo2 {
					/* VDDSH18V */
					regulator-name = "ldo2";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
					regulator-boot-on;
				};

				ldo3_reg: ldo3 {
					/* R1.3a 572x V1_8PHY_LDO3: USB, SATA */
					regulator-name = "ldo3";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
					regulator-boot-on;
				};

				ldo4_reg: ldo4 {
					/* R1.3a 572x V1_8PHY_LDO4: PCIE, HDMI*/
					regulator-name = "ldo4";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
					regulator-boot-on;
				};

				/* LDO5-8 unused */

				ldo9_reg: ldo9 {
					/* VDD_RTC  */
					regulator-name = "ldo9";
					regulator-min-microvolt = <1050000>;
					regulator-max-microvolt = <1050000>;
					regulator-always-on;
					regulator-boot-on;
				};

				ldoln_reg: ldoln {
					/* VDDA_1V8_PLL */
					regulator-name = "ldoln";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
					regulator-boot-on;
				};

				ldousb_reg: ldousb {
					/* VDDA_3V_USB: VDDA_USBHS33 */
					regulator-name = "ldousb";
					regulator-min-microvolt = <3300000>;
					regulator-max-microvolt = <3300000>;
					regulator-always-on;
					regulator-boot-on;
				};

				ldortc_reg: ldortc {
					/* VDDA_RTC  */
					regulator-name = "ldortc";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <1800000>;
					regulator-always-on;
					regulator-boot-on;
				};

				regen1: regen1 {
					/* VDD_3V3_ON */
					regulator-name = "regen1";
					regulator-boot-on;
					regulator-always-on;
				};

				regen2: regen2 {
					/* Needed for PMIC internal resource */
					regulator-name = "regen2";
					regulator-boot-on;
					regulator-always-on;
				};
			};
		};

		tps659038_rtc: tps659038_rtc {
			compatible = "ti,palmas-rtc";
			interrupt-parent = <&tps659038>;
			interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
			wakeup-source;
		};

		tps659038_pwr_button: tps659038_pwr_button {
			compatible = "ti,palmas-pwrbutton";
			interrupt-parent = <&tps659038>;
			interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
			wakeup-source;
			ti,palmas-long-press-seconds = <12>;
		};

		tps659038_gpio: tps659038_gpio {
			compatible = "ti,palmas-gpio";
			gpio-controller;
			#gpio-cells = <2>;
		};

		extcon_usb2: tps659038_usb {
			compatible = "ti,palmas-usb-vid";
			ti,enable-vbus-detection;
			ti,enable-id-detection;
                              /* ID & VBUS s provided in board dts */
		};
	};

	tc358778: tc358778@0e {
		compatible = "toshiba,tc358778", "toshiba,tc358768";
		reg = <0x0e>;
		status = "disabled";

		clocks = <&src_clk_x1>;
		clock-names = "refclk";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				tc358778_in: endpoint {
					remote-endpoint = <&dpi_out>;
					data-lines = <24>;
				};
			};

			port@1 {
				reg = <1>;
				tc358778_out: endpoint {
					/*
					 * lanes and remote-endpoint defined per
					 * panel.
					 */
				};
			};
		};
	};

	tpic2810: tpic2810@60 {
		compatible = "ti,tpic2810";
		reg = <0x60>;
		gpio-controller;
		#gpio-cells = <2>;
	};

	ov2659: ov2659@30 {
		compatible = "ovti,ov2659";
		reg = <0x30>;

		clocks = <&src_clk_x1>;
		clock-names = "xvclk";

		pwrdn-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;

		port {
			ov2659_1: endpoint {
				hsync-active = <1>;
				vsync-active = <1>;
				pclk-sample = <1>;
				link-frequencies = /bits/ 64 <70000000>;
			};
		};
	};



             tlv320aic3104: tlv320aic3104@18 {
                 #sound-dai-cells = <0>;
                 compatible = "ti,tlv320aic3104";
                 reg = <0x18>;
                 status = "okay";

                 AVDD-supply = <&v3_3d>;
                 IOVDD-supply = <&v3_3d>;
                 DRVDD-supply = <&v3_3d>;
                 DVDD-supply = <&aic_dvdd>;

             };
};

&i2c4 {
	status = "okay";
	clock-frequency = <400000>;

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

	tmp102: tmp102@49 {
		compatible = "ti,tmp102";
		reg = <0x49>;
		interrupt-parent = <&gpio3>;
		interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
		#thermal-sensor-cells = <1>;
	};

	eeprom@52 {
           compatible = "24c02";
           reg = <0x52>;
           pagesize = <16>;
       };

	mcp_rtc: rtc@6f {
		compatible = "microchip,mcp7941x";
		reg = <0x6f>;
		interrupts-extended = <&crossbar_mpu GIC_SPI 2 IRQ_TYPE_EDGE_RISING>,
				      <&dra7_pmx_core 0x424>;
		interrupt-names = "irq", "wakeup";

		wakeup-source;
	};
};

&i2c5 {
          status = "okay";
          clock-frequency = <400000>;

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

          eeprom@54 {
           compatible = "24c02";
           reg = <0x54>;
           pagesize = <256>;
       };
};

&mcspi2 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&spi2_pins>;
        ti,pindir-d0-out-d1-in;

	ads7846@0 {
		pinctrl-names = "default";
		pinctrl-0 = <&ads7846_pins>;

		compatible = "ti,ads7846";

		reg = <0>;			/* CS0 */
		spi-max-frequency = <1500000>;

		interrupt-parent = <&gpio3>;
		interrupts = <25 0>;		/* gpio3_25 */
		pendown-gpio = <&gpio3 25 0>;

		ti,x-min = /bits/ 16 <0x0>;
		ti,x-max = /bits/ 16 <0x0fff>;
		ti,y-min = /bits/ 16 <0x0>;
		ti,y-max = /bits/ 16 <0x0fff>;

		ti,x-plate-ohms = /bits/ 16 <180>;
		ti,pressure-max = /bits/ 16 <255>;

		ti,debounce-max = /bits/ 16 <10>;
		ti,debounce-tol = /bits/ 16 <30>;
		ti,debounce-rep = /bits/ 16 <1>;

		ti,settle-delay-usec = /bits/ 16 <150>;
		ti,keep-vref-on = <1>;

		linux,wakeup;
	};

	ad5724r@0 {
		compatible = "adi,ad5724r";
		reg = <1>; /* CS1 */
		spi-cpha; /* SPI_MODE_1 */
		spi-max-frequency = <1500000>;
	};
};

&mcspi3 {
	status = "okay";
	ti,pindir-d0-out-d1-in;

	sn65hvs882: sn65hvs882@0 {
		compatible = "pisosr-gpio";
		gpio-controller;
		#gpio-cells = <2>;

		reg = <0>;
		spi-max-frequency = <1000000>;
		spi-cpol;
	};
};



&uart1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_pins_default>;

	interrupts-extended = <&crossbar_mpu GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
			      <&dra7_pmx_core 0x3e0>;
};

&uart2 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_pins_default>;
};

&uart3 {
	status = "okay";
	interrupts-extended = <&crossbar_mpu GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH
			       &dra7_pmx_core 0x248>;
};



&uart9 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&uart9_pins_default>;
};

&gpio2 {
	pinctrl-names = "default";
	pinctrl-0 = <&gpio2_pins_default>;
	status = "okay";
};

&gpio3 {
	pinctrl-names = "default";
	pinctrl-0 = <&gpio3_pins_default>;
	status = "okay";
};

&gpio4 {
	pinctrl-names = "default";
	pinctrl-0 = <&gpio4_pins_default>;
	status = "okay";
};

&gpio5 {
	pinctrl-names = "default";
	pinctrl-0 = <&gpio5_pins_default>;
	status = "okay";
};

&gpio6 {
	pinctrl-names = "default";
	pinctrl-0 = <&gpio6_pins_default>;
	status = "okay";
};

/* gpio7_25 use to select the spi2 bus connect to vport(low) or dac(high) */
&gpio7 {
         pinctrl-names = "default";
         pinctrl-0 = <&gpio7_pins_default>;
         status = "okay";
};

&rtc {
	status = "okay";
	ext-clk-src;
};

&mac {
	status = "okay";
	dual_emac;
};

&cpsw_emac0 {
	phy_id = <&davinci_mdio>, <0>;
	phy-mode = "rgmii";
	dual_emac_res_vlan = <1>;
};

&cpsw_emac1 {
	phy_id = <&davinci_mdio>, <1>;
	phy-mode = "rgmii";
	dual_emac_res_vlan = <2>;
};

&usb2_phy1 {
	phy-supply = <&ldousb_reg>;
};

&usb2_phy2 {
	phy-supply = <&ldousb_reg>;
};

&usb1 {
	dr_mode = "host";
};

&usb2 {
	dr_mode = "host";
};

&mmc1 {
	status = "okay";
	vmmc-supply = <&v3_3d>;
	vmmc_aux-supply = <&ldo1_reg>;
	bus-width = <4>;
	cd-gpios = <&gpio6 27 0>; /* gpio 219 */
};

&mmc2 {
	status = "okay";
	vmmc-supply = <&v3_3d>;
	bus-width = <8>;
	ti,non-removable;
	max-frequency = <96000000>;
	no-1-8-v;
	/delete-property/ mmc-hs200-1_8v;
};

&dcan1 {
	status = "okay";
	pinctrl-names = "default", "sleep", "active";
	pinctrl-0 = <&dcan1_pins_sleep>;
	pinctrl-1 = <&dcan1_pins_sleep>;
	pinctrl-2 = <&dcan1_pins_default>;
};

&qspi {
	status = "okay";

	spi-max-frequency = <76800000>;
	m25p80@0 {
		compatible = "s25fl256s1", "jedec,spi-nor";
		spi-max-frequency = <76800000>;
		reg = <0>;
		spi-tx-bus-width = <1>;
		spi-rx-bus-width = <4>;
		#address-cells = <1>;
		#size-cells = <1>;

		/* MTD partition table.
		 * The ROM checks the first four physical blocks
		 * for a valid file to boot and the flash here is
		 * 64KiB block size.
		 */
		partition@0 {
			label = "QSPI.SPL";
			reg = <0x00000000 0x000020000>;
		};
		partition@1 {
			label = "QSPI.SPL.backup1";
			reg = <0x00020000 0x00020000>;
		};
		partition@2 {
			label = "QSPI.u-boot";
			reg = <0x00040000 0x00100000>;
		};
		partition@3 {
			label = "QSPI.u-boot-spl-os";
			reg = <0x00140000 0x00080000>;
		};
		partition@4 {
			label = "QSPI.u-boot-env";
			reg = <0x001C0000 0x00010000>;
		};
		partition@5 {
			label = "QSPI.u-boot-env.backup1";
			reg = <0x001D0000 0x00010000>;
		};
		partition@6 {
			label = "QSPI.kernel";
			reg = <0x001E0000 0x080000>;
		};
		partition@7 {
			label = "QSPI.user-data";
			reg = <0x009E0000 0x1620000>;
		};
	};
};

&hdmi {
	status = "okay";
	/*
	 * XXX: Support AM572x-Rev 1.2a. this is wrong for AM571x-rev 1.3a,
	 * AM572x-Rev1.3a - but thanks to always-on, they work.
	 * TODO: SWITCH TO LDO4 once rev 1.2a is deprecated
	 * (on rev 1.3a availability)
	 */
	vdda-supply = <&ldo3_reg>;

	port {
		hdmi_out: endpoint {
			remote-endpoint = <&tpd12s015_in>;
		};
	};
};

&dss {
	status = "okay";

	vdda_video-supply = <&ldoln_reg>;

	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		port@0 {
			reg = <0>;

			dpi_out: endpoint {
				remote-endpoint = <&lcd_in>;
				data-lines = <24>;
			};
		};
	};
};

&bb2d {
	status = "okay";
};

&mcasp3 {
          pinctrl-names = "default";
          pinctrl-0 = <&am572x_idk_audio_pins>;

          #sound-dai-cells = <0>;
          assigned-clocks = <&mcasp3_ahclkx_mux>;
          assigned-clock-parents = <&sys_clkin2>;
          status = "okay";

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

&mailbox3 {
	status = "okay";
	mbox_pru1_0: mbox_pru1_0 {
		status = "okay";
	};
	mbox_pru1_1: mbox_pru1_1 {
		status = "okay";
	};
};

&mailbox4 {
	status = "okay";
	mbox_pru2_0: mbox_pru2_0 {
		status = "okay";
	};
	mbox_pru2_1: mbox_pru2_1 {
		status = "okay";
	};
};


&pruss_soc_bus1 {
	status = "okay";

	pruss1: pruss@4b200000 {
		status = "okay";

		pru1_0: pru@4b234000 {
			interrupt-parent = <&pruss1_intc>;
			interrupts = <16>, <17>;
			interrupt-names = "vring", "kick";
			status = "okay";
		};

		pru1_1: pru@4b238000 {
			interrupt-parent = <&pruss1_intc>;
			interrupts = <18>, <19>;
			interrupt-names = "vring", "kick";
			status = "okay";
		};
	};
};

&pruss_soc_bus2 {
	status = "okay";

	pruss2: pruss@4b280000 {
		status = "okay";

		pru2_0: pru@4b2b4000 {
			interrupt-parent = <&pruss2_intc>;
			interrupts = <16>, <17>;
			interrupt-names = "vring", "kick";
			status = "okay";
		};

		pru2_1: pru@4b2b8000 {
			interrupt-parent = <&pruss2_intc>;
			interrupts = <18>, <19>;
			interrupt-names = "vring", "kick";
			status = "okay";
		};
	};
};

aliases {

rtc0 = &mcp_rtc;
rtc1 = &tps659038_rtc;
rtc2 = &rtc;
display0 = &hdmi0;
display1 = &lcd0;

         sound0 = &hdmi;
         sound1 = &sound0;
};

vdd_3v3: fixedregulator-vdd_3v3 {
        compatible = "regulator-fixed";
        regulator-name = "vdd_3v3";
        vin-supply = <&regen1>;
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-always-on;
        regulator-boot-on;
};

aic_dvdd: fixedregulator-aic_dvdd {
       compatible = "regulator-fixed";
       regulator-name = "aic_dvdd_fixed";
       vin-supply = <&vdd_3v3>;

      regulator-min-microvolt = <1800000>;
      regulator-max-microvolt = <1800000>;
      regulator-always-on;
      regulator-boot-on;
};

sound0: sound@0 {
      compatible = "simple-audio-card";
      simple-audio-card,name = "BeagleBoard-X15";
      simple-audio-card,widgets =
              "Line", "Line Out",
              "Line", "Line In";
      simple-audio-card,routing =
             "Line Out", "LLOUT",
             "Line Out", "RLOUT",
             "MIC2L", "Line In",
             "MIC2R", "Line In";
      simple-audio-card,format = "dsp_b";
      simple-audio-card,bitclock-master = <&sound0_master>;
      simple-audio-card,frame-master = <&sound0_master>;
      simple-audio-card,bitclock-inversion;

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

      sound0_master: simple-audio-card,codec {
            sound-dai = <&tlv320aic3104>;
            system-clock-frequency = <24500000>;
      };
};

&i2c1 {
        status = "okay";
        clock-frequency = <400000>;

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

        tps659038: tps659038@58 { ... };

        tc358778: tc358778@0e { ... };

        tpic2810: tpic2810@60 { ... };

        ov2659: ov2659@30 { ... };        

        tlv320aic3104: tlv320aic3104@18 {
               #sound-dai-cells = <0>;
               compatible = "ti,tlv320aic3104";
               reg = <0x18>;
               status = "okay";

               AVDD-supply = <&vdd_3v3>;
               IOVDD-supply = <&vdd_3v3>;
               DRVDD-supply = <&vdd_3v3>;
               DVDD-supply = <&aic_dvdd>;

        };
};

&mcasp3 {

       #sound-dai-cells = <0>;

       status = "okay";

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

But not working.

root@am57xx-evm:~# dmesg | grep sound
[ 2.975879] No soundcards found.
[ 11.788933] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/sound@0[0]'
[ 11.806844] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/sound@0[0]'
[ 11.829823] asoc-simple-card sound@0: tlv320aic3x-hifi <-> 48468000.mcasp mapping ok

root@am57xx-evm:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

root@am57xx-evm:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

Does this mean that there is something wrong with the device tree configuration, and if so, how should I modify it?

Kindly help.

  • The fact that the sound card is being registered and hence listed in "aplay -l" and "arecord -l" indicates that most of your device-tree configuration is correct.

    It's not quite clear what exactly is not working. Are you getting errors when playing or recording? Is playback muted? Are you setting mixer controls (volume, switches, etc) for playback/capture?

    You may want to take a look at this app note (SPRAC10) some audio debugging tips.

  • Hi misael

    thank you for your reply. The problem I'm having is playing mute.


    I entered the following command:

    root@am57xx-evm:~# amixer -c BeagleBoardX15 sset PCM 90
    Simple mixer control 'PCM',0
    Capabilities: pvolume
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 127
    Mono:
    Front Left: Playback 90 [71%] [-18.50dB]
    Front Right: Playback 90 [71%] [-18.50dB]
    root@am57xx-evm:~# amixer -c BeagleBoardX15 sset 'Left Line Mixer DACL1' on
    Simple mixer control 'Left Line Mixer DACL1',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    root@am57xx-evm:~# amixer -c BeagleBoardX15 sset 'Right Line Mixer DACR1' on
    Simple mixer control 'Right Line Mixer DACR1',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    root@am57xx-evm:~# amixer -c BeagleBoardX15 sset 'Line DAC' 90
    Simple mixer control 'Line DAC',0
    Capabilities: pvolume
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 118
    Mono:
    Front Left: Playback 90 [76%] [-14.00dB]
    Front Right: Playback 90 [76%] [-14.00dB]

    root@am57xx-evm:~# aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: H58040000encode [HDMI 58040000.encoder], device 0: HDMI 58040000.encoder snd-soc-dummy-dai-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    root@am57xx-evm:~# arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 1: BeagleBoardX15 [BeagleBoard-X15], device 0: davinci-mcasp.0-tlv320aic3x-hifi tlv320aic3x-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0


    Then, I entered:

    root@am57xx-evm:~# aplay -Dplughw:1,0 /usr/share/sounds/alsa/Noise.wav &
    [1] 1114
    Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

    But the playback is muted, so I enter the following command:

    root@am57xx-evm:~# omapconf show mcasp3
    OMAPCONF (rev v1.73 built Tue Sep 26 19:01:37 EDT 2017)

    HW Platform:
    Generic DRA74X (Flattened Device Tree)
    DRA75X ES2.0 GP Device (STANDARD performance (1.0GHz))
    TPS659038 ES2.2

    SW Build Details:
    Build:
    Version: _____ _____ _ _
    Kernel:
    Version: 4.9.41+
    Author: vefone@F-VirtualMachine
    Toolchain: gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11)
    Type: #8 SMP PREEMPT
    Date: Thu Nov 23 13:42:52 CST 2017

    |---------------------------------------------|
    | Data Ports and Buffers                      |
    |---------------------------------------------|
    | Port                   | DATA bus           |
    | Transmit DMA           |                    |
    |   DMA request          | Enabled            |
    |   Status               | No error           |
    | Receive DMA            |                    |
    |   DMA request          | Enabled            |
    |   Status               | No error           |
    | Transmit Buffer (XBUF) |                    |
    |   Status               | No error           |
    | Receive Buffer (RBUF)  |                    |
    |   Status               | No error           |
    | Write FIFO (WFIFO)     |                    |
    |   State                | Enabled            |
    |   Threshold            | 32 samples         |
    |   Level                | 63 samples in FIFO |
    | Read FIFO (RFIFO)      |                    |
    |   State                | Disabled           |
    |   Threshold            | 16 samples         |
    |   Level                | 0 samples in FIFO  |
    |---------------------------------------------|
    
    |----------------------------------------|
    | Control                                |
    |----------------------------------------|
    | Transmit State-Machine |               |
    |   State                | Held in reset |
    | Transmit Sequencer     |               |
    |   Enabled Slots        | 2             |
    |   Active Slots         | 2             |
    |   Active Slots Mask    | 0x00000003    |
    |   Current Slot         | Inactive      |
    | Receive State-Machine  |               |
    |   State                | Held in reset |
    | Receive Sequencer      |               |
    |   Enabled Slots        | INVALID       |
    |   Active Slots         | 0             |
    |   Active Slots Mask    | 0x00000000    |
    |   Current Slot         | Inactive      |
    |----------------------------------------|
    
    |-----------------------------------------------------|
    | Clocks                                              |
    |-----------------------------------------------------|
    | Transmit Bit Clock        |                         |
    |   State                   | Running                 |
    |   Divider                 | Divide-by 1             |
    |   Source                  | External (ACLKX pin)    |
    |   Polarity                | Driven on rising edge   |
    | Transmit High-Speed Clock |                         |
    |   State                   | Running                 |
    |   Divider                 | Divide-by 1             |
    |   Source                  | External (AHCLKX pin)   |
    |   Polarity                | Non-inverted            |
    | Receive Bit Clock         |                         |
    |   State                   | Held in reset           |
    |   Divider                 | Divide-by 1             |
    |   Source                  | External (ACLKR pin)    |
    |   Polarity                | Samples on falling edge |
    | Sync Mode                 | Synchronous to TX       |
    | Idle Mode                 | Smart-idle              |
    |-----------------------------------------------------|
    
    |---------------------------------------------------|
    | Frame Sync Generator                              |
    |---------------------------------------------------|
    | Transmit Frame Sync |                             |
    |   Generator State   | Held in reset               |
    |   Source            | External                    |
    |   Polarity          | Frame starts on rising edge |
    |   Pulse Width       | Single bit                  |
    |   Slot Count        | 2 (TDM)                     |
    |   Data Delay        | 0-bit                       |
    |   Status            | No error                    |
    | Receive Frame Sync  |                             |
    |   Generator State   | Held in reset               |
    |   Source            | External                    |
    |   Polarity          | Frame starts on rising edge |
    |   Pulse Width       | Single bit                  |
    |   Slot Count        | INVALID                     |
    |   Data Delay        | 0-bit                       |
    |   Status            | No error                    |
    | Sync Mode           | Synchronous to TX           |
    |---------------------------------------------------|
    
    |-----------------------------------------|
    | Format Units                            |
    |-----------------------------------------|
    | Transmit Format Unit |                  |
    |   Slot Size          | 16 bits          |
    |   Bit Mask           | 0x0000FFFF       |
    |   Padding            | Pad with 0       |
    |   Right-Rotation     | 16 bit positions |
    |   Bitstream Order    | MSB first        |
    | Receive Format Unit  |                  |
    |   Slot Size          | 16 bits          |
    |   Bit Mask           | 0x0000FFFF       |
    |   Padding            | Pad with 0       |
    |   Right-Rotation     | 0 bit positions  |
    |   Bitstream Order    | LSB first        |
    |-----------------------------------------|
    
    |----------------------------------|
    | Serializers                      |
    |----------------------------------|
    | Transmit Serializers | Cleared   |
    | Receive Serializers  | Cleared   |
    | Serializer 0         |           |
    |   Mode               | Transmit  |
    |   Inactive State     | Logic Low |
    | Serializer 1         |           |
    |   Mode               | Receive   |
    |   Inactive State     | Hi-Z      |
    | Serializer 2         |           |
    |   Mode               | Inactive  |
    |   Inactive State     | Hi-Z      |
    | Serializer 3         |           |
    |   Mode               | Inactive  |
    |   Inactive State     | Hi-Z      |
    |----------------------------------|
    
    |--------------------------------------------|
    | Pin Control                                |
    |--------------------------------------------|
    | AFSR            |                          |
    |   Functionality | Receive Frame Sync       |
    |   Direction     | Input                    |
    | ACLKR           |                          |
    |   Functionality | Receive Bit Clock        |
    |   Direction     | Input                    |
    | AFSX            |                          |
    |   Functionality | Transmit Frame Sync      |
    |   Direction     | Input                    |
    | ACLKX           |                          |
    |   Functionality | Transmit Bit Clock       |
    |   Direction     | Input                    |
    | AHCLKX          |                          |
    |   Functionality | Transmit High-Freq Clock |
    |   Direction     | Input                    |
    | AXR0            |                          |
    |   Functionality | TX/RX Data Channel 0     |
    |   Direction     | Output                   |
    | AXR1            |                          |
    |   Functionality | TX/RX Data Channel 1     |
    |   Direction     | Input                    |
    | AXR2            |                          |
    |   Functionality | TX/RX Data Channel 2     |
    |   Direction     | Input                    |
    | AXR3            |                          |
    |   Functionality | TX/RX Data Channel 3     |
    |   Direction     | Input                    |
    |--------------------------------------------|
    

    omapconf: powerdm_deinit(): cpu not supported!!!
    omapconf: clockdm_deinit(): cpu not supported!!!


    Is there anything unusual?

    PS: Is the following log normal? Can I ignore it?
    root@am57xx-evm:~# dmesg | grep sound
    [ 2.975879] No soundcards found.
    [ 11.788933] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' property of node '/sound@0[0]'
    [ 11.806844] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' property of node '/sound@0[0]'
    [ 11.829823] asoc-simple-card sound@0: tlv320aic3x-hifi <-> 48468000.mcasp mapping ok


    Kindly help.

  • Here are some mixer controls that I've used for Android on a different platform (tlv320aic3106). I see it's not the same codec you're using but they share the same CODEC driver and I assume most mixer controls are going to be the same ones.

    Regarding the logs, I think they should be OK. In your device-tree file you're not defining the HP/Mic detection properties, but they aren't mandatory.

  • Hi misael

    thank you for your reply. 

    I executed the following instructions based on your configuration:

    amixer -c BeagleBoardX15 cset numid=36,iface=MIXER,name='Left DAC Mux' DAC_L1
    amixer -c BeagleBoardX15 cset numid=38,iface=MIXER,name='Right DAC Mux' DAC_R1
    amixer -c BeagleBoardX15 cset numid=1,iface=MIXER,name='PCM Playback Volume' 127
    amixer -c BeagleBoardX15 cset numid=61,iface=MIXER,name='Left HP Mixer DACL1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=67,iface=MIXER,name='Right HP Mixer DACR1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=21,iface=MIXER,name='HP Playback Switch' 1
    amixer -c BeagleBoardX15 cset numid=17,iface=MIXER,name='HP DAC Playback Volume' 118
    amixer -c BeagleBoardX15 cset numid=34,iface=MIXER,name='Output Driver Power-On time' 200ms
    amixer -c BeagleBoardX15 cset numid=53,iface=MIXER,name='Left Line Mixer DACL1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=59,iface=MIXER,name='Right Line Mixer DACR1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=20,iface=MIXER,name='Line Playback Switch' 1
    amixer -c BeagleBoardX15 cset numid=15,iface=MIXER,name='Line DAC Playback Volume' 118

    Then, I try:
    aplay -Dplughw:1,0 /usr/share/sounds/alsa/Noise.wav

    But the playback is still muted.

    What else can I do to solve this problem?

    Kindly help.

  • Please also double check that the pinmux settings of the DATA lines (AXRn lines) are correctly configured. I assume the BCLK and FSYNC pins are correctly configured, otherwise you would see I/O errors from aplay.

    Did you try reading ALSA procfs entries while audio is supposed to be playing? I'm referring to the entries described in section 2 ("ALSA procfs") of the app note I shared before. The expectation is that hw_ptr and appl_ptr values change continuously when reading their values in procfs.

  • Hi misael

    thank you for your reply. 

    I try: 

    aplay -Dplughw:1,0 /usr/share/sounds/alsa/Noise.wav &

    Then, I check the status

    root@am57xx-evm:~# cat /proc/asound/card1/pcm0p/sub0/status
    state: RUNNING
    owner_pid : 1074
    trigger_time: 67.231251669
    tstamp : 0.000000000
    delay : 23968
    avail : 32
    avail_max : 32
    -----
    hw_ptr : 32
    appl_ptr : 24000

    But the hw_ptr and appl_ptr is never changed.

    PS: What is the correct pinmux settings of the DATA lines (AXRn lines) , could you give me an example?

    Kindly help.

  • The pinmux settings are done in u-boot. Please refer to board/ti/am57xx/mux_data.h. You have to set them based on the pins where CLOCKOUT2, MCASP3_FSX, MCAPS3_ACLKX, MCASP3_AXR0 and MCASP3_AXR1 are routed.

    Please take a look at the page 41-42 (McASP3 pins) and page 89 (xref_clk0) in this document.

  • Hi misael

    thank you for your reply. 

    After I configured pinmux, I can use aplay to play sounds and also use arecord to record, but when I use

    arecord -Dplughw: 1,0 -r192000 -f cd | aplay -Dplughw: 1,0 -r192000

    only hear white noise.

    Amixer is configured like this:

    amixer -c BeagleBoardX15 cset numid=36,iface=MIXER,name='Left DAC Mux' DAC_L1
    amixer -c BeagleBoardX15 cset numid=38,iface=MIXER,name='Right DAC Mux' DAC_R1
    amixer -c BeagleBoardX15 cset numid=1,iface=MIXER,name='PCM Playback Volume' 127
    amixer -c BeagleBoardX15 cset numid=61,iface=MIXER,name='Left HP Mixer DACL1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=67,iface=MIXER,name='Right HP Mixer DACR1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=21,iface=MIXER,name='HP Playback Switch' 1
    amixer -c BeagleBoardX15 cset numid=17,iface=MIXER,name='HP DAC Playback Volume' 118
    amixer -c BeagleBoardX15 cset numid=34,iface=MIXER,name='Output Driver Power-On time' 200ms
    amixer -c BeagleBoardX15 cset numid=53,iface=MIXER,name='Left Line Mixer DACL1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=59,iface=MIXER,name='Right Line Mixer DACR1 Switch' 1
    amixer -c BeagleBoardX15 cset numid=20,iface=MIXER,name='Line Playback Switch' 1
    amixer -c BeagleBoardX15 cset numid=15,iface=MIXER,name='Line DAC Playback Volume' 118

    amixer -c BeagleBoardX15 cset numid=50,iface=MIXER,name='Right PGA Mixer Mic2L Switch' 1
    amixer -c BeagleBoardX15 cset numid=51,iface=MIXER,name='Right PGA Mixer Mic2R Switch' 1
    amixer -c BeagleBoardX15 cset numid=31,iface=MIXER,name='PGA Capture Volume' 100
    amixer -c BeagleBoardX15 cset numid=32,iface=MIXER,name='PGA Capture Switch' 1
    amixer -c BeagleBoardX15 cset numid=40,iface=MIXER,name='Left Line1L Mux' single-ended
    amixer -c BeagleBoardX15 cset numid=41,iface=MIXER,name='Left Line1R Mux' single-ended
    amixer -c BeagleBoardX15 cset numid=42,iface=MIXER,name='Right Line1L Mux' single-ended
    amixer -c BeagleBoardX15 cset numid=43,iface=MIXER,name='Right Line1R Mux' single-ended

    How can I solve this problem?

    Kindly help.

  • Do each command alone work fine for you? For instance:

    # arecord -Dplughw:1,0 -r192000 -f cd myfile.wav

    # aplay -Dplughw:1,0 myfile.wav

  • Hi misael

    Each command alone works fine for me

  • Please see if passing "-f cd" to aplay helps.

    Since you're using the 'plug' plugin, format/channel/rate conversion may happen under-the-hood. If you pass "-v" to aplay or arecord, it will print the stream and plugin configuration - use this information to identify what conversion may be happening in the "arecord | aplay" test and compared it against the test where you run arecord and aplay separately.

  • Hi misael

    thank you for your reply. 

    I can hear the sound when I execute the following command, but I hear more and more noise, which sounds like "Dang Dang Dang"
    root@am57xx-evm:~# arecord -v -Dhw:1,0 -f cd | aplay -v -Dhw:1,0 -f cd
    Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    Hardware PCM card 1 'BeagleBoard-X15' device 0 subdevice 0
    Its setup is:
      stream       : CAPTURE
      access       : RW_INTERLEAVED
      format       : S16_LE
      subformat    : STD
      channels     : 2
      rate         : 44100
      exact rate   : 44100 (44100/1)
      msbits       : 16
      buffer_size  : 22052
      period_size  : 5513
      period_time  : 125011
      tstamp_mode  : NONE
      tstamp_type  : MONOTONIC
      period_step  : 1
      avail_min    : 5513
      period_event : 0
      start_threshold  : 1
      stop_threshold   : 22052
      silence_threshold: 0
      silence_size : 0
      boundary     : 1445199872
      appl_ptr     : 0
      hw_ptr       : 0
    Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    Hardware PCM card 1 'BeagleBoard-X15' device 0 subdevice 0
    Its setup is:
      stream       : PLAYBACK
      access       : RW_INTERLEAVED
      format       : S16_LE
      subformat    : STD
      channels     : 2
      rate         : 44100
      exact rate   : 44100 (44100/1)
      msbits       : 16
      buffer_size  : 22052
      period_size  : 5513
      period_time  : 125011
      tstamp_mode  : NONE
      tstamp_type  : MONOTONIC
      period_step  : 1
      avail_min    : 5513
      period_event : 0
      start_threshold  : 22052
      stop_threshold   : 22052
      silence_threshold: 0
      silence_size : 0
      boundary     : 1445199872
      appl_ptr     : 0
      hw_ptr       : 0

    PS:I tried various combinations of "-Dplughw:1,0" and "-Dhw:1,0", and the result was the same.
    
    What could i can do next?
    
    Kindly help

  • I wonder if the noise may be coming from other routes mixed into the line out. Please refer to page 18 of tlv320aic3104 codec datasheet (here), the output mixers are in the right hand side of the diagram.

    Ideally, you should have only one input routed to the output mixer, that being the DAC route. These routes can be configured via mixer controls, but I don't know the exact ones.

  • Any further questions on this topic? Were you able to identify the cause of the noise?

  • Hi misael

    I tried to turn off mic, which seemed to work,

    amixer -c BeagleBoardX15 cset numid=44,iface=MIXER,name='Left PGA Mixer Line1L Switch' 1
    amixer -c BeagleBoardX15 cset numid=48,iface=MIXER,name='Right PGA Mixer Line1R Switch' 1
    amixer -c BeagleBoardX15 cset numid=46,iface=MIXER,name='Left PGA Mixer Mic2L Switch' 0
    amixer -c BeagleBoardX15 cset numid=51,iface=MIXER,name='Right PGA Mixer Mic2R Switch' 0

    but I couldn't carry out the next test because of the hardware. After I test, I will give you feedback in time.

    Thank you very much

  • The issue appears to be solved. Please file a new ticket if further help is needed.