Skip to content

Commit 24b9bda

Browse files
feat(linux): Update audio doc for AM62Dx
Add instructions for multichannel playback and recording for AM62D EVM. Signed-off-by: Paresh Bhagat <[email protected]>
1 parent fba9510 commit 24b9bda

File tree

1 file changed

+133
-16
lines changed
  • source/linux/Foundational_Components/Kernel/Kernel_Drivers

1 file changed

+133
-16
lines changed

source/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.rst

Lines changed: 133 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ instances to a codec or an HDMI bridge.
3737

3838
Generic commands and instructions
3939
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40-
.. ifconfig:: CONFIG_part_variant in ('AM62DX')
41-
42-
.. note::
43-
44-
Only Audio playback with static DAC confgiuration is supported.
45-
Recording feature is not supported.
4640

4741
Most of the boards have simple audio setup which means we have one
4842
sound card with one playback and one capture PCM.
@@ -584,24 +578,145 @@ Board-specific instructions
584578
.. rubric:: User space
585579
:name: user-space-9
586580

587-
.. _hdmi_audio:
588-
The hardware defaults are correct for audio playback, the routing is OK
589-
and the volume is 'adequate' but in case the volume is not correct:
581+
.. ifconfig:: CONFIG_part_variant not in ('AM62DX')
582+
583+
.. _hdmi_audio:
584+
585+
The hardware defaults are correct for audio playback, the routing is OK
586+
and the volume is 'adequate' but in case the volume is not correct:
587+
588+
.. code-block:: text
589+
590+
amixer sset PCM 90%
591+
592+
For recording using the mic pin on the 3.5mm jack, you will need to unmute
593+
MIC3R on the codec, and increase the capture volume:
594+
595+
.. code-block:: text
596+
597+
amixer sset 'Left PGA Mixer Mic3R' on
598+
amixer sset 'Right PGA Mixer Mic3R' on
599+
amixer sset PGA 90%
600+
601+
To switch to using HDMI for playback you can refer to: :ref:`hdmi-audio`.
602+
603+
.. ifconfig:: CONFIG_part_variant in ('AM62DX')
604+
605+
The board uses **TAD52512 DAC** and **PCM6240 ADC** connected through
606+
**McASP2 [AXR0,1,3 and 4 for playback, AXR14 for Capture]** for audio.
607+
The board features eight TRRS 3.5mm jack, that can be used for
608+
simultaneous playback and recording.
609+
610+
The AM62D2-EVM audio subsystem provides comprehensive playback and recording
611+
capabilities through dedicated audio codecs. Use the following command to list
612+
available playback devices:
613+
614+
.. code-block:: console
615+
616+
root@am62dxx-evm:/opt/ltp# aplay -l
617+
**** List of PLAYBACK Hardware Devices ****
618+
card 0: AM62D2EVM [AM62D2-EVM], device 0: davinci-mcasp.0-pcmdevice-codec pcmdevice-codec-0 [davinci-mcasp.0-pcmdevice-codec pcmdevice-codec-0]
619+
Subdevices: 1/1
620+
Subdevice #0: subdevice #0
621+
card 0: AM62D2EVM [AM62D2-EVM], device 1: davinci-mcasp.0-tad5x1x-hifi-50 tad5x1x-hifi-50-1 [davinci-mcasp.0-tad5x1x-hifi-50 tad5x1x-hifi-50-1]
622+
Subdevices: 1/1
623+
Subdevice #0: subdevice #0
624+
card 0: AM62D2EVM [AM62D2-EVM], device 2: davinci-mcasp.0-tad5x1x-hifi-51 tad5x1x-hifi-51-2 [davinci-mcasp.0-tad5x1x-hifi-51 tad5x1x-hifi-51-2]
625+
Subdevices: 1/1
626+
Subdevice #0: subdevice #0
627+
card 0: AM62D2EVM [AM62D2-EVM], device 3: davinci-mcasp.0-tad5x1x-hifi-52 tad5x1x-hifi-52-3 [davinci-mcasp.0-tad5x1x-hifi-52 tad5x1x-hifi-52-3]
628+
Subdevices: 1/1
629+
Subdevice #0: subdevice #0
630+
card 0: AM62D2EVM [AM62D2-EVM], device 4: davinci-mcasp.0-tad5x1x-hifi-53 tad5x1x-hifi-53-4 [davinci-mcasp.0-tad5x1x-hifi-53 tad5x1x-hifi-53-4]
631+
Subdevices: 1/1
632+
Subdevice #0: subdevice #0
633+
634+
Audio playback is handled by four TAD5212 codec devices. These devices provide
635+
multi-channel audio output capabilities through the davinci-mcasp interface.
636+
Audio recording is managed by two PCM6240 codec devices. The PCM6240 family
637+
supports multi-channel audio input with configurable profiles for different
638+
I2C addresses.
639+
640+
**Playback Subsystem**
641+
642+
The TAD5212 driver is located in the kernel configuration at:
590643

591644
.. code-block:: text
592645
593-
amixer sset PCM 90%
646+
-> Device Drivers
647+
-> Sound card support (SOUND [=y])
648+
-> Advanced Linux Sound Architecture (SND [=y])
649+
-> ALSA for SoC audio support (SND_SOC [=y])
650+
-> CODEC drivers
651+
-> Texas Instruments TAC5X1X family driver based on I2C (SND_SOC_TAC5X1X_I2C [=m])
594652
595-
For recording using the mic pin on the 3.5mm jack, you will need to unmute
596-
MIC3R on the codec, and increase the capture volume:
653+
To play audio on the AM62D2-EVM, use the aplay command with the appropriate device.
654+
Audio playback is available through connectors J3 and J4.
655+
656+
Example playback command:
657+
658+
.. code-block:: console
659+
660+
root@am62dxx-evm:~# aplay -D hw:0,1 audio_file.wav
661+
662+
**Recording Subsystem**
663+
664+
Audio recording is performed through connectors J1 and J2. The PCM6240 devices
665+
support multiple profiles corresponding to different I2C addresses.
666+
667+
The PCM6240 driver is located in the kernel configuration at:
597668

598669
.. code-block:: text
599670
600-
amixer sset 'Left PGA Mixer Mic3R' on
601-
amixer sset 'Right PGA Mixer Mic3R' on
602-
amixer sset PGA 90%
671+
-> Device Drivers
672+
-> Sound card support (SOUND [=y])
673+
-> Advanced Linux Sound Architecture (SND [=y])
674+
-> ALSA for SoC audio support (SND_SOC [=y])
675+
-> CODEC drivers
676+
-> Texas Instruments PCM6240 Family Audio chips based on I2C (SND_SOC_PCM6240 [=m])
603677
604-
To switch to using HDMI for playback you can refer to: :ref:`hdmi-audio`.
678+
The PCM6240 codec requires profile selection to choose between different
679+
I2C device addresses:
680+
681+
.. code-block:: text
682+
683+
Profile 0: PCM6240 at I2C address 0x48
684+
Profile 1: PCM6240 at I2C address 0x49
685+
686+
To select Profile 0 (I2C address 0x48):
687+
688+
.. code-block:: console
689+
690+
root@am62dxx-evm:~# amixer cset numid=17,iface=MIXER,name='pcm6240-2dev-reg PCM6240 i2c1 Profile id' 0
691+
numid=17,iface=MIXER,name='pcm6240-2dev-reg PCM6240 i2c1 Profile id'
692+
type=INTEGER,access=rw------,values=1,min=0,max=3,step=0
693+
values=0
694+
695+
To select Profile 1 (I2C address 0x49):
696+
697+
.. code-block:: console
698+
699+
root@am62dxx-evm:~# amixer cset numid=17,iface=MIXER,name='pcm6240-2dev-reg PCM6240 i2c1 Profile id' 1
700+
numid=17,iface=MIXER,name='pcm6240-2dev-reg PCM6240 i2c1 Profile id'
701+
type=INTEGER,access=rw------,values=1,min=0,max=3,step=0
702+
values=1
703+
704+
To record 4-channel audio at 48kHz sample rate with 16-bit depth:
705+
706+
.. code-block:: console
707+
708+
root@am62dxx-evm:~# arecord -c 4 -r 48000 -f S16_LE test.wav
709+
710+
**Simultaneous Playback and Recording**
711+
712+
The AM62D2-EVM supports simultaneous audio playback and recording operations.
713+
This allows full-duplex audio processing where audio can be captured through
714+
J1/J2 connectors via PCM6240 codecs while simultaneously playing audio through
715+
J3/J4 connectors via TAD5212 codecs.
716+
717+
.. code-block:: console
718+
719+
arecord -c 4 -r 48000 -f S16_LE - | aplay -
605720
606721
Potential issues
607722
^^^^^^^^^^^^^^^^
@@ -677,3 +792,5 @@ Additional Information
677792

678793
#. `TAD52512 - High-performance stereo audio DAC
679794
<https://www.ti.com/lit/ds/symlink/tad5212.pdf>`__
795+
#. `PCM6240 - Automotive, 4-channel audio ADC
796+
<https://www.ti.com/lit/ds/symlink/pcm6240-q1.pdf>`__

0 commit comments

Comments
 (0)