This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Getting pop-up noise before and after playing audio file + am335x + tlv320dac3100

Other Parts Discussed in Thread: TLV320DAC3100, AM3351

Hi

I have used tlv320dac3100 DAC with AM3351 processor.  I am facing issue regarding pop-up sound before and after playing audio file.

For playing audio, I have used "aplay audio1.wav" command.

Below are the configuration that I have done in tlv320aic31xx.c file.

static int aic31xx_setup_pll(struct snd_soc_codec *codec,
                             struct snd_pcm_hw_params *params)
{

        ----

        ----

        snd_soc_write(codec, AIC31XX_DACPRB, 0x05);
        snd_soc_write(codec, AIC31XX_HPPOP, 0x4E);
        snd_soc_write(codec, AIC31XX_LANALOGHPL, 0x00);
        snd_soc_write(codec, AIC31XX_HPDRIVER, 0x04);
        snd_soc_write(codec, AIC31XX_HPLGAIN, 0x06);
        snd_soc_write(codec, AIC31XX_DACMIXERROUTE, 0x40);
        snd_soc_write(codec, AIC31XX_LDACVOL, 0x81);
        snd_soc_write(codec, AIC31XX_HPDRIVER, 0x14);
        snd_soc_write(codec, AIC31XX_SPPGARAMP, 0x70);
        snd_soc_write(codec, AIC31XX_LANALOGSPL, 0x98);
        snd_soc_write(codec, AIC31XX_SPLGAIN, 0x1C);
        snd_soc_write(codec, AIC31XX_DACSETUP, 0x96);
        snd_soc_write(codec, AIC31XX_DACMUTE, 0x04);
        snd_soc_write(codec, AIC31XX_SPKAMP, 0x86);

}

After playing audio file, I also observed the static noise for 2-3 sec (until class-D Amp off). In solution of that I have done below changes in tlv320aic31xx.c file

static int aic31xx_dac_mute(struct snd_soc_dai *codec_dai, int mute)
{
        struct snd_soc_codec *codec = codec_dai->codec;

        if (mute) {
                snd_soc_write(codec, AIC31XX_LDACVOL, 0x81);
                snd_soc_update_bits(codec, AIC31XX_DACMUTE,
                                    AIC31XX_DACMUTE_MASK,
                                    AIC31XX_DACMUTE_MASK);
                snd_soc_write(codec, AIC31XX_SPKAMP, 0x06);
        } else {
                snd_soc_update_bits(codec, AIC31XX_DACMUTE,
                                    AIC31XX_DACMUTE_MASK, 0x0);
        }

        return 0;
}

The changes I have done for resolving the issue of static noise, is it correct ?

But still I am getting pop-up noise. The pop-up noise is related to static noise ? or due to class-D amplifile on/off ? because every time when the value of P1/R32 change from 0x06 to 0x86 or vice versa, it gives like pop-up sound.


I am using 24db (max) gain for class-D amplifier (P1/R42).


Please give some suggestions to remove pop-up/static noise??


Thanks,

Ankit


      

  • Hello, Ankit,

    The pup-up issues are often related with the ramp-up and ramp-down period of the headphone and Class-D drivers. These times are controlled by page 1 / register 33-34. Additionally, we recommend to reduce the volume and mute the drivers before powering down them. When volume is increased quickly, the pop issues are more common. Finally, ensure that the power supplies are regulated correctly. If there is high ripple at the power pins, the pop issues could appear.

    Best regards,
    Luis Fernando Rodríguez S.
  • Hi Luis Fernando,


    I have tried different value of page 1 / register 33-34 with same flow of mute sequence that you have mentioned while power down. But still getting small pop-up sound before and after audio play.


    Is there any method to calculate driver power ON time / ramp up time and ramp down time?


    I also found that this pop-up sound is generated due to class-D amplifier power up during audio play and power down after completion of audio play.

    When I fired below command, it generates small pop-up sound. The same sound I hear during audio start and stop.

    i2cset -f -y 0 0x18 0x00 0x01 ( set page 1)

     

    i2cset -f -y 0 0x18 0x20 0x86  (Generates small pop-up sound)

    i2cset -f -y 0 0x18 0x20 0x06 (Generates small pop-up sound)

    Is it possible to suppress class-D amplifier ON/OFF sound?

    Thanks,

    Ankit


  • Ankit,

    I would recommend to mute or place the Class-D amplifier at minimum volume. Once the Class-D amplifier is powered on/off, there shouldn't be a high pop sound.

    Best regards,
    Luis Fernando Rodríguez S.
  • Hi Luis Fernando,


    I have muted Class-D amplifier first when aic31xx_dac_mute() called in driver. Below are the sequence that I have followed in aic31xx_dac_mute() method.

    static int aic31xx_dac_mute(struct snd_soc_dai *codec_dai, int mute)
    {
            struct snd_soc_codec *codec = codec_dai->codec;

            if (mute) {
                    //Mute Class-D and set lower gain (6db)
                    snd_soc_write(codec, AIC31XX_SPLGAIN, 0x00);

                    //Power Off Class-D
                    snd_soc_write(codec, AIC31XX_SPKAMP, 0x06);

                    //Mute LDAC
                    snd_soc_update_bits(codec, AIC31XX_DACMUTE,
                                        AIC31XX_DACMUTE_MASK,
                                        AIC31XX_DACMUTE_MASK);
                    //Power Off LDAC
                    snd_soc_write(codec, AIC31XX_DACSETUP, 0x10);
            } else {
                    //DAC Data-Path Setup (Power-up LDAC)
                    snd_soc_update_bits(codec, AIC31XX_DACSETUP, 0xFF, 0x90);

                    snd_soc_update_bits(codec, AIC31XX_DACMUTE,
                                        AIC31XX_DACMUTE_MASK, 0x0);

                    // Power up Class-D speaker amplifier
                    snd_soc_update_bits(codec, AIC31XX_SPKAMP, 0x80, 0x80);

                    //Setup Class-D speaker driver (SPK) (Unmute Class-D)
                    snd_soc_update_bits(codec, AIC31XX_SPLGAIN, 0xFF, 0x1C);

                    // Left-channel analog volume control output is routed to class-D output driver.
                    snd_soc_update_bits(codec, AIC31XX_LANALOGSPL, 0xFF, 0x92);
            }

            return 0;
    }

    But still getting small pop-up sound before and after audio play. The original method of aic31xx_dac_mute() is as shown below.

    static int aic31xx_dac_mute(struct snd_soc_dai *codec_dai, int mute)
    {
            struct snd_soc_codec *codec = codec_dai->codec;

            if (mute) {

                    snd_soc_update_bits(codec, AIC31XX_DACMUTE,
                                        AIC31XX_DACMUTE_MASK,
                                        AIC31XX_DACMUTE_MASK);
            } else {
     
                    snd_soc_update_bits(codec, AIC31XX_DACMUTE,
                                        AIC31XX_DACMUTE_MASK, 0x0);

            }

            return 0;
    }

    But when i used above original method of aic31xx_dac_mute(), i get static noise for 2-3 sec after completion of audio play. Because by using this original method, the class-D amplifier is going to power down after 2-3 sec.
    Due to this I have changed aic31xx_dac_mute() method as mentioned before original method.

    Thanks,

    Ankit

  • Hello, Ankit,

    This seems to be related with the power supply section. Have you verified if the power supplies are stable when the Class-D amplifier is powered on/off?

    Best regards,
    Luis Fernando Rodríguez S.