Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp671684rwl; Thu, 23 Mar 2023 23:46:38 -0700 (PDT) X-Google-Smtp-Source: AKy350aWARWkzBBlTxsvlN3MxFglqVpAnakimYQReML5hmhNtYJwvAWPg/AZI/FpnxVFpqmKHx0G X-Received: by 2002:a17:906:b0d4:b0:932:e141:29be with SMTP id bk20-20020a170906b0d400b00932e14129bemr1531134ejb.75.1679640398006; Thu, 23 Mar 2023 23:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679640397; cv=none; d=google.com; s=arc-20160816; b=qJXyFD2IDHxVDfwaJQuQ3BJSegE9+PJOMZRRILmbk4twmxlZh50Q1rw9FKvzzlK7xm uQcbTYOmBuQL6IcYpI2zyitdaP1GXSLP0HiEGvQI25l7hNtJE+GljZ1hyk3lrGz7cDLm brTPucOowWqsUW0IVt9HxcW7wi6Ks3hDA3GPIvKxsYLgLhIruKIwSIgAIrGQpT8J7IUN b8mC9HenrvUjKBIGLoR2pAgL+i03Re5i+OLcONT5OAsW9kG2RmK+vTgxMhPA6yLFrQJ8 izwFdWJ2GngTuqBhdbodj+CBWyZFf7zU1s28uWXWedVK7SA1tUWj/hdVnafL5ERt8loM Beow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=sCX/SFYH/vwWzfLjx0NaL7F5JK5dcabJ3U2Bkjqieto=; b=NB7yMo52jCqxOzWTNvkzUXPRKQnOg7Ax/uXdMF8yUcTBXjqNlf5ysg2NtETsEpGXNe mE7WwyxI522NWUsd57HTP5tTLlx9s9KRSH0O5jCakXG37j9+XG07Z+L2pWsln6QzPuz4 ob1Av7QzdOSex+/VhCTg0nzs9X327WxogPxnWgn8MqhYo8gj9vwNucq2Zk9qfaHAL25n FGM6JexRID6772F/O6v38yVQq80yy5acaZOR4pzKCHBAZ7R/i/h2zfGktbDnyyWFHdZA 9QUcG5ATuMJgMurx1idF7Lx3jSgLswB5+ToARtQ69q+/QrB01eaU/dlXYTKrfXU/cozD mmVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VQcF+cyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rh16-20020a17090720f000b009346fbb76fcsi4326969ejb.978.2023.03.23.23.46.13; Thu, 23 Mar 2023 23:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VQcF+cyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbjCXGop (ORCPT + 99 others); Fri, 24 Mar 2023 02:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbjCXGoo (ORCPT ); Fri, 24 Mar 2023 02:44:44 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DAB955BA for ; Thu, 23 Mar 2023 23:44:43 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id w9so3969181edc.3 for ; Thu, 23 Mar 2023 23:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679640282; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=sCX/SFYH/vwWzfLjx0NaL7F5JK5dcabJ3U2Bkjqieto=; b=VQcF+cyCC1f8OrBQq8fWy7c7wZ0CwMWosRl6X3GKeEVMv53aLT1LLpK07Fb8P3k7hE xJsfaDi9M2z0/td6Y+9/+rwp+o9FnmkyrnjzRcv/8ynsw8yup8oAw09c0DUuxzYAPR2b kUvVhTjHfSrZyBea4+snXIQyDgSxdkW4mgD5um0xvRCdy+haLAazQ7t46fZpL+nGDuk1 rYAUX65wCYgY8Gvq8jLaGnifR+p4OFc6jEbM4o0Y94kkTM5PXm8aFW8TwXMkoQWzD+X1 Vs7VY2XUQqGxqhSWBurxz73sgunhDVX2ki1m6AB4iWTCdWJ/tvr02vkLgnwRwlJPMvd6 uRaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679640282; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sCX/SFYH/vwWzfLjx0NaL7F5JK5dcabJ3U2Bkjqieto=; b=NBgTGdrCL2mJaQGOGeOEY1itdm/rVBAZ23TUhSLrcp66h4UcWhjHr0oMQ9m5YDGVHl FRvCih3fenjuPVrXM2pEo+vQFvGUXt1XvOEhI0s8dX2dp1vqpgx6gNpOSXqteDYnzz20 RF+cRkg0lJmB9t1BPhxp9K9eLNzGqctmZ/BqWBQn8vbePDQischgJQmELUngjx83tX+m FbNEVo4GVTI7Bp194038zhNhIMA53J5/SNzLHqXzdycEslM6rSUuU08PlvYgeypxggzp VUC1OuWnmAF28iOSST8XJ71VPKQYx3zXOxPKBPBcs1KSOviyKoYvi8X1yvg1RemTNS0a vzUQ== X-Gm-Message-State: AAQBX9fzpEdv/v90GtJS8R87Sn9WJWw/98lP6Wz/UPE3C5C5VbVKrgst SzmaqxdqRzIMAnt1jjS1TK4R0g== X-Received: by 2002:aa7:cd9a:0:b0:4ac:b687:f57e with SMTP id x26-20020aa7cd9a000000b004acb687f57emr1798860edv.1.1679640282078; Thu, 23 Mar 2023 23:44:42 -0700 (PDT) Received: from [192.168.1.195] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id e22-20020a50a696000000b005021c7f08absm872205edc.29.2023.03.23.23.44.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Mar 2023 23:44:41 -0700 (PDT) Message-ID: <2a0aabf5-41a3-cc07-3203-9b0bca6b71aa@linaro.org> Date: Fri, 24 Mar 2023 06:44:40 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 3/4] ASoC: codecs: wsa883x: mute/unmute PA in correct sequence Content-Language: en-US To: Mark Brown Cc: perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, johan+linaro@kernel.org, steev@kali.org, dmitry.baryshkov@linaro.org References: <20230323164403.6654-1-srinivas.kandagatla@linaro.org> <20230323164403.6654-4-srinivas.kandagatla@linaro.org> From: Srinivas Kandagatla In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/03/2023 17:07, Mark Brown wrote: > On Thu, Mar 23, 2023 at 04:44:02PM +0000, Srinivas Kandagatla wrote: >> In the current setup the PA is left unmuted even when the >> Soundwire ports are not started streaming. This can lead to click >> and pop sounds during start. >> There is a same issue in the reverse order where in the PA is >> left unmute even after the data stream is stopped, the time >> between data stream stopping and port closing is long enough >> to accumulate DC on the line resulting in Click/Pop noise >> during end of stream. > > Wow, that hardware sounds *super* fragile. > >> Moving the mute/unmute to trigger stop/start respectively seems to >> help a lot with this Click/Pop issues reported on this Codec. > >> +static int wsa883x_trigger(struct snd_pcm_substream *s, int cmd, >> + struct snd_soc_dai *dai) >> +{ >> + switch (cmd) { >> + case SNDRV_PCM_TRIGGER_START: >> + case SNDRV_PCM_TRIGGER_RESUME: >> + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: >> + wsa883x_digital_mute(dai, false, 0); >> + break; > >> static const struct snd_soc_dai_ops wsa883x_dai_ops = { >> + .startup = wsa883x_startup, >> .hw_params = wsa883x_hw_params, >> .hw_free = wsa883x_hw_free, >> - .mute_stream = wsa883x_digital_mute, >> + .trigger = wsa883x_trigger, > > The trigger is run in atomic context, can you really write safely to a > SoundWire device there? > > This feels like we should be doing it at the framework level, either > tightening up where the mute happens in general or having some option > that devices can select if they really need it. That makes more sense, I can give that a try. --srini