Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ShellAlbert opened this issue Dec 17, 2019 · 7 comments
Open

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

ShellAlbert opened this issue Dec 17, 2019 · 7 comments

Comments

@ShellAlbert
Copy link
Owner

QQ图片20191217163955

@ShellAlbert
Copy link
Owner Author

ShellAlbert commented Dec 17, 2019

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

QQ图片20191217171621

@ShellAlbert
Copy link
Owner Author

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

@ShellAlbert
Copy link
Owner Author

QQ图片20200312164654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant