DESK-MX6UL-L/Peripherals/Audio

From DAVE Developer's Wiki
Jump to: navigation, search
History
Version Issue Date Notes

1.0.0

Apr 2021 First DESK release
2.0.0 Mar 2022 DESK 3.0.0 release


Peripheral Audio[edit | edit source]

200px-Emblem-important.svg.png

The audio peripheral is not available - as default option - on AXEL ULite EVK. Please contact Sales department for this option.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration for the AXEL ULite SOM (using a special version of AXEL ULite EVK mounting option):

From imx6ul-axelulite-cb006c.dts:

        sound {
                compatible = "fsl,imx-audio-tlv320aic31xx";
                model = "axelulite-audio-tlv320aic3100";
                cpu-dai = <&sai2>;
                audio-codec = <&codec>;
                audio-routing =
                        "Speaker", "SPK",
                        "Headphone Jack", "HPL",
                        "Headphone Jack", "HPR",
                        "MIC1LP", "Line In",
                        "MIC1LM", "Line In",
                        "MIC1RP", "Mic Jack",
                        "Mic Jack", "MICBIAS";
                status = "okay";
        };

&i2c4 {
        clock-frequency = <100000>;
        pinctrl-names = "default", "recovery";
        pinctrl-0 = <&pinctrl_i2c4>;
        pinctrl-1 = <&pinctrl_i2c4_recovery>;
        recovery-gpios = <&gpio1 20 0>, <&gpio1 21 0>;
        status = "okay";

        codec: tlv320aic31xx@18 {
                compatible = "ti,tlv320aic3100";
                reg = <0x18>;
                clocks = <&clks IMX6UL_CLK_SAI2>,
                       <&clks IMX6UL_CLK_DUMMY>;
                clock-names = "mclk1", "mclk2";

		gpio-reset = <&gpio1 27 1>;
		HPVDD-supply = <&reg_3p3v>;
		SPRVDD-supply = <&reg_3p3v>;
		SPLVDD-supply = <&reg_3p3v>;
		AVDD-supply = <&reg_3p3v>;
		IOVDD-supply = <&reg_3p3v>;
		DVDD-supply = <&reg_1p8v>;
        };
...
...
&iomuxc {
        pinctrl-0 = <&pinctrl_hog_gpios>;
        imx6ul-axelulite {

        tlv320aic3x {
                pinctrl_tlv320aic3x_1: tlv320aic3x_codecgrp-1{
                        fsl,pins = <
                                MX6UL_PAD_JTAG_TDI__SAI2_TX_BCLK        0x17088
                                MX6UL_PAD_JTAG_TDO__SAI2_TX_SYNC        0x17088
                                MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA     0x11088
                                MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA        0x11088
                                MX6UL_PAD_JTAG_TMS__SAI2_MCLK           0x17088
                                MX6UL_PAD_UART3_RTS_B__GPIO1_IO27       0x130b0 /* codec reset */
                        >;
                };
        };

};

Accessing the peripheral[edit | edit source]

Access to the audio interface is provided by ALSA (Advanced Linux Sound Architecture), which consists in a kernel driver and a users space library for application developers. A set of standard tools alsa-utils can be used for simple management of the audio codec.

Linux messages at boot time[edit | edit source]

...
...
[    3.314515] imx-tlv320aic31xx sound: tlv320aic31xx-hifi <-> 202c000.sai mapping ok
...
...
[    3.545396] ALSA device list:
[    3.548401]   #0: axelulite-audio-tlv320aic3100

To list the audio sound cards just use the aplay utility:

root@desk-mx6ul-axelulite:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: axeluliteaudiot [axelulite-audio-tlv320aic3100], device 0: HiFi tlv320aic31xx-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@desk-mx6ul-axelulite:~#

Usage alsa-utils[edit | edit source]

root@desk-mx6ul-axelulite:~# aplay audio8k16S.wav 
Playing WAVE 'audio8k16S.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo