DA output interface (USB sound card can do experiments on-board speaker and speaker output driver) AD input interface (adjustable potentiometer input) Color LCD display interface (which can take 2.8-inch or 3.2-inch color TFT 320X240) USB2.0 Interface, USB host and USB Device Interface. 2014 – NXP Smart MX2 the world's first secure smart card platform supporting MIFARE Plus and MIFARE DESFire EV1 with EAL 50 was released. 2015 – MIFARE Plus SE, the entry-level version of NXP's proven and reliable MIFARE Plus product family, was introduced.
- Introduction
- NVIDIA Tegra Based Modules
- NXP/Freescale i.MX 6/7 Based Modules
- NXP/Freescale i.MX 8/8X Family Based Modules
- NXP/Freescale i.MX 8M Mini Based Modules
- NXP/Freescale Vybrid Based Modules
- WM9715L AC97 Capture
Our Embedded Linux BSPs use the regular Linux audio subsystem Advanced Linux Sound Architecture (ALSA). The ALSA subsystem can be configured using amixer or alsamixer whereas playing and recording is possible using the ALSA utilities aplay and arecord. Higher-level frameworks such as GStreamer allow to convert audio streams (e.g. sample rate) and play/record encoded audio streams such as MP3, FLAC, or Ogg/Vorbis file formats. This article provides some example commands showing how to control and use audio with a Toradex Embedded Linux BSP.
First Steps
- Fe-Pi Audio Sound Card is based on NXP(Freescale) SGTL5000 codec. Mechanical specification of the board is the same the Raspberry Pi Zero. 3.5mm jacks for Headphone/Mic, Line In, and Line Out.
- PC Pitstop - PC Performance Roots. PC Pitstop began in 1999 with an emphasis on computer diagnostics and maintenance. During the early days of the dot com boom, our online PC maintenance tools were skyrocketing.
You can use the speaker-test
to test audio, or alternatively aplay
if you have an audio file deployed to the board. See a simple example below.
List the available audio devices:
In the example above, sgtl5000audio
, the interface number 2, is the one connected to the headphone jack available on our carrier board. We'll use it. It may vary depending on your SoM; if you have questions, jump to the section specific to your SoM!
First, unmute the interface and adjust the volume:
Then, play a test sound:
Or, if you have a wave file on the board, for instance we'll use Gong.wav:
Audio Multi-channel Routing and Mixing Using alsalib
Bootlin has a great blog post on the topic, read Audio multi-channel routing and mixing using alsalib.
The Colibri T20 modules have a Wolfson WM9715L audio codec on board. To find pin assignment refer to the Hardware reference.
The Apalis T30, Apalis TK1 and Colibri T30 modules feature an on-module SGTL5000 audio codec:
HDA through HDMI
Please note that not all pixel clock frequencies allow for HDA being streamed through HDMI. E.g. at VESA VGA resolution you may get an error reported as follows:
Plus the number of available channels depends on the resp. HDMI device is connected to.
SGTL5000 Capture from Line-In
SGTL5000 Capture from Microphone
SGTL5000 Playback through Headphone
SPDIF through HDMI
The Colibri T20 provides SPDIF signals and Audio through HDMI.
Note that the HDMI sound card is only available if the video output is configured for HDMI and a monitor is attached.
Please note that not all pixel clock frequencies allow for SPDIF being streamed through HDMI. E.g. at VESA VGA resolution you may get an error reported as follows:
WM9715L AC97 Capture from Line-in
- Colibri SODIMM pin 5 & 7 (LINEIN_L/R)
- Iris: Audio header X9 pin 3 & 4 (Line IN R/L)
- Colibri Evaluation Board: Audio jack X26 top blue
- Orchid: Audio jack X11 top blue line in
- MECS Tellurium: Audio jack X11 pin 1 & 2 (LINEIN_L/R)
First ALSA needs to be configured correctly using amixer.
Recording can then be done easily using GStreamer.
ALC898 HDA Capture from Line-in
- Apalis Evaluation Board: HDA Audio jack X27 top blue
First ALSA needs to be configured correctly using amixer.
Recording can then be done easily using GStreamer.
WM9715L AC97 Capture from Microphone
- Colibri SODIMM pin 1 (MIC_IN)
- Iris: Audio header X9 pin 2 (requires biasing)
- Colibri Evaluation Board: Audio jack X26 bottom pink
- Orchid: Audio jack X11 bottom pink MIC in
ALC898 HDA Capture from Microphone
Apalis Evaluation Board: Audio jack X27 bottom pink
WM9715L AC97 Playback through Headphone
- Colibri SODIMM pin 15 & 17 (HEADPHONE_L/R)
- Iris: Audio jack X8
- Colibri Evaluation Board: Audio jack X26 middle green
- Orchid: Audio jack X11 middle green line out
- Protea: Audio jack X53 line out
MECS Tellurium: Audio jack X11 pin 4 & 5 (HEADPHONE_LF/RF)
ALC898 HDA Playback through Headphone
Apalis Evaluation Board: Audio jack X27 middle green
MP3 Playback
The following example shows how to playback MP3 audio via GStreamer using hardware-accelerated MP3 decoding. Please note that the two numbers at the end specify which ALSA card and device to use for audio (e.g. alsasink device=hw:0,0 for WM9715L AC97 through headphones and alsasink device=hw:1,0 for SPDIF through HDMI).
All modules based on the NXP/Freescale i.MX 6 SoC or i.MX 7 SoC provides an on-module NXP/Freescale SGTL5000 audio codec. The SPDIF signals and Audio through HDMI are available only on modules based on i.MX 6 Soc.
HW accelerated decoding and encoding are provided by GStreamer plugins.
Note that the HDMI sound card is only available if the video output is configured for HDMI and a monitor is attached.
SGTL5000 Playback
The SGTL5000 is the default sound device, thus one does not need to specify it explicitly on the command line.
Playback of a wave file:
SGTL5000 Capture from Line-in
Stereo capture can be achieved using Line-in functionality. First, 'Capture Select' needs to be selected correctly in ALSA mixer:
Then recording in various sample rates is natively possible:
SGTL5000 Capture from Microphone
Change the input channel to MIC_IN:
In contrast to Line-in, Microphone capture is mono anyway, hence we can save some space by only recording one channel. The argument -V offers a VU meter which helps to see whether there is any input and if its volume is at a reasonable level.
SPDIF Playback
Apalis features dedicated SPDIF pins and the Apalis Evaluation board provides an Optical Transmitter. Thus the Apalis iMX6 image has the SPDIF feature enabled in our default device tree, while for the Colibri iMX6 and Colibri iMX7 it is not enabled.
HDMI Playback
In addition to the video data stream, HDMI is able to carry audio data as well.Note that depending on the video resolution/framerate used, that feature might not be available.HDMI Playback is currently unavailable for Colibri i.MX7.
MP3 Playback
The following example shows how to playback MP3 audio via GStreamer using hardware-accelerated MP3 decoding. Please note that the two numbers at the end specify which ALSA card and device to use for audio (e.g. alsasink device=hw:0,0 for SGTL5000, alsasink device=hw:1,0 for SPDIF and, alsasink device=hw:2,0 for audio through HDMI, compare with /proc/asound/cards).
Additional GStreamer pipelines can be found on the Freescale community website here.
Additional encoders and decoders can be verified with GStreamer command gst-inspect.
Nxp Sound Cards & Media Devices Driver Download Windows 10
Alternatively, using the playbin plugin, which sets up the pipeline automatically:
Recording MP3
To record and encode to MP3, the following GStreamer command can be used:
The Colibri iMX6ULL does not feature an audio codec on the module. However, it is possible to access all three audio interfaces placing an external audio codec.
However, the Colibri iMX6ULL features a Medium Quality Sound (MQS) interface that can be used to generate medium quality audio via a standard GPIO. Please refer to the module datasheet for more information.
Note: This section currently only applies to Apalis iMX8
SGTL5000 Playback
SGTL5000 Capture from Line-in
SGTL5000 Capture from Microphone
Nxp Sound Cards & Media Devices Driver Downloads
SPDIF Playback
SPDIF Recording
This was done with an optical to electronic medium converter and the signalhooked up to MXM3_217
HDMI Playback
The Verdin iMX8M Mini does not feature an audio codec on the module. However, it is possible to access all Synchronous Audio Interfaces (SAI) placing an external audio codec. The SAI interfaces can beused as I2S (Recommended) or AC97. An I2S is connected to the Wi-Fi module for Bluetooth audio features. Please refer to the module datasheet for more information.
WM8904 Audio Codec
Verdin Development Board and Dahlia Carrier Board features an analog audio interface based on the WM8904CGEFL/RV audio codec IC from Cirrus Logic.
To check the available sound cards, use the cat /proc/asound/cards
command. The expected result on a Verdin iMX8MM:
To record audio, you might need to run the following command to unmute the capture device:
WM8904 Capture from Microphone
WM8904 Capture from Line-in
WM8904 Playback
WM8904 (MP3) Playback
Within the Vybrid module family, only Colibri VF61 supports analog audio. Audio is handled by the onboard Wolfson WM9715L audio codec connected via a AC97 audio link to the Vybrid SoC. The audio codec driver is called wm9712-codec, since it was initially created for the almost identical WM9712L codec.
WM9715L AC97 Playback
Playback of a WAVE file:
Note: Some parts of the AC97 protocol are realized in software. To make Software AC97 efficient, a rather large buffer is used to prepare several AC97 frames in a batch. However, using buffering does not allow the use of the variable sample rate (VRA) feature of the AC97 link during playback since that would require a response that depends on the request flag of the last received frame. Therefore, the hardware is only able to transfer 48kHz sample rate PCM streams. The ALSA audio stack is able to re-sample the sample rate dynamically, the only difference is that a file with a sample rate other than 48kHz requires somewhat more CPU resources while playback (<1% vs ~3%). Implementing the AC97 protocol without buffering would lead to a much higher CPU load than relying on ALSA's re-sampling feature.
The hardware parameter of the PCM stream during playback can be seen via the proc file system:
Playback of encoded audio formats can be achieved using GStreamer. The Colibri VF61 root filesystem does not provide GStreamer by default, however it is installable via Angstrom feeds:
The following GStreamer pipeline allows to playback Ogg Vorbis encoded audio files:
WM9715L AC97 Capture
The WM9715L has two audio ADCs hence allowing stereo audio capture. The input to these capture ADCS can be individually selected through the ALSA Capture Select controls. Capture volume and boost are handled after the channel selection, hence the volume applies for the Microphone as well as for Line-In capturing.
Two record volume modes can be selected, a standard AC97 1.5dB gain steps and an extended mode using 0.75dB gain steps. The extended mode (0.75dB gain steps) has also a larger gain range (-17.25-+30db), so we recommend using the extended mode.
The record volume can then be set to a value between 0-63 (which mappings linearly to the gain ranges above).
Nxp Sound Cards & Media Devices Driver Download Windows 7
Depending on the input (e.g. microphones) a boost might be necessary to increase the ADC signal by +20dB.
Line-in
Stereo capture can be achieved using Line-in functionality. First, the 'Capture Select' needs to be selected correctly in ALSA mixer:
Then recording in various sample rates is natively possible:
To record the Ogg Vorbis audio format, the following GStreamer command can be used
NXP Sound Cards & Media Devices Driver Download
Microphone
The Colibri standard has only one microphone input, which is connected to Mic 1 of the audio codec. The codec internally samples the same signal with both ADCs, hence the ALSA stack receives a stereo signal. However, since the signals are the same, we can save some space by only recording one channel. The argument -V offers a VU meter which helps to see whether there is any input and if its volume is on a reasonable level.
Note: The volume controls 'Mic 1' and 'Mic 2' do not change the volume when capturing from the microphone. Those volume controls are only active if the sidetone path is enabled (e.g. direct path from microphone to headphone). Use the main capture volume to control the microphone volume.
Nxp Sound Cards & Media Devices Driver Download Free
CONFIG_SND_USB_AUDIO is enabled, so you may use USB audio hardware.
If you get the following error when recording from USB, enable the CONFIG_USB_EHCI_TT_NEWSCHED kernel configuration.