From patchwork Wed Nov 11 02:45:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxin Yu X-Patchwork-Id: 11896143 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=-11.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT 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 DA345C388F7 for ; Wed, 11 Nov 2020 02:46:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 B0F0620759 for ; Wed, 11 Nov 2020 02:46:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="br1HCdaJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Ph9dz+a2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0F0620759 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 42E971729; Wed, 11 Nov 2020 03:45:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42E971729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1605062799; bh=IcCu3+Zc2n3kYPQu033Mn4Z4XaeAhwPBlnreV28pxOQ=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=br1HCdaJtKzeF8ytLa19dJRRkW//QpJH7YyvWgXagOLXJEtcJ4naVALhu+pM5sKBY m34bzKi83iQ0apc4l8rugdoG3KXQQSFhtUMIuUJ2Tr05cwzQVndsP1B7W/lcjuQdjD lQEYKr6VbVyyymIE0yXxZzK/cNC11r7iVgQR8ZB4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C1F6EF801F5; Wed, 11 Nov 2020 03:45:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE35FF8020C; Wed, 11 Nov 2020 03:45:41 +0100 (CET) Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by alsa1.perex.cz (Postfix) with ESMTP id 6EF68F8007E for ; Wed, 11 Nov 2020 03:45:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6EF68F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Ph9dz+a2" X-UUID: 35bbd99d68cf4914a39cba7b28e5385a-20201111 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=IcCu3+Zc2n3kYPQu033Mn4Z4XaeAhwPBlnreV28pxOQ=; b=Ph9dz+a2wcPaenoN1rUt8b/zc8I9AdPs08WA7iVq95BA+XmUSDv//oiiATFYxRT7nSJ52qVYo9OD1w5uYw5L8bHUKRmox2OdeE1V+vpGV//XkBHhqHee3/4sH25FN+JjuLS0Kn3NeLk/9lEnJmRNcUk742/Ly6jv05FBWFuWzpw=; X-UUID: 35bbd99d68cf4914a39cba7b28e5385a-20201111 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1493458854; Wed, 11 Nov 2020 10:45:25 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Nov 2020 10:45:23 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 11 Nov 2020 10:45:23 +0800 From: Jiaxin Yu To: , , , , , , Subject: [PATCH v2] ASoC: mediatek: mt8192: skip first time data at the beginning of DMIC recording Date: Wed, 11 Nov 2020 10:45:22 +0800 Message-ID: <1605062722-8711-1-git-send-email-jiaxin.yu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-MTK: N Cc: shane.chien@mediatek.com, Trevor.Wu@mediatek.com, Jiaxin Yu X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" We can choose to drop away any length of data from the beginning according to project needs. Some projects don't want to throw away any data, because they want to use recorded data to do echo cancellation, so they have to make sure that they are aligned with the reference data as much as possible. Or there are other algorithms in the upper layer to eliminate this noise. Or some projects want to eliminate this noise form the kernel layer. However, the minimum recommended value is 50ms to skip pop noise. Signed-off-by: Jiaxin Yu --- This seems like something that would apply equally to all DMICs so should be done at a more general level, so we implement it in the DMIC driver. sound/soc/mediatek/Kconfig | 1 + sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index dc628fb6c1025..31f1431bf5792 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -175,6 +175,7 @@ config SND_SOC_MT8192_MT6359_RT1015_RT5682 select SND_SOC_MT6359 select SND_SOC_RT1015 select SND_SOC_RT5682_I2C + select SND_SOC_DMIC help This adds ASoC driver for Mediatek MT8192 boards with the MT6359 RT1015 RT5682 audio codec. diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index 41d8a8567bb38..b7f42a530d069 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -540,7 +540,9 @@ SND_SOC_DAILINK_DEFS(playback_hdmi, SND_SOC_DAILINK_DEFS(primary_codec, DAILINK_COMP_ARRAY(COMP_CPU("ADDA")), DAILINK_COMP_ARRAY(COMP_CODEC("mt6359-sound", - "mt6359-snd-codec-aif1")), + "mt6359-snd-codec-aif1"), + COMP_CODEC("dmic-codec", + "dmic-hifi")), DAILINK_COMP_ARRAY(COMP_EMPTY())); SND_SOC_DAILINK_DEFS(primary_codec_ch34,