The purpose of this page is to describe the Xilinx ALSA sound card driver based on ASoC framework.
Xilinx ASoC audio driver architecture has the characteristics of high code re-usability and modularity. This solution is tested using ALSA applications (arecord/aplay) and GStreamer. Xilinx ASoC architecture extends ALSA framework to support in embedded audio system.
An Audio Sound card has following components in software:
The role of machine driver is to create a pipeline out of the mentioned drivers above. This glue or DAI(Digital Audio Interface) link is made using registered device names or device nodes (using OF kernel framework). Each proper DAI link will result as a device in a sound card. A sound card is thus a logical grouping of several such devices.
Audio Formatter driver is responsible for creating the 'platform device' for the sound card. While creating the device, it passes the device tree node of either I2S/HDMI/SDI/SPDIF depending on the kind of sound card being created. The node of I2S/HDMI/SDI/SDPDIF also carries a reference to phandle of audio formatter node depicting the pipeline used in the system solution. Once, sound card driver detects the kind of audio node (I2S/HDMI/SDI/SPDIF), proper DAI link is selected from the available links.
The driver is available at, https://github.com/Xilinx/linux-xlnx/blob/master/sound/soc/xilinx/xlnx_pl_snd_card.c.
DAI link describes the components which creates an audio pipeline. Following are the DAI links used in the driver:
Note: One of the link component 'platform_of_node' pointing to Audio Formatter node is common in all the links.
static struct snd_soc_dai_link xlnx_snd_dai[][XLNX_MAX_PATHS] = { [I2S_AUDIO] = { { .name = "xilinx-i2s_playback", .codec_dai_name = "snd-soc-dummy-dai", .codec_name = "snd-soc-dummy", .ops = &xlnx_i2s_card_ops, }, { .name = "xilinx-i2s_capture", .codec_dai_name = "snd-soc-dummy-dai", .codec_name = "snd-soc-dummy", .ops = &xlnx_i2s_card_ops, }, }, [HDMI_AUDIO] = { { .name = "xilinx-hdmi-playback", .codec_dai_name = "i2s-hifi", .codec_name = "hdmi-audio-codec.0", .cpu_dai_name = "snd-soc-dummy-dai", }, { .name = "xilinx-hdmi-capture", .codec_dai_name = "xlnx_hdmi_rx", .cpu_dai_name = "snd-soc-dummy-dai", }, }, [SDI_AUDIO] = { { .name = "xlnx-sdi-playback", .codec_dai_name = "xlnx_sdi_tx", .cpu_dai_name = "snd-soc-dummy-dai", }, { .name = "xlnx-sdi-capture", .codec_dai_name = "xlnx_sdi_rx", .cpu_dai_name = "snd-soc-dummy-dai", }, }, [SPDIF_AUDIO] = { { .name = "xilinx-spdif_playback", .codec_dai_name = "snd-soc-dummy-dai", .codec_name = "snd-soc-dummy", }, { .name = "xilinx-spdif_capture", .codec_dai_name = "snd-soc-dummy-dai", .codec_name = "snd-soc-dummy", }, }, |
This is a logical driver hence not applicable.
Features | 2019.1 |
---|---|
Multiple sample rate support | Yes |
Below driver configuration should be enabled.
CONFIG_SND_SOC_XILINX_PL_SND_CARD=y |
This is a logical driver hence not applicable.
The registered sound cards(along with its playback and capture devices) can be found at /proc/asound/cardX.
#ls /proc/asound/card0/ id pcm0p pcm1c |
Refer to the links provided in the Related Links section to use the soundcard.