你(们)好。
我们在我们的平台中使用 TLV320aic3262编解码器。
我们想要通过耳机麦克风录制直播音频、请告诉我们需要为此配置哪个寄存器。
非常感谢
Rizwan Chikodi.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你(们)好。
我们在我们的平台中使用 TLV320aic3262编解码器。
我们想要通过耳机麦克风录制直播音频、请告诉我们需要为此配置哪个寄存器。
非常感谢
Rizwan Chikodi.
您好、Andrew Jackiw
我们使用随附的音频录制脚本设置了编解码器寄存器。
######################################### #codec-18.sh ######################################### #Software reset i2cset -f -y 2 0x19 0x0 0x0 i2cset -f -y 2 0x19 0x7f 0x0 i2cset -f -y 2 0x19 0x1 0x1 #clock configuration(same for asi1 & as2) i2cset -f -y 2 0x19 0x0 0x0 i2cset -f -y 2 0x19 0x4 0x0 # DAC_CLKIN=ADC_CLKIN=MCLK1 i2cset -f -y 2 0x19 0xb 0x81 # NDAC powered and NDAC=1 i2cset -f -y 2 0x19 0xc 0x82 # MDAC powered and MDAC=2 i2cset -f -y 2 0x19 0xd 0x00 # i2cset -f -y 2 0x19 0xe 0x80 # DOSR=128 i2cset -f -y 2 0x19 0x12 0x81 # NADC powered and NADC=1 i2cset -f -y 2 0x19 0x13 0x82 # MADC powered and MADC=2 i2cset -f -y 2 0x19 0x14 0x80 # AOSR=128 #power & analog configuration i2cset -f -y 2 0x19 0x0 0x1 i2cset -f -y 2 0x19 0x1 0x0 i2cset -f -y 2 0x19 0x7a 0x1 # Ref power up delay i2cset -f -y 2 0x19 0x79 0x33 # ref charging time 1.1ms #audio serial interface routing configuration for ASI1 i2cset -f -y 2 0x19 0x0 0x4 i2cset -f -y 2 0x19 0x1 0x00 # ASI1=I2S, 16 bits i2cset -f -y 2 0x19 0x8 0xf0 # ASI1 Left and Right DAC mixed of Left and Right data i2cset -f -y 2 0x19 0xa 0x00 # Master mode #signal processing setting i2cset -f -y 2 0x19 0x0 0x0 i2cset -f -y 2 0x19 0x3c 0x1 # PRB_P1 i2cset -f -y 2 0x19 0x3d 0x1 # PRB_R1 #output channel configuration i2cset -f -y 2 0x19 0x0 0x1 i2cset -f -y 2 0x19 0x3 0x0 # Left DAC in PTM_P3_P4 i2cset -f -y 2 0x19 0x4 0x0 # Right DAC in PTM_P3_P4 i2cset -f -y 2 0x19 0x1b 0x30 # Left DAC to HPL and Right DAC to HPR and powered down i2cset -f -y 2 0x19 0x0 0x0 i2cset -f -y 2 0x19 0x3f 0xc0 # Left and Right DAC powered up i2cset -f -y 2 0x19 0x0 0x1 i2cset -f -y 2 0x19 0x1f 0xb9 # HP Ground_Centered and HPL volume is muted i2cset -f -y 2 0x19 0x20 0xb9 # HPR=HPL and HPR volume is muted i2cset -f -y 2 0x19 0x21 0x28 # CP clock divide=4 default i2cset -f -y 2 0x19 0x22 0x3e # CP default i2cset -f -y 2 0x19 0x23 0x30 # CP auto power up i2cset -f -y 2 0x19 0x1f 0x80 # HP Ground_Centered and volume is 0dB i2cset -f -y 2 0x19 0x20 0x80 # HPR=HPL and HPR volume is 0dB i2cset -f -y 2 0x19 0x0 0x0 i2cset -f -y 2 0x19 0x40 0x40 # Left and Right DAC not muted i2cset -f -y 2 0x19 0x0 0x1 i2cset -f -y 2 0x19 0x09 0x70 # HP 25% i2cset -f -y 2 0x19 0x1b 0x33 # Left DAC to HPL and Right DAC to HPR and powered up i2cset -f -y 2 0x19 0x0 0x1 i2cset -f -y 2 0x19 0x09 0x10 # HP 100% #adc config i2cset -f -y 2 0x19 0x0 0x1 i2cset -f -y 2 0x19 0x8 0x0 # VOCM= Input CM i2cset -f -y 2 0x19 0x34 0x20 # IN2L P-Term 20K on Left_ADC i2cset -f -y 2 0x19 0x36 0x80 # CM 20K on M-Term on Left_ADC i2cset -f -y 2 0x19 0x37 0x20 # IN2R P-Term 20K on Right_ADC i2cset -f -y 2 0x19 0x39 0x80 # CM 20K on M-Term on Right_ADC i2cset -f -y 2 0x19 0x3b 0x0c # Left_ADC enabled with 6dB i2cset -f -y 2 0x19 0x3c 0x0c # Right_ADC enabled with 6dB i2cset -f -y 2 0x19 0x3d 0x0 # Default ADC PowerTune i2cset -f -y 2 0x19 0x0 0x0 i2cset -f -y 2 0x19 0x51 0xc0 # Left and Right ADC powered up i2cset -f -y 2 0x19 0x52 0x0 # Left and Right ADC not muted
通过耳机麦克风录制时、播放录制的音频文件时只会听到噪音。
是否还需要在该寄存器中配置其他寄存器以进行耳机麦克风录制?
谢谢。此致
Rizwan Chikodi.
您好、Andrew
我们可以 在示波器上看到 BCLK、WCLK 和 MCLK 波形(在从模式下)。
1: J3端口支持输入和输出。 我们能够通过 J3端口[使用下载的音频文件]成功执行回放、通过 J3端口捕获音频并进行播放时、只会产生噪声。
2: 我们采用了来自 TLV3262应用参考手册的脚本、我们使用 i2c 命令来设置编解码器寄存器、并编写器启动后运行的脚本{on linux Prompt}。
非常感谢
Rizwan,
感谢您提供的信息。 要更 具体一些、请让我知道 您正在尝试设置的 BCLK、WCLK 和 MCLK 的特定值。 从上一篇 文章来看、 TLV320AIC3262处于从模式、MCLK = 12.288MHz、BCLK = 3.072MHz、WCLK = 48kHz 是时钟设置。 您能否确认我的理解是正确的?
我还假设 使用参考指南中4.6 "Recording and Voice Setup Scripts"中的脚本之一来设置 I2C 命令。 您的应用程序中正在使用哪个脚本?
这些问题的答案将有助于进一步进行故障排除。
此致!
Andrew
您好,Rizwan:
感谢你等待。 大多数情况下似乎都是正确的。 以下是对上述脚本的一些评论。
如果这些步骤不能解决您的问题、则可能还需要一些其他配置来设置耳机。 请参阅 参考指南的2.13.2耳机检测部分以及示例脚本 4.6.3蜂窝式耳机。
此致!
Andrew
您好、Andrew Jackiw
感谢您的支持。
我可以使用4.6.3脚本通过 J3端口进行记录。
######################################################################################### # 4.6.3 Cellular Headset - Stereo Headphone with Mono External Microphone, 8kHz ######################################################################################### # Software Reset ######################################################################################### i2cset -f -y 2 0x18 0x00 0x00 # Initialize to Page 0 i2cset -f -y 2 0x18 0x7f 0x00 # Initialize to Book 0 i2cset -f -y 2 0x18 0x01 0x01 # Initialize the device through software reset ######################################################################################### # Power and Analog Configuration ######################################################################################### i2cset -f -y 2 0x18 0x00 0x01 # Select Page 1 i2cset -f -y 2 0x18 0x01 0x00 # Disable weak AVDD to DVDD connection, make analog supplies available i2cset -f -y 2 0x18 0x7a 0x01 # REF charging time = 40ms i2cset -f -y 2 0x18 0x79 0x33 # Set the quick charge of input coupling cap for analog input ######################################################################################### # Clock configuration # MCLK = 4.096 MHz, BCLK = 512 kHz, WCLK = 8 kHz (slave) ######################################################################################### i2cset -f -y 2 0x18 0x00 0x00 # Select Page 0 i2cset -f -y 2 0x18 0x04 0x33 # Set ADC_CLKIN = PLL_CLK and DAC_CLKIN = PLL_CLK i2cset -f -y 2 0x18 0x05 0x00 # Set PLL_CLKIN = MCLK1 i2cset -f -y 2 0x18 0x06 0x91 # PLL settings: P=1, R=1 i2cset -f -y 2 0x18 0x07 0x18 # PLL settings: P=1, R=1, J=24 i2cset -f -y 2 0x18 0x08 0x00 # D=0000 (MSB) i2cset -f -y 2 0x18 0x09 0x00 # D=0000 (LSB) i2cset -f -y 2 0x18 0x0b 0x82 # NDAC = 2, divider powered off i2cset -f -y 2 0x18 0x0c 0x88 # DAC Power MDAC = 8 i2cset -f -y 2 0x18 0x0d 0x03 # DOSR = 768 (MSB) i2cset -f -y 2 0x18 0x0e 0x00 # DOSR = 768 (LSB) i2cset -f -y 2 0x18 0x12 0x02 # NADC Powerdown NADC=2 i2cset -f -y 2 0x18 0x13 0xb0 # NADC Powerup, MADC=48 i2cset -f -y 2 0x18 0x14 0x80 # AOSR = 128 ######################################################################################### # Audio Serial Interface Routing Configuration - Audio Serial Interface #1 # ASI #1 recording ######################################################################################### i2cset -f -y 2 0x18 0x00 0x04 # Select Page 4 i2cset -f -y 2 0x18 0x01 0x00 # Audio Serial Interface #1 is set to I2S mode, 16-bit i2cset -f -y 2 0x18 0x0a 0x00 # Route ASI#1 WCLK and BCLK to WCLK1 pin and BCLK1 pin ######################################################################################### # Signal Processing Settings ######################################################################################### i2cset -f -y 2 0x18 0x00 0x00 # Select Page 0 i2cset -f -y 2 0x18 0x3c 0x01 # Set the DAC PRB Mode to PRB_P1 i2cset -f -y 2 0x18 0x3d 0x01 # Set the ADC PRB Mode to PRB_R1 ######################################################################################### # ADC Input Channel Configuration --- IN1L ######################################################################################### i2cset -f -y 2 0x18 0x00 0x01 # Select Page 1 i2cset -f -y 2 0x18 0x08 0x00 # Set the input common mode to 0.9V i2cset -f -y 2 0x18 0x33 0x40 # Mic Bias enabled, Source = Avdd, 1.62V i2cset -f -y 2 0x18 0x34 0x80 # Route IN1L and CM1 to LEFT ADCPGA with 20K input impedance i2cset -f -y 2 0x18 0x36 0x80 i2cset -f -y 2 0x18 0x3B 0x3C # Left Channel Analog ADC PGA = 30 dB i2cset -f -y 2 0x18 0x3D 0x00 # ADC Analog programmed for PTM_R4 i2cset -f -y 2 0x18 0x00 0x00 # Select Page 0 i2cset -f -y 2 0x18 0x51 0xC0 # Power-up ADC Channel i2cset -f -y 2 0x18 0x52 0x00 # Unmute ADC channel and Fine Gain = 0dB ######################################################################################### # Output Channel Configuration ######################################################################################### i2cset -f -y 2 0x18 0x00 0x00 # Select Page 0 i2cset -f -y 2 0x18 0x3F 0xC0 # Power-up the Left & Right DAC Channels i2cset -f -y 2 0x18 0x40 0x00 # Unmute the DAC digital volume control i2cset -f -y 2 0x18 0x00 0x01 # Select Page 1 i2cset -f -y 2 0x18 0x03 0x00 # Set PTM mode for Left DAC to PTM_P3 (default, writing here optional) i2cset -f -y 2 0x18 0x04 0x00 # Set PTM mode for Right DAC to PTM_P3 (default, writing here optional) i2cset -f -y 2 0x18 0x1F 0x80 # Headphone in Ground-centered Mode, HPL Gain=0dB i2cset -f -y 2 0x18 0x20 0x80 # HPR To have same gain as HPL, set to 0dB i2cset -f -y 2 0x18 0x09 0x00 # HP Sizing = 100% (Setup A) i2cset -f -y 2 0x18 0x1B 0x33 # Enable DAC to HPL/R and power-up HPL/R
谢谢 BR
Rizwan Chikodi.
您好,Rizwan:
我很高兴示例脚本修复了您最初的问题。
至于您目前的问题、很难判断问题是什么。 这很可能是由于 连接的麦克风存在差异、但这很难仅从耳机上辨别。 我怀疑问题在于编解码器方面。
在另一侧创建具有裸线连接以进行测试的 TRRS 插孔可能会有所帮助。 耳机麦克风可能只是灵敏度较低的麦克风、而耳机的阻抗可能不同。 这将让您使用不同的负载进行实验。
我将再次关闭这个帖子。 如果您想进一步讨论该问题、请打开新的 E2E 主题、因为这是新问题。
此致!
Andrew