This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-drivers:sound:hdl-axi-spidf [18 Jul 2012 09:46] – [Files] Lars-Peter Clausen | resources: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 | + | ^ Source ^ Mainlined? ^ |
- | | [[https:// | + | | [[git.linux.org>sound/soc/adi/ |
==== Files ==== | ==== Files ==== | ||
^ Function ^ File ^ | ^ Function ^ File ^ | ||
- | | driver | + | | driver |
====== 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 " | ||
+ | * reg: Base address and register area size | ||
+ | * clock-frequency: | ||
+ | |||
+ | Example: | ||
+ | < | ||
+ | axi_spdif_tx_0: | ||
+ | compatible = " | ||
+ | reg = < | ||
+ | clock-frequency = < | ||
+ | }; | ||
+ | </ | ||
===== DAI configuration ===== | ===== DAI configuration ===== | ||
Line 30: | Line 43: | ||
^ Name ^ Supported by driver ^ Description ^ | ^ Name ^ Supported by driver ^ Description ^ | ||
- | | SND_SOC_DAIFMT_I2S | + | | SND_SOC_DAIFMT_I2S |
| SND_SOC_DAIFMT_RIGHT_J | no | Right Justified mode | | | SND_SOC_DAIFMT_RIGHT_J | no | Right Justified mode | | ||
| SND_SOC_DAIFMT_LEFT_J | | SND_SOC_DAIFMT_LEFT_J | ||
Line 37: | Line 50: | ||
| SND_SOC_DAIFMT_AC97 | | SND_SOC_DAIFMT_AC97 | ||
| SND_SOC_DAIFMT_PDM | | SND_SOC_DAIFMT_PDM | ||
- | | SND_SOC_DAIFMT_SPDIF | + | | SND_SOC_DAIFMT_SPDIF |
| | | | | | | | ||
| 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, | ||
===== Source ===== | ===== Source ===== | ||
Line 79: | Line 93: | ||
^ Source | ^ Source | ||
- | | [[bfgit>linux-kernel?sound/soc/blackfin/bfin-eval-adau1x61.c|In progress]] | [[git.linux.org> | + | | [[linux.github> |
==== Files ==== | ==== Files ==== | ||
^ Function ^ File ^ | ^ Function ^ File ^ | ||
- | | driver | + | | driver |
===== Kernel configuration ===== | ===== Kernel configuration ===== | ||
Line 91: | Line 105: | ||
< | < | ||
Device Drivers | Device Drivers | ||
- | <Y> Sound card support | + | <*> Sound card support |
- | <Y> | + | <*> |
- | <Y> ALSA for SoC audio support | + | <*> ALSA for SoC audio support |
- | <Y> .... | + | <*> SoC Audio for Xilinx based boards |
+ | < | ||
+ | </ | ||
+ | |||
+ | ===== 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 " | ||
+ | * cpu-dai: Phandle to the SPDIF device devicetree entry | ||
+ | * pcm: Phandle to the PCM device devicetree entry | ||
+ | |||
+ | Example: | ||
+ | < | ||
+ | axi_dma_0: axidma@40400000 { | ||
+ | # | ||
+ | #size-cells = < | ||
+ | #dma-cells = < | ||
+ | compatible = " | ||
+ | reg = < | ||
+ | xlnx, | ||
+ | dma-channel@40400000 { | ||
+ | compatible = " | ||
+ | interrupts = <0 58 0x4>; | ||
+ | xlnx, | ||
+ | xlnx, | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | xilinx_pcm_audio: | ||
+ | compatible = " | ||
+ | #size-cells = < | ||
+ | # | ||
+ | |||
+ | playback: stream@0 { | ||
+ | reg = < | ||
+ | dma-request = <& | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | axi_spdif_tx_0: | ||
+ | compatible = " | ||
+ | reg = < | ||
+ | clock-frequency = < | ||
+ | }; | ||
+ | |||
+ | adv7511_hdmi_snd: | ||
+ | compatible = " | ||
+ | cpu-dai = <& | ||
+ | pcm = <& | ||
+ | }; | ||
</ | </ | ||
Line 101: | Line 166: | ||
Make sure the sound card is properly instantiated. | Make sure the sound card is properly instantiated. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
+ | root:/> aplay -l | ||
+ | card 0: monitor [HDMI monitor], device 0: HDMI adv7511-0 [] | ||
+ | Subdevices: 1/1 | ||
+ | Subdevice #0: subdevice #0 | ||
</ | </ | ||
- | </box> | + | </WRAP> |
- | < | + | To test audio playback you can use the // |
+ | |||
+ | <WRAP box bggreen>< | ||
< | < | ||
- | root:/> | + | root:/> |
+ | 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 | ||
+ | .... | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 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>< | ||
+ | < | ||
+ | root:/> arecord -f S16 -r 48000 -c 2 > test.wav | ||
... | ... | ||
</ | </ | ||
- | </ | + | </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. | ||
+ | < | ||
+ | < | ||
+ | root:/> arecord -f S16 -r 48000 -c 2 | aplay | ||
+ | ... | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | For more information on the the //aplay// and //arecord// utilities please refer to the [[http:// | ||
+ | ===== More information ===== | ||
+ | |||
+ | * [[resources/ | ||
+ | * [[../ | ||
+ | |||
+ | {{page>resources/ |