This shows you the differences between two versions of the page.
|
resources:tools-software:linux-drivers:sound:hdl-axi-spidf [17 Jul 2012 18:00] larsc [Supported DAI formats] |
resources:tools-software:linux-drivers:sound:hdl-axi-spidf [03 Jan 2013 19:48] (current) |
||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ^ Source ^ Mainlined? ^ | ^ Source ^ Mainlined? ^ | ||
| - | | [[https://github.com/lclausen-adi/linux-2.6/blob/adv7511_zynq/sound/soc/xlnx/axi-spdif.c|git]] | [[git.linux.org>sound/soc/codecs/adau1761.c|In progress]] | | + | | [[linux.github>xcomm_zynq?sound/soc/xlnx/axi-spdif.c|git]] | [[git.linux.org>sound/soc/xlnx/axi-spdif.c|In progress]] | |
| ==== Files ==== | ==== Files ==== | ||
| ^ Function ^ File ^ | ^ Function ^ File ^ | ||
| - | | driver | [[https://github.com/lclausen-adi/linux-2.6/blob/adv7511_zynq/sound/soc/xlnx/axi-spdif.c|/sound/soc/xlnx/axi-spdif.c]] | | + | | driver | [[linux.github>xcomm_zynq?sound/soc/xlnx/axi-spdif.c|sound/soc/xlnx/axi-spdif.c]] | |
| ====== Example device initialization ====== | ====== Example device initialization ====== | ||
| - | .... | + | The AXI SPDIF driver is a platform driver and can currently only be instantiated via device tree. |
| + | Required devicetree properties: | ||
| + | * compatible: Should always be "adi,axi-spdif-tx-1.00.a" | ||
| + | * reg: Base address and register area size | ||
| + | * clock-frequency: Clock frequency applied at the spdif_data_clk pin in HZ | ||
| + | |||
| + | Example: | ||
| + | <code> | ||
| + | axi_spdif_tx_0: axi-spdif-tx@75c00000 { | ||
| + | compatible = "adi,axi-spdif-tx-1.00.a"; | ||
| + | reg = <0x75c00000 0x1000>; | ||
| + | clock-frequency = <12288000>; | ||
| + | }; | ||
| + | </code> | ||
| ===== DAI configuration ===== | ===== DAI configuration ===== | ||
| Line 37: | Line 49: | ||
| | SND_SOC_DAIFMT_AC97 | no | AC97 mode | | | SND_SOC_DAIFMT_AC97 | no | AC97 mode | | ||
| | SND_SOC_DAIFMT_PDM | no | Pulse density modulation | | | SND_SOC_DAIFMT_PDM | no | Pulse density modulation | | ||
| - | | SND_SOC_DAIFMT_SPDIF | yes | SPDIF mode | | + | | SND_SOC_DAIFMT_SPDIF | yes | SPDIF mode | |
| | | | | | | | | ||
| | SND_SOC_DAIFMT_NB_NF | yes | Normal bit- and frameclock | | | SND_SOC_DAIFMT_NB_NF | yes | Normal bit- and frameclock | | ||
| Line 73: | Line 85: | ||
| ====== ADV7511 HDMI + SPDIF board driver ====== | ====== ADV7511 HDMI + SPDIF board driver ====== | ||
| + | The HDL AXI SPDIF driver is currently used in conjunction with the ADV7511 HDMI transmitter on various FPGA platforms. For these platforms there exist a ASoC board driver which provides the necessary information on how both device are interconnected, so that a ALSA sound card can be instantiated. | ||
| ===== Source ===== | ===== Source ===== | ||
| Line 79: | Line 92: | ||
| ^ Source ^ Mainlined? ^ | ^ Source ^ Mainlined? ^ | ||
| - | | [[bfgit>linux-kernel?sound/soc/blackfin/bfin-eval-adau1x61.c|In progress]] | [[git.linux.org>sound/soc/blackfin/bfin-eval-adau1x61.c|In progress]] | + | | [[https://github.com/lclausen-adi/linux-2.6/blob/adv7511_zynq/sound/soc/xlnx/adv7511_hdmi.c|In progress]] | [[git.linux.org>sound/soc/xlnx/adv7511_hdmi.c|In progress]] | |
| ==== Files ==== | ==== Files ==== | ||
| ^ Function ^ File ^ | ^ Function ^ File ^ | ||
| - | | driver | [[git.linux.org>sound/soc/blackfin/bfin-eval-adau1x61.c]] | | + | | driver | [[https://github.com/lclausen-adi/linux-2.6/blob/adv7511_zynq/sound/soc/xlnx/adv7511_hdmi.c|sound/soc/xlnx/adv7511_hdmi.c]] | |
| ===== Kernel configuration ===== | ===== Kernel configuration ===== | ||
| Line 91: | Line 104: | ||
| <code> | <code> | ||
| Device Drivers ---> | Device Drivers ---> | ||
| - | <y> Sound card support ---> | + | <*> Sound card support ---> |
| - | <y> Advanced Linux Sound Architecture ---> | + | <*> Advanced Linux Sound Architecture ---> |
| - | <y> ALSA for SoC audio support ---> | + | <*> ALSA for SoC audio support ---> |
| - | <y> .... | + | <*> SoC Audio for Xilinx based boards |
| + | <*> ADV7511 HDMI transmitter sound support | ||
| + | </code> | ||
| + | |||
| + | ===== Example device initialization ===== | ||
| + | |||
| + | The ADV7511 HDMI sound board driver is a platform driver and can currently only be instantiated via device tree. | ||
| + | |||
| + | Required devicetree properties: | ||
| + | * compatible: Should always be "adv7511-hdmi-snd" | ||
| + | * cpu-dai: Phandle to the SPDIF device devicetree entry | ||
| + | * pcm: Phandle to the PCM device devicetree entry | ||
| + | |||
| + | Example: | ||
| + | <code> | ||
| + | axi_dma_0: axidma@40400000 { | ||
| + | #address-cells = <1>; | ||
| + | #size-cells = <1>; | ||
| + | #dma-cells = <1>; | ||
| + | compatible = "xlnx,axi-dma"; | ||
| + | reg = <0x40400000 0x1000>; | ||
| + | xlnx,sg-include-stscntrl-strm = <0x0>; | ||
| + | dma-channel@40400000 { | ||
| + | compatible = "xlnx,axi-dma-mm2s-channel"; | ||
| + | interrupts = <0 58 0x4>; | ||
| + | xlnx,datawidth = <0x20>; | ||
| + | xlnx,include-dre = <0x0>; | ||
| + | }; | ||
| + | }; | ||
| + | |||
| + | xilinx_pcm_audio: xilinx_pcm_audio { | ||
| + | compatible = "xilinx-pcm-audio"; | ||
| + | #size-cells = <0>; | ||
| + | #address-cells = <1>; | ||
| + | |||
| + | playback: stream@0 { | ||
| + | reg = <0>; | ||
| + | dma-request = <&axi_dma_0 0>; | ||
| + | }; | ||
| + | }; | ||
| + | |||
| + | axi_spdif_tx_0: axi-spdif-tx@0x75c00000 { | ||
| + | compatible = "adi,axi-spdif-tx-1.00.a"; | ||
| + | reg = <0x75c00000 0x1000>; | ||
| + | clock-frequency = <12288000>; | ||
| + | }; | ||
| + | |||
| + | adv7511_hdmi_snd: adv7511_hdmi_snd { | ||
| + | compatible = "adv7511-hdmi-snd"; | ||
| + | cpu-dai = <&axi_spdif_tx_0>; | ||
| + | pcm = <&xilinx_pcm_audio>; | ||
| + | }; | ||
| </code> | </code> | ||
| Line 101: | Line 165: | ||
| Make sure the sound card is properly instantiated. | Make sure the sound card is properly instantiated. | ||
| - | <box 100% green|shell prompt running on the target> | + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> |
| <xterm> | <xterm> | ||
| + | root:/> aplay -l | ||
| + | card 0: monitor [HDMI monitor], device 0: HDMI adv7511-0 [] | ||
| + | Subdevices: 1/1 | ||
| + | Subdevice #0: subdevice #0 | ||
| </xterm> | </xterm> | ||
| - | </box> | + | </WRAP> |
| - | <box 100% green|shell prompt running on the target> | + | To test audio playback you can use the //speaker-test// utility, which allows to playback several different test patterns. For a extensive description on the //speaker-test// utility and the different options it supports please refer to the [[http://linux.die.net/man/1/speaker-test|speaker-test man page]]. |
| + | |||
| + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> | ||
| <xterm> | <xterm> | ||
| - | root:/> speakertest -c 2 | + | root:/> speaker-test -c 2 |
| + | speaker-test 1.0.24.2 | ||
| + | |||
| + | Playback device is default | ||
| + | Stream parameters are 48000Hz, S16_LE, 2 channels | ||
| + | Using 16 octaves of pink noise | ||
| + | Rate set to 48000Hz (requested 48000Hz) | ||
| + | Buffer size range from 512 to 2097152 | ||
| + | Period size range from 256 to 262143 | ||
| + | Requested buffer time 20000 us | ||
| + | Periods = 4 | ||
| + | was set period_size = 320 | ||
| + | was set buffer_size = 960 | ||
| + | 0 - Front Left | ||
| + | 1 - Front Right | ||
| + | .... | ||
| + | </xterm> | ||
| + | </WRAP> | ||
| + | |||
| + | To test audio record you can use the //arecord// utility. //arecord// will record the incoming audio signal and write it to a wav file. | ||
| + | |||
| + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> | ||
| + | <xterm> | ||
| + | root:/> arecord -f S16 -r 48000 -c 2 > test.wav | ||
| ... | ... | ||
| </xterm> | </xterm> | ||
| - | </box> | + | </WRAP> |
| + | |||
| + | To playback a wav file you can use the //aplay// utility. You can also create a audio loop-back by sending the output of //arecord// to //aplay//. This will send the incoming audio stream back via the outgoing audio stream. | ||
| + | <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> | ||
| + | <xterm> | ||
| + | root:/> arecord -f S16 -r 48000 -c 2 | aplay | ||
| + | ... | ||
| + | </xterm> | ||
| + | </WRAP> | ||
| + | |||
| + | For more information on the the //aplay// and //arecord// utilities please refer to the [[http://linux.die.net/man/1/arecord|aplay and arecord man page]]. | ||
| + | ===== More information ===== | ||
| + | |||
| + | * [[resources/fpga/xilinx/fmc/ad-fmcomms1-ebz|AD-FMCOMMS1-EBZ Reference Design]] | ||
| + | * [[../platforms/zynq|Linux with HDMI video output on the ZED and ZC702 boards]] | ||
| + | |||
| + | {{page>resources/tools-software/linux-drivers/need_help#need help&noheader&firstseconly&noeditbtn}} | ||