The purpose of this page is to describe the Linux ALSA SoC driver for SPDIF transmitter/receiver SoftIP.
Table of contents
The LogiCORE IP SPDIF/AES3 core is a digital audio interface controller that implements the PCM IEC 60958-3 interface features for transmitting and receiving audio data. The core can be configured as an SPDIF/AES3 audio data transmitter or an SPDIF/AES3 audio data receiver.
Typical System Using SPDIF Rx and Tx:
Following design depicts the typical SPDIF transmitter/receiver IP interfaces for audio playback and recording. In transmitter mode, audio from a source like file storage is fed to SPDIF IP block configured in transmitter mode via Audio Formatter. Similarly, in receiver mode, incoming SPDIF audio is fed to SPDIF IP configured as receiver then given to Audio Formatter IP and sent to DDR from which it can be saved to a file as PCM audio.
The SPDIF audio Rx/Tx driver is based on the ALSA framework(refer ASoC sound card). This driver registers one of the 'component' expected by the ALSA framework.This SPDIF audio driver along with Audio Formatter and sound card drivers will create a SPDIF audio pipeline. Driver cannot be used as standalone. The driver is present at https://github.com/Xilinx/linux-xlnx/blob/master/sound/soc/xilinx/xlnx_spdif.c
HW IP Features
Variable sampling rates (32/44.1/48/88.2/96/176.4/192 kHz)
|Audio sample length of 16/20/24-bit||Yes|
|AXI4-Stream interface to carry audio samples in AES3 format||Yes|
|2 audio channels||Yes|
Known Issues & Limitations
Below driver configurations should be enabled.
Device Tree Binding
The dts node should be defined with correct hardware configuration. How to define the node is documented in, xlnx,spdif.txt.
The driver has been tested using following tools.
- ALSA Utilities.
- Gstreamer Utilities.
- Below examples assume sound card registered is #0, playback device is #0, record device is #1.
- Following is the recording audio file with 24bit bit depth, 48khz sampling frequency and 2 channel audio properties.
Procedure to test SPDIF audio with ALSA Utilities
Recording a file: arecord tool is used to record the audio file.
Playing a file: aplay tool is used to play the audio file.
For record device:
For playback device:
Procedure to test SPDIF audio with Gstreamer Utilities
Recording a file: gst-launch is used to record the audio file.
gst-launch is using alsa src plugin to enable recording with SPDIF driver.
Playing a file: gst-launch is used to play the audio file.
gst-launch is using alsa sink plugin to enable playback with SPDIF driver.
Driver has been tested on the following boards
- ZCU106 Rev 1.0
This driver is upstreamed and present at, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/xilinx/xlnx_spdif.c.
- f8def0f - ASoC: xlnx: use clock framework for clocks to SPDIF.
- 24ebbbc - ASoC: xlnx: add SPDIF audio driver.