DESK-MX6-L/Peripherals/Audio

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

2021/07/14

First DESK-MX6-L release

2022/03/03

DESK-MX6-L 3.0.0 release
2023/04/07 DESK-MX6-L 4.0.0 release


Peripheral Audio[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.

Device tree configuration[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:

From imx6qdl-sbcx-revb-common.dtsi it is possible to find the codec SSI interface configuration:

    sound {
        compatible = "fsl,imx-audio-tlv320aic31xx";
        model = "sbcx-audio-tlv320aic3100";
        ssi-controller = <&ssi1>;
        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";
        mux-int-port = <1>;
        mux-ext-port = <3>;
        status = "okay";
    };
...
...
&audmux {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_tlv320aic3x_1>;
    status = "okay";
};

&ssi1 {
    status = "okay";
};
...
...
&iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_hog_sbcx &pinctrl_hog_sbcx_one_piece>;
...
...
    tlv320aic3x {
        pinctrl_tlv320aic3x_1: tlv320aic3x_codecgrp-1{
            fsl,pins = <
                MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x130b0
                MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
                MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
                MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
                MX6QDL_PAD_GPIO_3__XTALOSC_REF_CLK_24M 0x130b0

                MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x130b0
            >;
        };
    };

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]

...
...
[    4.408197] fsl-ssi-dai 2028000.ssi: No cache defaults, reading back from HW
...
...
[    4.964996] ALSA device list:
[    4.971421]   #0: sbcx-audio-tlv320aic3100

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

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

Usage speaker-test (from alsa-utils)[edit | edit source]

root@desk-mx6:~# speaker-test -t sine

speaker-test 1.2.6

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Sine wave rate is 440.0000Hz
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 3840 to 5760
Period size range from 1920 to 1920
Using max buffer size 5760
Periods = 4
was set period_size = 1920
was set buffer_size = 5760
 0 - Front Left
Time per period = 2.889438
...
...

In order to unmute the speaker the alsamixer utility can be used.

Additional information[edit | edit source]

Information about alsa-utils can be found on ALSA project wiki pages