On Fri, Mar 15, 2024 at 04:05:21PM +0100, Alexandre Mergnat wrote:
On 15/03/2024 15:30, Mark Brown wrote:
Let me know, when you change de gain to do a ramp down (start from user gain to gain=-40db), next time for the ramp up, how/where do you find the user gain ?
In the register. You only need to reset the gain to -40dB at the start of the ramp.
Sorry but I don't understand your logic, I'm not able to implement it... If I'm at -10dB and doing a ramp to reach -40dB, next time I will read the register the value will be -40dB.
After we've done the ramp and turned the amplifier off we can just restore the desired value? The hardware is not going to care what the volume is while it's not enabled.
This implementation is also done in other MTK audio codec drivers.
Perhaps they should be updated too?
When microphone isn't capturing, the gain read back from the register is 0dB. I've put some logs in my code and do capture to show how it works:
Is this a property of the hardware or a property of your driver?
At the end of the capture, the gain is set to 0dB by the driver. At the start of the capture, the gain is set to the setup gain.
So that's a property of the driver then?
AFAII from the comment in the code, it's done to avoid the "pop noises".
Yes, that's the usual reason to ramp gains. Though if you've just copied the code without checking that it's needed it's possible that this is something that's been fixed in current hardware.
linaro-mm-sig@lists.linaro.org