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.

[参考译文] PCMD3140:更新了页面 0x09 阈值寄存器后 VAD 灵敏度问题

Guru**** 2771175 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1611952/pcmd3140-vad-sensitivity-issues-despite-updating-page-0x09-threshold-registers

器件型号: PCMD3140

我目前正在集成 PCMD3140IRTER 编解码器、并且在配置 VAD(语音活动检测器)的灵敏度时遇到问题。

尽管我已经验证了页面 0x09 已正确选择、并且所需的值已写入阈值寄存器 (0x50、0x51、0x52、0x53)、但 VAD 的灵敏度比预期高得多:

  1. 设置 0dB 的阈值时、VAD 非常敏感并生成连续中断。
  2. 将阈值移到–8dB 时、灵敏度会进一步增加。
  3. 将阈值下限设置为–20dB、VAD 突然变为“耳聋“、完全停止生成中断。

似乎阈值更改未正确应用、或者灵敏度标度与 www.ti.com/.../sbaa490a.pdf 不一致

我附加了在 tlv320adcx140.c 驱动程序中实现的代码、规定即使手动写入寄存器(绕过驱动程序)、我也会复制相同的行为。

可能的原因是什么、在 0dB 时具有非常敏感的 VAD 行为是正确的吗? 提前感谢您的支持。

static u32 db_to_linear(int db_value)
{	
	static const u32 db_table[] = {
		16777216,  //   0 dB 
		14952709,  // - 1 dB 
		13326616,  // - 2 dB 
		11877359,  // - 3 dB 
		10585708,  // - 4 dB 
		9434522,  //  - 5 dB  
		8408526,  //  - 6 dB  
		7494107,  //  - 7 dB  
		6679130,  //  - 8 dB  
		5952781,  //  - 9 dB  
		5305422,  //  - 10 dB  
		4728462,  //  - 11 dB  
		4214246,  //  - 12 dB  
		3755951,  //  - 13 dB  
		3347495,  //  - 14 dB  
		2983458,  //  - 15 dB  
		2659010,  //  - 16 dB  
		2369845,  //  - 17 dB  
		2112126,  //  - 18 dB  
		1882435,  //  - 19 dB  
		1677722,  //  - 20 dB  
	};

	if (db_value > 0 || db_value < -20)
        return 16777216;

	return db_table[-db_value];
}

static ssize_t vad_threshold_store(struct device *dev,
                                    struct device_attribute *attr,
                                    const char *buf,
                                    size_t count)
{
	
    struct adcx140_priv *adcx140 = dev_get_drvdata(dev);
    int db_value;
    u32 threshold;
    int ret;
	unsigned int val;
    unsigned long flags;
    ret = kstrtoint(buf, 0, &db_value);
    if (ret)
        return ret;
    
    if (db_value > 0 || db_value < -20) {
        dev_err(dev, "Threshold out of range (0 to -20 dB): %d\n", db_value);
        return -EINVAL;
    }
    
    threshold = db_to_linear(db_value);
	
    regmap_write(adcx140->regmap, 0x4D0, (threshold >> 24) & 0xFF);

    regmap_write(adcx140->regmap, 0x4D1, (threshold >> 16) & 0xFF);

    regmap_write(adcx140->regmap, 0x4D2, (threshold >> 8) & 0xFF);

    regmap_write(adcx140->regmap, 0x4D3, threshold & 0xFF);

	regmap_read(adcx140->regmap, ADCX140_INT_LTCH0, &val);
    return count;
}
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    我相信已经有一些关于这个的电子邮件讨论,我希望你被包括在其中,所以对延误感到抱歉。 我今天在实验室中使用 EVM 测试了 VAD 阈值的运行情况。 首先、我记录了一个语音信号样本、然后通过 PDM 输出使用 APx 将其播放回 EVM GPI1。 然后、回放电平降低、直到 VAD 停止触发、这是通过 EVM 上的中断指示灯目视检查的。

    我们确认 VAD 最小触发电平确实随预期的阈值电平发生了变化、如此处所示。

    下面是一个显示在 AP GUI 上播放的示例:

    这是我们使用的脚本、请注意、最后可以包括 VAD 和 ADC 同时是否开启、因此我们可以在 ADC 处于活动状态时让 VAD 仍然工作。

    w 9c 00 00 # page 0
    w 9c 01 01 # software resetting the device
    w 9c 01 01 # software resetting the device
    
    w 9c 02 81 # exit sleep mode
    w 9c 3c a0 # AC coupled, single ended, 2.5 k, line input
    w 9c 73 80 # enabling the input channel 1 i.e the in1p channel for recording
    w 9c 74 80 #enable input ch1 slot 0
    
    w 9c 21 21 #gpio1 is irq, drive active low and active high 
    w 9c 22 41 #in2m_gpo1 is pdmclk output
    w 9c 2b 40 #in2p_gpi1 is pdmdin1 for channels 1 and 2
    
    w 9c 32 a0 # Interrupt asserts on any unmasked events and read through latch registers
    w 9c 33 ef # masking the VAD power down interrupts
    
    w 9c 00 01 # Page 1
    w 9c 1e 00 # channel 1 for VAD, user initiated
    w 9c 1f 08 #enable vad during adc recording
    
    w 9c 00 09 #page 9 thresholding, comment out both for 0db threshold
    w 9c 50 00 19 99 9a #-20db threshold
    #w 9c 50 00 50 f4 4e #-10db threshold
    
    w 9c 00 00 # Page 0
    d 200 # delay
    w 9c 75 21 # Enabling VAD and powering up PLL
    #w 9c 75 61 #enable VAD and PLL AND dig mic inputs
    
    b
    w 9c 75 61 #enable adc operation
    b
    w 9c 75 21 #disable adc
    
    

    您能否验证阈值转换脚本是否按正确的顺序写入十六进制值? 乍一看、我 想位移的顺序可能是错误的? 我们预计首先写入阈值编号的 MSB、例如、将最大阈值 0dB(以十进制表示,16777216、转换为十六进制表示为 0x01 00 00)写入第 9 页寄存器 0x50 至 0x53:

    W C9 50 01
    宽 C9 51 00
    宽 C9 52 00
    宽 C9 53 00

    请告诉我您的想法、如果这有助于解决您的问题、请告诉我。

    此致、
    Mir