Jetson Nano使用PCM5102音频DAC模块

2020-06-23  本文已影响0人  Mr_Michael

一、产品说明

image

​ 数字信号转模拟音频输出

二、通信格式

3线音频接口:LRCK、BCK和DIN。

音频格式选择:FMT 引脚

模拟信号输出:OUTL、OUTR

静音控制:XSMT:默认高

系统时钟输入:SCK【可选】

1.左对齐格式

2.I2S格式

上层应用播放音乐时,每发一个word的数据就切换一次左右声道,就可以达到双声道同时输出的效果。

三、配置修改

Audio Setup and Development

参考:https://www.jianshu.com/p/95b3b8cdc08b

1.开启I2S引脚接口

The I2S and AUDIO_MCLK are mapped to the following GPIOs:

# jetson nano开发板上启动Jetson‑IO
sudo find /opt/nvidia/jetson-io/ -mindepth 1 -maxdepth 1 -type d -exec touch {}/__init__.py \;
sudo /opt/nvidia/jetson-io/jetson-io.py
image

​ 打开I2S4,保存并重新启动以重新配置引脚:通过为配置应用设备树覆盖来创建新的DTB。然后,它将更新用于引导Linux的配置文件( /boot/extlinux/extlinux.conf)并重新引导开发人员工具包。

​ 使用/boot/tegra210-p3448-0000-p3449-0000-a02-user-custom.dtb文件覆盖public source的tegra210-p3448-0000-p3449-0000-a02.dtb文件。

2.PCM5102与Jetson nano引脚连接

3.测试I2S

# 查看引脚配置
sudo grep "Name:\|J:\|BB:" /sys/kernel/debug/tegra_gpio
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
 J: 2:1 00 00 00 00 00 00 000000
BB: 6:3 00 00 00 00 00 00 000000


cat /proc/asound/cards
 0 [tegrahda       ]: tegra-hda - tegra-hda
                      tegra-hda at 0x70038000 irq 83
 1 [tegrasndt210ref]: tegra-snd-t210r - tegra-snd-t210ref-mobile-rt565x
                      tegra-snd-t210ref-mobile-rt565x
        
# 将I2S绑定到声卡
# amixer -c <cardname> cset name="I2Sn Mux" ADMAIF<i>
amixer -c tegrasndt210ref cset name="I2S4 Mux" "ADMAIF1"

# 播放音频
# aplay -D hw:<cardname>,<i-1> <in.wav>
aplay -D hw:tegrasndt210ref,0 audio_test.wav

Jetson AGX Xavier ASoC驱动程序支持以下格式:

备注:测试发现播放双声道音频源会有输出声音杂乱的情况,而输出单声道音频源输出效果正常。

上一篇 下一篇

猜你喜欢

热点阅读