cancel
Showing results for 
Search instead for 
Did you mean: 

Audio recorded with STM32MP157D-DK1 presents problems

JMart.13
Senior

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.

0693W00000Dn1qNQAR.jpgWe have tried to configure the alsamixer and nothing changes.

Thanks.

This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Christophe Guibout
ST Employee

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

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.