Xilinx ALSA SPDIF driver

The purpose of this page is to describe the Linux ALSA SoC driver for SPDIF transmitter/receiver SoftIP.

Table of contents

Introduction

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

IP Features2019.1

Variable sampling rates (32/44.1/48/88.2/96/176.4/192 kHz)

Yes
Audio sample length of 16/20/24-bitYes
AXI4-Stream interface to carry audio samples in AES3 formatYes
2 audio channelsYes


Known Issues & Limitations

  • None

Kernel Configurations

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 inxlnx,spdif.txt.

Test Procedure

The driver has been tested using following tools.

  1. ALSA Utilities.
  2. Gstreamer Utilities.

Note:

  1. Below examples assume sound card registered is #0, playback device is #0, record device is #1.
  2. 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.

Device Enumeration:

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.

Boards Supported

Driver has been tested on the following boards

  1. ZCU106 Rev 1.0

Mainline Status

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.

Change Log

2020.1

  • Summary
    • No changes

2019.2

  • Summary
    • No changes

2019.1

  • Summary:
    • Initial release
  • Commits:
    • f8def0f    - ASoC: xlnx: use clock framework for clocks to SPDIF.
    • 24ebbbc - ASoC: xlnx: add SPDIF audio driver.

Related Links