[alsa-devel] Pop and offsets at start of audio playback/record for SGTL5000 on i.MX28

Fabio Estevam festevam at gmail.com
Fri Nov 14 04:59:04 CET 2014


On Thu, Nov 13, 2014 at 11:43 PM, Craig McQueen
<craig.mcqueen at beamcommunications.com> wrote:
> I'm testing the 3.14.19 kernel for i.MX28 EVK, which has an SGTL5000 CODEC.
> I've also tested on the 3.18-rc4 kernel and confirmed this issue still
> occurs.
>
>
> Playback
>
> When doing audio playback, I notice that the audio "fades in" over the first
> (approximately) 500 ms of playback. This is very noticeable and not ideal in
> certain applications (e.g. audio notifications that are of short duration).

It seems that this behaviour can be controlled by the SMALL_POP bit:
"Setting this bit slows down the VAG ramp from ~200ms to ~400ms to
reduce the startup
pop, but increases the turn on/off time."

Looking at the code I see its definition is wrong:

--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1307,8 +1307,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)

        /* enable small pop, introduce 400ms delay in turning off */
        snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
-                               SGTL5000_SMALL_POP,
-                               SGTL5000_SMALL_POP);
+                               SGTL5000_SMALL_POP, 1);

        /* disable short cut detector */
        snd_soc_write(codec, SGTL5000_CHIP_SHORT_CTRL, 0);
diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h
index 2f8c889..bd7a344 100644
--- a/sound/soc/codecs/sgtl5000.h
+++ b/sound/soc/codecs/sgtl5000.h
@@ -275,7 +275,7 @@
 #define SGTL5000_BIAS_CTRL_MASK                        0x000e
 #define SGTL5000_BIAS_CTRL_SHIFT               1
 #define SGTL5000_BIAS_CTRL_WIDTH               3
-#define SGTL5000_SMALL_POP                     0x0001
+#define SGTL5000_SMALL_POP                     0

This change keeps the original intention of enabling 'small pop'. You
can try 'SGTL5000_SMALL_POP, 0);' to see if you get a quicker
response.


More information about the Alsa-devel mailing list