From patchwork Fri Nov 14 03:59:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5303031 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9BA0E9F2ED for ; Fri, 14 Nov 2014 03:59:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABDCE201BB for ; Fri, 14 Nov 2014 03:59:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7A7422010B for ; Fri, 14 Nov 2014 03:59:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 030482664F0; Fri, 14 Nov 2014 04:59:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BD1C2260503; Fri, 14 Nov 2014 04:59:13 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3949B26050C; Fri, 14 Nov 2014 04:59:13 +0100 (CET) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by alsa0.perex.cz (Postfix) with ESMTP id 1DE7A2604E8 for ; Fri, 14 Nov 2014 04:59:05 +0100 (CET) Received: by mail-lb0-f179.google.com with SMTP id l4so12268400lbv.10 for ; Thu, 13 Nov 2014 19:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GzE/ddWPLi6+9D1TbQeNeeSVEbYEM9Zi8WDzp7Jb61o=; b=BT7HAfihP231Lkm+QWbDHyiIo+gDASx6TOtHQmtwKug0LbPc08Rxyx6Ixg+8hZduCc YdEd29kGVplY/pepWOxQgqZro1wonPw8ORXJjHFYtb99znJwV+BU2ggIa0eWisW0UC4k Ms/g7pZ6APCoqAfgNpu6p+DZK4wR2+9hWF6mWvZTQWJe0reN8KshotTw7124O2o0YnCo P1LTnrjhpziAG+504neoNnw/dQh6G9JUmDUgx5PJGR36ZCRptgBSfSj65tvrdkRDxUVs ot6Wdd8LZKUl9Q39Ui8KWfiOSIWzSxeoIxHr8T7d6T9jvh1BAOpxuTwIjlmrl662n5U5 tD0A== MIME-Version: 1.0 X-Received: by 10.112.169.6 with SMTP id aa6mr6034257lbc.29.1415937544536; Thu, 13 Nov 2014 19:59:04 -0800 (PST) Received: by 10.152.7.39 with HTTP; Thu, 13 Nov 2014 19:59:04 -0800 (PST) In-Reply-To: <54655E35.9000807@beamcommunications.com> References: <54655E35.9000807@beamcommunications.com> Date: Fri, 14 Nov 2014 01:59:04 -0200 Message-ID: From: Fabio Estevam To: Craig McQueen Cc: "alsa-devel@alsa-project.org" Subject: Re: [alsa-devel] Pop and offsets at start of audio playback/record for SGTL5000 on i.MX28 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Nov 13, 2014 at 11:43 PM, Craig McQueen 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: response. --- 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