ShellAlbert / Jetson-TX2

new platform for processing video & audio
GNU Lesser General Public License v3.0
2 stars 0 forks source link

修改dts文件使i2s2默认为输入状态 #22

Open ShellAlbert opened 4 years ago

ShellAlbert commented 4 years ago

QQ图片20191217163955

ShellAlbert commented 4 years ago

i2s_conf.sh

!/bin/bash

amixer -c tegrasndt186ref sset "ADMAIF2 Mux" I2S2

amixer -c tegrasndt186ref sset "I2S1 Mux" ADMAIF1

volume control enabled.

amixer -c tegrasndt186ref sset "ADMAIF2 Mux" "I2S2" amixer -c tegrasndt186ref sset "I2S1 Mux" "MVC1" amixer -c tegrasndt186ref sset "MVC1 Mux" "ADMAIF1" amixer -c tegrasndt186ref cset name="MVC1 Vol" 9000

amixer -c tegrasndt186ref cset name="MVC1 Vol" 16000

i2s format.

amixer -c tegrasndt186ref cset name='I2S1 codec frame mode' 'i2s' amixer -c tegrasndt186ref cset name='I2S2 codec frame mode' 'i2s'

master mode.

amixer -c tegrasndt186ref cset name='I2S1 codec master mode' 'cbs-cfs' amixer -c tegrasndt186ref cset name='I2S2 codec master mode' 'cbm-cfm'

16bit/32bit

amixer -c tegrasndt186ref cset name='I2S1 codec bit format' '32' amixer -c tegrasndt186ref cset name='I2S2 codec bit format' '32'

input bit format.

amixer -c tegrasndt186ref cset name='I2S1 input bit format' '32' amixer -c tegrasndt186ref cset name='I2S2 input bit format' '32'

ShellAlbert commented 4 years ago

pipeline.sh

!/bin/bash

record from i2s1 pipeline aplay to i2s0.

arecord -D hw:tegrasndt186ref,1 -r 32000 -f S32_LE -c 2 -t raw | aplay -D plughw:tegrasndt186ref,0 -r 32000 -f S32_LE -c 2 -t raw

ShellAlbert commented 4 years ago

sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep dap 当使用sudo busybox devmem addr 32 val 修改din/fs/sclk为0x458时,使能输入 然后使用arecord录制时,发现din/fs/sclk的值又被修改到0x400了,使能禁止了。奇怪?

后来找到一个方法,就是上面截图中的修改tegra186-quill-p3310-1000-c03-00-base.dtb文件。 修改i2s2_dap_active中的 i2s2_dap2_din_pc3, i2s2_dap2_dout_pc2, i2s2_dap2_sclk_pc1, i2s2_dap2_fs_pc4 其中的nvidia,tristate对应数据手册中的passthrought和tristate设置; 其中的nvidia,enable-input是否开启输入,对于fs/sclk要开启; 其中的nvidia,pull对应是否使能上拉。 这些与数据手册中的pinmux中的dap2-xxx管脚寄存器相对应起来。

ShellAlbert commented 4 years ago

pipeline_usb.sh arecord -D plughw:CARD=USBSA,DEV=0 -r 32000 -f S32_LE -c 2 -t raw | aplay -D hw:tegrasndt186ref,0 -r 32000 -f S32_LE -c 2 -t raw 这样播放没有杂音 usb capture -> i2s0 playback

pipe_line.sh arecord -D hw:tegrasndt186ref,1 -r 32000 -f S32_LE -c 2 -t raw | aplay -D hw:tegrasndt186ref,0 -r 32000 -f S32_LE -c 2 -t raw 这样播放就有杂音 i2s1 capture -> i2s0 playback

ShellAlbert commented 4 years ago

QQ图片20191217171621

ShellAlbert commented 4 years ago

音频输出串联电容电阻并联电阻到地

ShellAlbert commented 4 years ago

QQ图片20200312164654