DA7212 ALC Programming

4 posts / 0 new
Last post
Shade234
Offline
Last seen:1 year 5 months ago
加入:2016-11-29 07:55
DA7212 ALC Programming

I'm trying to get the ALC (Auto Level Control) working in the DA7212 for analog microphones, but haven't been able to get the ALC to have any effect on the audio output.

我的设置音频路径是:
2 Analog Mics (pseudo differential) --------> DA7212 Mic Inputs ---> DA7212 DAI --------> Processor (wave capture).
I know I have the DA7212 setup correctly as I can get audio through this path, as well as send it back to the DA7212 HP outputs.

After trying a bunch of different settings in the ALC register set, I suspect the problem may be related to not setting up the ALC under the correct configuration conditions...

At what point in the codec setup should the ALC be configured?
What are the configuration pre-requisites to setting up the ALC?
Are there any settings that will disable the ALC configuration?

I've attached 2 functions from my code that best summarize what I'm doing.
Note that prior to these functions, the codec is initialized, sample rate is set, DAI format configured, and PLL locked..
da7212_alc_config_analog: //configuration of the ALC registers.
da7212_amic_i2s_loopback // configures the codec path, volume, and attempts to set ALC (does not work).

Any help or ideas would be greatly appreciated. Thanks!

Attachment:
Device:
ED_Dialog
Offline
Last seen:6 days 14 hours ago
工作人员
加入:2017-09-18 11:54
Hello Robert,

Hello Robert,

I will look into this.

Kind regards,

Elliott Dexter

ED_Dialog
Offline
Last seen:6 days 14 hours ago
工作人员
加入:2017-09-18 11:54
Hello Robert,

Hello Robert,

I have spoken with the Audio application team. They suggest that there is not enough time for the ALC to calibrate. They have created a script that replicates your set-up for MIC to ADC and the DAC to HP, they have then muted the MIC inputs before configuring the ALC. This method allows for a small delay and for the ALC to calibrate. Please see the attached script for further referance and an example.

Please ask if you have any further questions.

Kind regards,
Elliott Dexter

Attachment:
Shade234
Offline
Last seen:1 year 5 months ago
加入:2016-11-29 07:55
I reviewed and updated my

I reviewed and updated my code against your reference script the ALC is clearly working now. The changes amounted to some slightly different register settings, some re-ordering of register writes, and the added delays. Thanks!