From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 222D3C04E53 for ; Wed, 15 May 2019 15:28:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E42E720862 for ; Wed, 15 May 2019 15:28:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BRQHxlGe"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=emlid.com header.i=@emlid.com header.b="tnQRMJzn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E42E720862 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=emlid.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2K7bt3fY9orVJFfSiGSEmgEFO7F1jALv5X68I3cjA80=; b=BRQHxlGevK8AXE 9pAXRF9LziaX/zEXCPH57e2AjUcn4oZbRpwGo1A808vqEq8OYbh6SpcKqzFckXa+XYHPZhGwINa1R FI/6oD/oHKuyRvSV4fjfRrLtaEWIrbnnLsQBFHdzDZl8aUTUfVFMHczcDbsgKsDo/BQLX7GqCuNOL a7Ba/kBOSEI1O/h0DDWUqm5iIbsEmZO1MZYYwsK+8VyQA/suf3bC2D9FGm475h0ubUMCki2vfF3JW wlNPfjBJBOqULlo4oYB8C/LeTY9tII3KXpvviqQb52peINlkkR31i6Jkti/FyE3HG6RntU8MtwWS4 g2J9oeS5Upx15Osn796A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQvp5-0005mO-C2; Wed, 15 May 2019 15:28:03 +0000 Received: from forward102p.mail.yandex.net ([77.88.28.102]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQvp1-0005m5-Fx for linux-arm-kernel@lists.infradead.org; Wed, 15 May 2019 15:28:02 +0000 Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 4FBBC1D40BDA; Wed, 15 May 2019 18:27:54 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kDVHURfUA6-Rq4Wx0eM; Wed, 15 May 2019 18:27:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emlid.com; s=mail; t=1557934074; bh=C9/4v9tZ0QA/I8UwQ8+Wr54uQ98kB7tY2rAZlSGmGYI=; h=In-Reply-To:Subject:Cc:To:From:References:Date:Message-ID; b=tnQRMJznuo5R16cq/Ov8sa/PaVK+rORZKkA1sQYsDu0o7peSJuugenAiGPWBPUrlS Up1xPKTEoZMWy/XFlbCRjS95GmR1jY25LEe2yKUe4L0eJJOe3RT4ubBCE7e+4TGmF3 VJRm9s/M6jk8QSmFGD3aS7F7dR37uzC5JOsQ8wj4= Authentication-Results: mxback6j.mail.yandex.net; dkim=pass header.i=@emlid.com Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id biQI4DmMhu-Ro3qG95V; Wed, 15 May 2019 18:27:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Date: Wed, 15 May 2019 18:27:49 +0300 From: Georgii Staroselskii To: Maxime Ripard Subject: Re: [PATCH] ASoC: sun4i-codec: fix first delay on Speaker Message-ID: <20190515152749.GA2241@softcrasher> References: <1557925120-31498-1-git-send-email-georgii.staroselskii@emlid.com> <20190515135813.5y72f2h526yjkncy@flea> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190515135813.5y72f2h526yjkncy@flea> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190515_082759_958746_5BBBCB40 X-CRM114-Status: GOOD ( 26.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, dannym@scratchpost.org, tiwai@suse.com, lgirdwood@gmail.com, wens@csie.org, broonie@kernel.org, perex@perex.cz, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 15, 2019 at 03:58:13PM +0200, Maxime Ripard wrote: Hi! > Hi, > > On Wed, May 15, 2019 at 03:58:40PM +0300, Georgii Staroselskii wrote: > > This commit fixes the same issue as bf14da7 but for another codepath. > > The issue can be triggered by having Speaker in codec audio routing. > > Mentionning what "the issue" is in the commit log would be great. > Sure, will do. > > &codec { > > allwinner,pa-gpios = <&r_pio 0 11 GPIO_ACTIVE_HIGH>; /* PL11 */ > > allwinner,audio-routing = > > "Speaker", "LINEOUT"; > > > > status = "okay"; > > } > > > > Signed-off-by: Georgii Staroselskii > > --- > > sound/soc/sunxi/sun4i-codec.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c > > index 15d08e3..e0099519 100644 > > --- a/sound/soc/sunxi/sun4i-codec.c > > +++ b/sound/soc/sunxi/sun4i-codec.c > > @@ -1329,6 +1329,15 @@ static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w, > > gpiod_set_value_cansleep(scodec->gpio_pa, > > !!SND_SOC_DAPM_EVENT_ON(event)); > > > > + if (SND_SOC_DAPM_EVENT_ON(event)) { > > + /* > > + * Need a delay to have the amplifier up. 700ms seems the best > > + * compromise between the time to let the amplifier up and the > > + * time not to feel this delay while playing a sound. > > + */ > > + msleep(700); > > + } > > + > > Since this is an external amplifier, I guess they would have different > warm-up time depending on the exact part being used? > I guess I might've used Speaker wrong and bumped into an existing issue. The issue first arose when I needed to connect a speaker and use a mute GPIO pin to toggle it. I bumped into the lag similar to the one that has been fixed in bf14da7. The word "amplifier" here in my comments might be wrong and misleding. Sorry for that. I just measured the latency on the speaker I'm using and it is well under 1ms so this is the Allwinner DAC that is pushing the data with a lag. Or some other thing, I'm not sure. I want to stress again that I might've experienced the issue because I was abusing "Speaker" routing. I basically just needed the analog audio stream and mute GPIO handling done automatically. bf14da7 made me think that this is some hardware Allwinner issue that needs to be fixed here. And well, it did fix the problem. > If so, we should use a property and set it on a per-board basis. > There might be a use case for that but this issue seems to be orthogonal to this. > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com Best regards, Georgii Staroselskii _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel