2021-09-13 09:24 AM
Hi again, hope you are having a good day.
We are trying to record audio with the integrated audio codec with a python script, but it starts with an abrupt peak every time like the image below.
We have tried to configure the alsamixer and nothing changes.
Thanks.
2021-09-23 06:06 AM
Hi @Juan Martín Castillo ,
I also have this behavior with my SM32MP157F-DK2, but the overshoot starts from 0.5 instead of 1 (Y axis).
In the CS42L51 codec, there are some controls to limit the audio artifacts, especially on soft ramp.
Feel free to have a look into the datasheet of the codec : https://statics.cirrus.com/pubs/proDatasheet/CS42L51_F2.pdf
These controls are not managed by default on the platform, but you can use the following controls to improve the behavior:
SOC_SINGLE("ADC SoftA Ramp Switch", CS42L51_ADC_CTL, 1, 1, 0),
SOC_SINGLE("ADC ZeroA Cross Switch", CS42L51_ADC_CTL, 0, 1, 0),
SOC_SINGLE("ADC SoftB Ramp Switch", CS42L51_ADC_CTL, 3, 1, 0),
SOC_SINGLE("ADC ZeroB Cross Switch", CS42L51_ADC_CTL, 2, 1, 0),
amixer -c 0 cset name='ADC SoftA Ramp Switch' on
amixer -c 0 cset name='ADC SoftB Ramp Switch' on
amixer -c 0 cset name='ADC ZeroA Cross Switch' on
amixer -c 0 cset name='ADC ZeroB Cross Switch' on
You can dump codec registers with this command :
cat /sys/kernel/debug/regmap/0-004a/register
There are some other control that can improve : attenuator, limiter...
BR,
Christophe