Difference between revisions of "DESK-MX6-L/Pheripherals/Audio"

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "{{subst:Peripheral | nome-som=AXEL Lite | nome-peripheral = Audio}}")
 
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<section begin=History/>
+
<section begin="History" />
 
{| style="border-collapse:collapse; "
 
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
+
! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History
 
|-  
 
|-  
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Issue Date
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Notes
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
 
|-
 
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|X.Y.Z
+
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |{{oldid|14107|2021/07/14}}
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Month Year
+
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |First DESK-MX6-L release
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD
 
 
|-
 
|-
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |{{oldid|16994|2022/03/03}}
 +
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |DESK-MX6-L 3.0.0 release
 
|-
 
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|[TBD_link X.Y.Z]
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |2023/04/07
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Month Year
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX6-L 4.0.0 release
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD
 
|-
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|...
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|...
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|...
 
 
|-
 
|-
 
|}
 
|}
<section end=History/>
+
<section end="History" />
<section begin=Body/>
+
<section begin="Body" />
  
 
==Peripheral Audio ==
 
==Peripheral Audio ==
  
''TBD: sostituire tutti i dump con le informazioni sull'uso della periferica''
+
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 ===
 
=== Device tree configuration ===
 
Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:
 
Here below an example of device tree configuration used on standard DAVE's kit for the AXEL Lite SOM:
  
From <code>''carrier.dts''</code>:
+
From <code>imx6qdl-sbcx-revb-common.dtsi</code> it is possible to find the codec SSI interface configuration:
  
 
<pre>
 
<pre>
&can1 {
+
    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-names = "default";
     pinctrl-0 = <&pinctrl_flexcan1_axel>;
+
     pinctrl-0 = <&pinctrl_tlv320aic3x_1>;
 
     status = "okay";
 
     status = "okay";
 
};
 
};
</pre>
 
  
From <code>''carrier-common.dtsi''</code>:
+
&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
  
<pre>
+
                 MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x130b0
    can1 {
 
        pinctrl_flexcan1_axel: flexcan1axelgrp-1 {
 
            fsl,pins = <
 
                 MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x80000000
 
                MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x80000000
 
 
             >;
 
             >;
 
         };
 
         };
 
     };
 
     };
 +
 
</pre>
 
</pre>
  
 
===Accessing the peripheral===
 
===Accessing the peripheral===
 +
 +
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====
 
====Linux messages at boot time====
  
Line 60: Line 89:
 
...
 
...
 
...
 
...
[    1.807495] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not found, using dummy regulator
+
[    4.408197] fsl-ssi-dai 2028000.ssi: No cache defaults, reading back from HW
[    1.817366] flexcan 2090000.flexcan: device registered (reg_base=c0a30000, irq=31)
 
 
...
 
...
 
...
 
...
[    3.952659] can: controller area network core (rev 20170425 abi 9)
+
[    4.964996] ALSA device list:
[    3.963413] can: raw protocol (rev 20170425)
+
[    4.971421]   #0: sbcx-audio-tlv320aic3100
[    3.967717] can: broadcast manager protocol (rev 20170425 t)
 
[    3.973397] can: netlink gateway (rev 20170425) max_hops=1
 
 
</pre>
 
</pre>
  
====Enable the interface and check status====
+
To list the audio sound cards just use the <code>aplay</code> utility:
 +
 
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
root@imx6qxelk:~# ip link set can0 type can bitrate 500000
+
root@desk-mx6:~# aplay -l
root@imx6qxelk:~# ifconfig can0 up
+
**** List of PLAYBACK Hardware Devices ****
root@imx6qxelk:~# ifconfig can0
+
card 0: sbcxaudiotlv320 [sbcx-audio-tlv320aic3100], device 0: HiFi tlv320aic31xx-hifi-0 [HiFi tlv320aic31xx-hifi-0]
can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
+
  Subdevices: 1/1
          UP RUNNING NOARP  MTU:16  Metric:1
+
  Subdevice #0: subdevice #0
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
+
</pre>
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:10
 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
          Interrupt:31
 
  
root@imx6qxelk:~#
+
====Usage [https://alsa-project.org/wiki/SoundcardTesting speaker-test (from alsa-utils)] ====
</pre>
 
  
==== Usage with [https://github.com/linux-can/can-utils can-utils] ====
+
<pre class="workstation-terminal">
 +
root@desk-mx6:~# speaker-test -t sine
  
''TBD: reference verso eventuali informazioni sul web''
+
speaker-test 1.2.6
  
<pre class="workstation-terminal">
+
Playback device is default
root@imx6qxelk:~# ip link set can0 type can bitrate 500000 triple-sampling on
+
Stream parameters are 48000Hz, S16_LE, 1 channels
root@imx6qxelk:~# ifconfig can0 up
+
Sine wave rate is 440.0000Hz
root@imx6qxelk:~# cansend can0 128#1122334455667788
+
Rate set to 48000Hz (requested 48000Hz)
root@imx6qxelk:~# candump can0
+
Buffer size range from 3840 to 5760
  can0  128  [8]  11 22 33 44 55 66 77 88
+
Period size range from 1920 to 1920
root@imx6qxelk:~#
+
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
 +
...
 +
...
 
</pre>
 
</pre>
 +
 +
In order to unmute the speaker the <code>alsamixer</code> utility can be used.
  
 
=== Additional information ===
 
=== Additional information ===
Each CAN port appears like a networking interface in the form <code>canX</code> where <b><i>X</i></b> is the port number.
 
  
Information about programming the CAN socket interface is given in the kernel tree under ''Documentation/networking/can.txt''
+
Information about ''alsa-utils'' can be found on [https://alsa-project.org/wiki/Documentation ALSA project wiki pages]
<section end=Body/>
+
<section end="Body" />
  
 
----
 
----
  
 
[[Category:AXEL Lite]]
 
[[Category:AXEL Lite]]

Latest revision as of 16:59, 8 January 2024

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