12 posts / 0 new
Last post
ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
DA7212 ALC issue

Hi,

I am experiencing periodic issues with the ALC in the DA7212 codec. The system is running Linux and uses the DA7213 SoC driver provided by Dialog Semi.

The issue is that sometimes the ALC does not recover after it has lowered the gain. It seems like the issue is triggered by a sudden high input on the microphones which causes the ALC to turn down the gain but it never turns the gain back up.

ALC_ATTACK = 44/fs
ALC_RELEASE = 176/fs

ALC_INTEG_RELEASE = 1/4
ALC_INTEG_ATTACK = 1/4
ALC_HOLD = 62/fs

ALC_THRESHOLD_MIN = -24 dB
ALC_THRESHOLD_MAX = -9 dB

ALC_ATTEN_MAX = 60 dB
ALC_GAIN_MAX = 60 dB

ALC_ANA_GAIN_MAX = 36 dB
ALC_ANA_GAIN_MIN = 0 dB

ALC_ANTICLIP_EN is disabled
ALC_ANTICLIP_LEVEL = 0

ALC noise level is set at -94.5 dB

Any ideas to get closer to why this is happening? Any registers in the DA7212 which I can monitor to see the internal status/operation of the ALC.

Best Regards,
Ulrich

Device: 
ED_Dialog
Offline
Last seen: 10 hours 34 min ago
Staff
Joined: 2017-09-18 11:54
Hello Ulrich,

Hello Ulrich,

 

Let me look into this.

 

Kind regards,
Elliott Dexterb 

ED_Dialog
Offline
Last seen: 10 hours 34 min ago
Staff
Joined: 2017-09-18 11:54
Hello Ulrich,

Hello Ulrich,

Would you be able to provide me with a register dump?

Kind regards,

Elliott Dexter 

ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
Hi,

Hi,

Please see the register dump below during streaming. Please note the ALC is behaving normally in this case.


root@x:~ i2cdump -f -y 2 0x1a
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 00 05 00 00 07 07 00 00 00 00 00 00 00 00 ...?..??........
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
20: 00 10 0a 08 07 ea 1e 88 80 08 32 8b 00 00 00 00 .?????????2?....
30: 35 35 02 02 0f 0f 6f 6f 88 07 07 00 00 00 00 00 55????oo???.....
40: 00 88 88 08 80 6f 6f 61 39 39 30 00 00 00 00 00 .????ooa990.....
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 64 64 11 08 08 28 28 20 20 60 60 68 68 68 18 18 dd???(( ``hhh??
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 21 89 03 00 00 00 00 00 00 00 00 00 00 00 00 .!??............
90: 00 00 00 00 03 32 95 00 00 00 00 00 3f 10 06 aa ....?2?.....????
a0: 71 00 00 d0 0f 00 00 00 85 0f 00 00 00 00 00 00 q..??...??......
b0: 00 00 00 00 00 00 00 55 15 00 40 02 01 00 00 00 .......U?.@??...
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 .............?..

Best Regards,
Ulrich

ED_Dialog
Offline
Last seen: 10 hours 34 min ago
Staff
Joined: 2017-09-18 11:54
Hello Ulrich,

Hello Ulrich,

Thank you for the register dump. We managed to recreate your issue in the lab, we found a potential work around, changing ALC_Gain_Max to 72dB. We have not observed the issue since changing the value. We will look further into why this issue occured.

 

Kind regards,
Elliott Dexter  

ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
Hi,

Hi,

Thanks for your feedback. I will test your suggestion and report back.

Best Regards,
Ulrich

ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
Hi,

Hi,

I have tested the proposed change and it does not solve the problem. Still the ALC still does not always recover after it has lowered the gain. Also changing ALC_Gain_Max to 72dB results in distortion due to clipping of the signal.

Can you explain what causes this unintended behavior in the ALC? Any other suggestions to solve the problem.

Best Regards,
Ulrich

ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
Hi Elliot,

Hi Elliot,

Another observation relating to the ALC is that I see a big difference between the amplitude of the left end right channels. This is only seen when using the ALC. From what I read in the datasheet, the ALC applies the same gain to both channels right?

Using fixed gain, the amplitude of the left end right channels are equal.

Best Regards,
Ulrich

ED_Dialog
Offline
Last seen: 10 hours 34 min ago
Staff
Joined: 2017-09-18 11:54
Hi Ulrich,

Hi Ulrich,

Thats interesting, the work around seemed to work on the bench here. I have raised this with the team again, hopfully i can get some answers to you soon.

Kind regards,

Elliott Dexter 

ED_Dialog
Offline
Last seen: 10 hours 34 min ago
Staff
Joined: 2017-09-18 11:54
Hello Ulrich,

Hello Ulrich,

Sorry for the late response, i am out of office at the moment. I have a few questions and a suggestion:

  1. What is the amplitude of the signal that is being applied when the ALC has lowered the gain?
  2. Is it possible to view the schematics of the board ?
  3. Suggestion: 

Set ALC_SYNC_MODE to enabled, which assume we have then we also need the ALC_ANTICLP_CTRL Enabled = 0xA1 to 0x80 and the ALC_ANTICLIP_LEVEL = 0xA2 to 0x64.This should resolve the issues that are being observed.

Kind regards,

Elliott Dexter

ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
Hi Elliott,

Hi Elliott,

Replies to your questions:

1. The amplitude of the signal during my test is normal speech. I then tap the microphone to provoke a high input to the ALC. The gain is of course lowered as expected but when I stop tapping the microphone the gain sometimes remain low.
2. See attachment
3. I have not tried that yet.

What I have tried is to use the ALC without auto calibration and that seems to solve the problem. I set ALC_SYNC_MODE = 1 and ALC_OFFSET_EN = 0. What impact may that have?

To me it looks like the ALC offset calibration is not done correctly which causes the ALC to fail sometimes. I have attached my linux da7213 driver. Does anything look suspicious to you?

Best Regards,
Ulrich

Attachment: 
ulrich.sorensen
Offline
Last seen: 1 year 10 months ago
Joined: 2016-09-15 07:40
Hi,

Hi,

The schematic attachment.

Best Regards,
Ulrich

Attachment: