The Sony/Philips Digital Interface (S/PDIF) Tx Driver
i.MX51 EVK Linux Reference Manual
Freescale Semiconductor
18-3
0 [imx3stack ]: SGTL5000 - imx-3stack
imx_3stack (SGTL5000)
1 [TXRX ]: MXC_SPDIF - MXC SPDIF TX/RX
MXC Freescale with SPDIF
The number at the beginning of the MXC_SPDIF line is the card ID. The string in the square
brackets is the card name
— Get Playback PCM device info
#cat /proc/asound/TXRX/pcm[card id]p/info
•
Software operation
The ALSA utility provides a common method for user spaces to operate and use ALSA drivers
#aplay -D "hw:2,0" -t wav audio.wav
NOTE
The -D parameter of
aplay
indicates the PCM device with card ID and PCM
device ID:
hw:[card id],[pcm device id]
18.2.1
Driver Design
Before S/PDIF playback, the configuration, interrupt, clock and channel registers should be initialized.
Clock settings are the same for specific hardware connections. During S/PDIF playback, the channel status
bits are fixed. The resync, underrun/overrun, empty interrupt and DMA transmit request should be
enabled. S/PDIF has 16 TX sample FIFOs on Left and Right channel respectively. When both FIFOs are
empty, an empty interrupt is generated if the empty interrupt is enabled. If no data are refilled in the 20.8
µ
s
(1/48000), an underrun interrupt is generated. Overrun is avoided if only 16 sample FIFOs are filled for
each channel every time. If auto re-synchronization is enabled, the hardware checks if the left and right
FIFO are in sync, and if not, it sets the filling pointer of the right FIFO to be equal to the filling pointer of
the left FIFO and an interrupt is generated.
18.2.2
Provided User Interface
The S/PDIF transmitter driver provides one ALSA mixer sound control interface to the user besides the
common PCM operations interface. It provides the interface for the user to write S/PDIF channel status
codes into the driver so they can be sent in the S/PDIF stream. The input parameter of this interface is the
IEC958 digital audio structure shown below, and only status member is used:
struct snd_aes_iec958 {
unsigned char status[24]; /* AES/IEC958 channel status bits */
unsigned char subcode[147]; /* AES/IEC958 subcode bits */
unsigned char pad; /* nothing */
unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
};
•
Summary of Contents for i.MX51 EVK
Page 1: ...Part Number 924 76374 Rev 10 11 01 11 2010 i MX51 EVK Linux Reference Manual...
Page 14: ...i MX51 EVK Linux Reference Manual xiv Freescale Semiconductor...
Page 18: ...i MX51 EVK Linux Reference Manual xviii Freescale Semiconductor...
Page 24: ...i MX51 EVK Linux Reference Manual xxiv Freescale Semiconductor...
Page 38: ...Machine Specific Layer MSL i MX51 EVK Linux Reference Manual 2 8 Freescale Semiconductor...
Page 52: ...MC13892 Digitizer Driver i MX51 EVK Linux Reference Manual 5 4 Freescale Semiconductor...
Page 64: ...TV Encoder TVE Driver i MX51 EVK Linux Reference Manual 10 4 Freescale Semiconductor...
Page 82: ...Video for Linux Two V4L2 Driver i MX51 EVK Linux Reference Manual 12 8 Freescale Semiconductor...
Page 86: ...i MX5 Dual Display i MX51 EVK Linux Reference Manual 13 4 Freescale Semiconductor...
Page 100: ...X Windows Acceleration i MX51 EVK Linux Reference Manual 16 6 Freescale Semiconductor...
Page 118: ...Low Level Keypad Driver i MX51 EVK Linux Reference Manual 20 6 Freescale Semiconductor...
Page 134: ...Security Drivers i MX51 EVK Linux Reference Manual 22 10 Freescale Semiconductor...
Page 148: ...Inter IC I2C Driver i MX51 EVK Linux Reference Manual 24 4 Freescale Semiconductor...
Page 178: ...ARC USB Driver i MX51 EVK Linux Reference Manual 29 10 Freescale Semiconductor...
Page 194: ...OProfile i MX51 EVK Linux Reference Manual 33 6 Freescale Semiconductor...