你好,在安霸平台上的TLV320AIC3101驱动,现在是播放的时候在电脑上声音正常,但是在机器上声音偏小,DAC的值也调到了最大,0x80, HPLOUT 输出值的控制也调到了0x9d, 详细的寄存器配置如下: 请教一下 还有没有什么寄存器可以修改,调节输出音量的,谢谢!
/* Set Page 0 */
value = 0;
tlv320aic3101_write(reg_codec, 0, value);
/* Software reset */
value = 0x80;
tlv320aic3101_write(reg_codec, 1, value);
dly_tsk(5);
/* Set freq */
//tlv320aic3101_sfreq_conf();
/* Set DAC input */
value = tlv320aic3101_read(reg_codec, 7);
value &= ~0x1e;
value |= 0x0a; // left(right) channel
tlv320aic3101_write(reg_codec, 7, value);
/* Set IIS bit clock rate */
value = tlv320aic3101_read(reg_codec, 9);
printk("IIS flag (0x%02x)", value);
value &= ~0x30;
value |= 0x08;
tlv320aic3101_write(reg_codec, 9, value);
#ifdef __HIGH_PASS_FILTER__
/* Enable Audio Codec Digital Filter */
value = 0x50;//0x3a;
tlv320aic3101_write(reg_codec, 12, value);
#else
/* Disable Audio Codec Digital Filter */
value = 0x00;
tlv320aic3101_write(reg_codec, 12, value);
#endif
/* High power outputs for AC-coupled driver config */
value = 0x80;
tlv320aic3101_write(reg_codec, 14, value);
/* Set ADC not mute */
value = 0x5b; // 0x7f PGA Gain =59.5dB tlv320aic3101_write(reg_codec, 15, value);
tlv320aic3101_write(reg_codec, 16, value);
value = 0x7C; //Disable IN1L to Left ADC & Left ADC powerd up
tlv320aic3101_write(reg_codec, 19, value);
value = 0x80; //Mic R differential mode & 0db to Left ADC
tlv320aic3101_write(reg_codec, 21, value); value = 0x84; //Mic R differnetial mode & 0db to Right ADC
tlv320aic3101_write(reg_codec, 22, value);
value = 0x78; //Disable IN1L to Right ADC
tlv320aic3101_write(reg_codec, 24, value);
/* MICBIAS Control */
value = 0xc6;//0x80; // MICBIAS output is powered to 2.5V
tlv320aic3101_write(reg_codec, 25, value);
/* Left & Right AGC */
value = 0xb3; // AGC enable & AGC target gain=-5.5dB attack 8ms decay 100ms // 0x80 -> 0xb3(-12db) -> 0x93 or 0xa3
tlv320aic3101_write(reg_codec, 26, value);
tlv320aic3101_write(reg_codec, 29, value);
value = 0xa0; // AGC Max. gian 40db tlv320aic3101_write(reg_codec, 27, value);
tlv320aic3101_write(reg_codec, 30, value);
//value = 0x2b; // Noise gate -70db
value=0x00; //disable Noise Gate //steven guan_V08_0603
//value = 0x3f; //-90db NG //value = 0x2f; //-80db OK
//value = 0x35; //-83db //value = 0x37; //-84db //value = 0x39; //-85db NG
tlv320aic3101_write(reg_codec, 28, value);
tlv320aic3101_write(reg_codec, 31, value);
//value=0xb2; // //tlv320aic3101_write(32, value);
//tlv320aic3101_write(33, value);
value = 0xdd; // Noise gate debounce 1280ms/8ms
tlv320aic3101_write(reg_codec, 34, value);
tlv320aic3101_write(reg_codec, 35, value);
/* Read ADC flag */
value = tlv320aic3101_read(reg_codec, 36);
printk("TLV320AIC3101 ADC flag (0x%02x)", value);
status = 0;
status = (value & _ADC_FLG_);
/* DAC power up */
value = 0xc0;
tlv320aic3101_write(reg_codec, 37, value);
/* Output Soft-stepping disable */
value = 0x02;
tlv320aic3101_write(reg_codec, 40, value);
/* Driver power on time =400ms, driver ramp up =1ms */
value = 0x84;
tlv320aic3101_write(reg_codec, 42, value);
/* Left & Right DAC Volume control */
value = 0x0; //value = 0xC;
tlv320aic3101_write(reg_codec, 43, value);
tlv320aic3101_write(reg_codec, 44, value);
/* DAC L1 to HPLOUT 0dB */
value = 0x80;
tlv320aic3101_write(reg_codec, 47, value);
/* DAC R1 to HPROUT 0dB */
value = 0x80;
tlv320aic3101_write(reg_codec, 64, value);
/* HPLOUT power up unmute 9dB */
value = 0x9d;
tlv320aic3101_write(reg_codec, 51, value);
/* HPROUT power up unmute 9dB */
value = 0x0f;//0x9d;
tlv320aic3101_write(reg_codec, 65, value);
/* DAC L1 to LEFT_LOP/M 0dB */
value = 0x80;
tlv320aic3101_write(reg_codec, 82, value);
/* DAC R1 to RIGHT_LOP/M 0dB */
value = 0x80;
tlv320aic3101_write(reg_codec, 92, value);
/* LEFT_LOP/M power up unmute 9dB */
// value = 0x9d; //………………………….bit2 ,Write only zero
value = 0x5d; // sky_0830,0x0d; //………………………….bit2 ,Write only zero , Qoo 070927 Output level 0dB
tlv320aic3101_write(reg_codec, 86, value);
/* RIGHT_LOP power up unmute 9dB */
// value = 0x9d; //………………………….bit2 ,Write only zero
value = 0x5d; // sky_0830,0x0d; //………………………….bit2 ,Write only zero , Qoo 070927 Output level 0dB
tlv320aic3101_write(reg_codec, 93, value);
/* DAC volume control */
//tlv320aic3101_mute_off();
//tlv320aic3101_volume_control(32);
/* Read DAC flag */
value = tlv320aic3101_read(reg_codec, 94);
printk("TLV320AIC3101 DAC flag (0x%02x)", value);
//}
tlv320aic3101_mode_conf(reg_codec);
tlv320aic3101_unlock(reg_codec);
}
user151383853:
如果设置都已经调到最大了, 音量还是偏小, 那需要考虑后级功放, 输出阻抗匹配, 以及功放电源的问题了
sy zhang:
回复 user151383853:
你好,请教一下,还能不能在软件上修改?软件设置除了我上面提到的两个寄存器之外还有别的吗?谢谢!