Thor, 音频解码器适配

我们在thor的调试中参考DeveloperGuide,调试aduio codec,

Audio Setup and Development — NVIDIA Jetson Linux Developer Guide

解码器芯片是nau88c22,, 我们的nau88c22 的i2s 和 i2c信号,是和thor开发者套件保持一致的。 也在tegra_codec.c 上增加了相关的初始化配置。 但是无论参考thor 开发者套件的rt5640 还是 sgtl5000。均无法正常播放音频,驱动上有正确识别到声卡设备。播放音频时,有类似于底噪的声音输出,但无法分辨播放的内容。现在aud mclk测得的信号时钟始终为27.02MHz。

Hi

Could you provide more details like the changes made in the driver, DT and which I2S was used in this case.

用的i2s 和i2c接口 和thor 开发者套件是一致的。 现在已经可用正常播放音频了。但是似乎录音功能还是有些问题。
下面是device-tree 的相关设置



在系统中的dapm可以看到,音频输入总是off的状态

@mkumard

Hi,

A quick question, is this board is custom designed board?. As it seems you replacing onboard RT5640 codec in the DT.

是的,这是自己设计的carry board,用nau8822 替换了原来开发者套件上的rt5640. 现在播放声音是正常的,但是无法录音。需要你那边帮忙排查一下

Ok that’s good to hear, Playback is working now.

On Recording, Does the arecord command continuous for whole capture duration in seconds or it completes as soon as arecord command issued.

These could be the possibilities.

  1. DAPM path is not set properly for recording path - In this case arecord command would finish immediately after execution
  2. If arecord command runs for whole duration of capture file, then we need to check the codec mixer controls for recording or mic path.

你可以查看一下我刚才发的哪个截图,dpam中的输入widget 的状态一直是Off的。 arecord 会一直卡住,因为一直没有获取到录音数据。

The Widget and Routing entry on DT looks fine. Could you list all the codec mixer controls set before the start of recording.

I see below switch in capture path, could you clarify on the codec pin used for the capture path.

	{"Right Input Mixer", "R2 Switch", "R2"},
	{"Right Input Mixer", "MicN Switch", "RMICN"},
	{"Right Input Mixer", "MicP Switch", "RMICP"},

	{"Left Input Mixer", "L2 Switch", "L2"},
	{"Left Input Mixer", "MicN Switch", "LMICN"},
	{"Left Input Mixer", "MicP Switch", "LMICP"},

需要怎样检查这些项目呢?
{“Right Input Mixer”, “R2 Switch”, “R2”},
{“Right Input Mixer”, “MicN Switch”, “RMICN”},
{“Right Input Mixer”, “MicP Switch”, “RMICP”},

{"Left Input Mixer", "L2 Switch", "L2"},
{"Left Input Mixer", "MicN Switch", "LMICN"},
{"Left Input Mixer", "MicP Switch", "LMICP"},

这几个是驱动中的输入Switch , 但是目前的状态应该和这个没关系,因为现在任意一个都没有成功打开。

I just referred the nau8822 codec driver in upstream. Could you list all the amixer controls which are set before the usecase.

是需要这个吗?

root@tegra-ubuntu:~# amixer controls | grep CVB
numid=1854,iface=MIXER,name='CVB-RT ADC 128x Oversampling Switch'
numid=1816,iface=MIXER,name='CVB-RT ADC Companding'
numid=1824,iface=MIXER,name='CVB-RT ADC Inversion Switch'
numid=1825,iface=MIXER,name='CVB-RT ADC Volume'
numid=1838,iface=MIXER,name='CVB-RT ALC Attack'
numid=1837,iface=MIXER,name='CVB-RT ALC Decay'
numid=1832,iface=MIXER,name='CVB-RT ALC Enable Switch'
numid=1835,iface=MIXER,name='CVB-RT ALC Hold'
numid=1834,iface=MIXER,name='CVB-RT ALC Max Gain'
numid=1833,iface=MIXER,name='CVB-RT ALC Min Gain'
numid=1831,iface=MIXER,name='CVB-RT ALC Mode'
numid=1839,iface=MIXER,name='CVB-RT ALC Noise Gate Switch'
numid=1840,iface=MIXER,name='CVB-RT ALC Noise Gate Threshold'
numid=1836,iface=MIXER,name='CVB-RT ALC Target'
numid=2011,iface=MIXER,name='CVB-RT AUX1 Output Mixer LDAC Switch'
numid=2012,iface=MIXER,name='CVB-RT AUX1 Output Mixer LMIX Switch'
numid=2008,iface=MIXER,name='CVB-RT AUX1 Output Mixer RDAC Switch'
numid=2010,iface=MIXER,name='CVB-RT AUX1 Output Mixer RINMIX Switch'
numid=2009,iface=MIXER,name='CVB-RT AUX1 Output Mixer RMIX Switch'
numid=2016,iface=MIXER,name='CVB-RT AUX2 Output Mixer AUX1MIX Output Swi'
numid=2013,iface=MIXER,name='CVB-RT AUX2 Output Mixer LDAC Switch'
numid=2015,iface=MIXER,name='CVB-RT AUX2 Output Mixer LINMIX Switch'
numid=2014,iface=MIXER,name='CVB-RT AUX2 Output Mixer LMIX Switch'
numid=1849,iface=MIXER,name='CVB-RT AUXOUT Playback Switch'
numid=1852,iface=MIXER,name='CVB-RT Aux Boost Volume'
numid=1853,iface=MIXER,name='CVB-RT DAC 128x Oversampling Switch'
numid=1817,iface=MIXER,name='CVB-RT DAC Companding'
numid=1820,iface=MIXER,name='CVB-RT DAC Inversion Switch'
numid=1828,iface=MIXER,name='CVB-RT DAC Limiter Attack'
numid=1827,iface=MIXER,name='CVB-RT DAC Limiter Decay'
numid=1826,iface=MIXER,name='CVB-RT DAC Limiter Switch'
numid=1829,iface=MIXER,name='CVB-RT DAC Limiter Threshold'
numid=1830,iface=MIXER,name='CVB-RT DAC Limiter Volume'
numid=2023,iface=MIXER,name='CVB-RT Digital Loopback Switch'
numid=1818,iface=MIXER,name='CVB-RT EQ Function'
numid=1819,iface=MIXER,name='CVB-RT EQ Parameters'
numid=1844,iface=MIXER,name='CVB-RT Headphone Playback Switch'
numid=1845,iface=MIXER,name='CVB-RT Headphone Volume'
numid=1843,iface=MIXER,name='CVB-RT Headphone ZC Switch'
numid=1823,iface=MIXER,name='CVB-RT High Pass Cut Off'
numid=1822,iface=MIXER,name='CVB-RT High Pass Filter Switch'
numid=1851,iface=MIXER,name='CVB-RT L2/R2 Boost Volume'
numid=2017,iface=MIXER,name='CVB-RT Left Input Mixer L2 Switch'
numid=2018,iface=MIXER,name='CVB-RT Left Input Mixer MicN Switch'
numid=2019,iface=MIXER,name='CVB-RT Left Input Mixer MicP Switch'
numid=2001,iface=MIXER,name='CVB-RT Left Output Mixer LAUX Switch'
numid=2002,iface=MIXER,name='CVB-RT Left Output Mixer LDAC Switch'
numid=2000,iface=MIXER,name='CVB-RT Left Output Mixer LINMIX Switch'
numid=2003,iface=MIXER,name='CVB-RT Left Output Mixer RDAC Switch'
numid=1821,iface=MIXER,name='CVB-RT PCM Volume'
numid=1850,iface=MIXER,name='CVB-RT PGA Boost Volume'
numid=1842,iface=MIXER,name='CVB-RT PGA Volume'
numid=1841,iface=MIXER,name='CVB-RT PGA ZC Switch'
numid=2021,iface=MIXER,name='CVB-RT Right Input Mixer MicN Switch'
numid=2022,iface=MIXER,name='CVB-RT Right Input Mixer MicP Switch'
numid=2020,iface=MIXER,name='CVB-RT Right Input Mixer R2 Switch'
numid=2007,iface=MIXER,name='CVB-RT Right Output Mixer LDAC Switch'
numid=2005,iface=MIXER,name='CVB-RT Right Output Mixer RAUX Switch'
numid=2006,iface=MIXER,name='CVB-RT Right Output Mixer RDAC Switch'
numid=2004,iface=MIXER,name='CVB-RT Right Output Mixer RINMIX Switch'
numid=1847,iface=MIXER,name='CVB-RT Speaker Playback Switch'
numid=1848,iface=MIXER,name='CVB-RT Speaker Volume'
numid=1846,iface=MIXER,name='CVB-RT Speaker ZC Switch'

let me put this way, did you not set any codec controls before the playback or recording?. The above dump is just the controls list not the information on the value it has been set.

Provide dump with

#amixer contents > log.txt

我是这样录音的:arecord -V mono -d 10 -r 48000 -c 1 -f S16_LE audio.wav
除此之外没有其它设置了
录音时候的 amxier contents log如下
log.txt (453.2 KB)

Could you give a try with -c 2 stereo channels.

还是一样,不能录音。而且arecord会立刻返回错误。
‘’’
nvidia@tegra-ubuntu:~$ arecord -V stereo -d 10 -r 48000 -c 2 -f S16_LE audio.wav
Recording WAVE ‘audio.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
arecord: pcm_read:2240: read error: Input/output error
nvidia@tegra-ubuntu:~$
‘’’

As Playback was working, Am not suspecting anything on Tegra I2S side. Could you follow the debug steps mentioned @ Audio Setup and Development — NVIDIA Jetson Linux Developer Guide to dump the DAPM path info during capture. Would like to understand if DAPM path is getting completed for capture path

感谢你的回复,已经可以正常使用了

Good to hear.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.