Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:sound:hdl-axi-spidf [18 Jul 2012 09:46] – [Files] Lars-Peter Clausenresources:tools-software:linux-drivers:sound:hdl-axi-spidf [19 Jan 2018 10:22] (current) – rename xcomm_zynq -> master Alexandru Ardelean
Line 9: Line 9:
 ==== Status ==== ==== Status ====
  
- 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]] |+| [[git.linux.org>sound/soc/adi/axi-spdif.c|git]] | [[git.linux.org>sound/soc/adi/axi-spdif.c|Yes]] |
  
 ==== 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  | [[git.linux.org>sound/soc/adi/axi-spdif.c|sound/soc/adi/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 30: Line 43:
  
 ^ Name ^ Supported by driver ^ Description ^ ^ Name ^ Supported by driver ^ Description ^
-| SND_SOC_DAIFMT_I2S     | no  | I2S Justified mode |+| SND_SOC_DAIFMT_I2S     | no  | I2S mode |
 | SND_SOC_DAIFMT_RIGHT_J | no  | Right Justified mode | | SND_SOC_DAIFMT_RIGHT_J | no  | Right Justified mode |
 | SND_SOC_DAIFMT_LEFT_J  | no  | Left Justified mode  | | SND_SOC_DAIFMT_LEFT_J  | no  | Left Justified mode  |
Line 37: Line 50:
 | 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 86:
 ====== 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 93:
  
 ^  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]]+| [[linux.github>master?sound/soc/adi/adv7511_hdmi.c|In progress]] | [[git.linux.org>sound/soc/adi/adv7511_hdmi.c|In progress]] |
  
 ==== Files ==== ==== Files ====
  
 ^ Function ^ File ^ ^ Function ^ File ^
-| driver  | [[git.linux.org>sound/soc/blackfin/bfin-eval-adau1x61.c]] |+| driver  | [[linux.github>master?sound/soc/adi/adv7511_hdmi.c|sound/soc/adi/adv7511_hdmi.c]] |
  
 ===== Kernel configuration ===== ===== Kernel configuration =====
Line 91: Line 105:
 <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 166:
 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}}
resources/tools-software/linux-drivers/sound/hdl-axi-spidf.1342597614.txt.gz · Last modified: 18 Jul 2012 09:46 by Lars-Peter Clausen