public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alexey Klimov" <alexey.klimov@linaro.org>
To: "Jonathan Marek" <jonathan@marek.ca>,
	"Srinivas Kandagatla" <srinivas.kandagatla@oss.qualcomm.com>,
	"Srinivas Kandagatla" <srini@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"open list:QCOM AUDIO (ASoC) DRIVERS"
	<linux-sound@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] ASoC: codecs: wsa884x: remove mute_unmute_on_trigger
Date: Wed, 26 Nov 2025 18:44:00 +0000	[thread overview]
Message-ID: <DEIUJWR51WIX.43GDTH9RA8UH@linaro.org> (raw)
In-Reply-To: <5f15fc5b-375a-1e75-b32d-0d543fa1014d@marek.ca>

On Mon Nov 24, 2025 at 2:55 PM GMT, Jonathan Marek wrote:
> On 11/24/25 9:08 AM, Srinivas Kandagatla wrote:
>> On 11/24/25 6:45 AM, Jonathan Marek wrote:
>>> trigger is atomic (non-schedulable), and soundwire register writes are not
>>> safe to run in an atomic context. (bus is locked with a mutex, and qcom
>>> driver's callback can also sleep if the FIFO is full).
>>>
>> Thanks Jonathan for the patch,
>> 
>> We have nonatomic=1 flag set for all the Qualcomm sound cards, Did you
>> hit any schedule while atomic bug?
>
> Right, I missed that. I'm using a different driver which does not set 
> nonatomic. But this driver to not need nonatomic - 
> mute_unmute_on_trigger is a hack, if there is a timing requirement - 
> then it needs to be explicit, the different timing with this flag is not 
> reliable).
>
>> In-fact this change has helped suppress most of the click and pop noises
>> on laptops, specially with wsa codecs as they accumulate static if the
>> ports are kept open without sending any data.
>> 
>
> 28b0b18d5346 is important to fix the click and pop noises. But the 
> useful part is the rest of the commit, not the mute_unmute_on_trigger 
> flag. As long as the mute_stream() happens while the soundwire stream is 
> enabled (between sdw_enable_stream and sdw_disable_stream), there should 
> be no pop click.
>
> AFAIK the pop/click is because of PDM: zeros (soundwire stream off) 
> represent the minimum (negative maximum) amplitude, and the soundwire 
> stream needs to be enabled to output a zero amplitude (alternating 
> ones/zeros). Turning on the amp while the soundwire stream is not 
> enabled will cause jumps between the minimum and zero amplitude.

>>> -	.mute_unmute_on_trigger = true,

FWIW for wsa881x in analog mode on RB1/RB2 boards I noticed that pop/clicks
sound behaviour is much better when mute_unmute_on_trigger is false.

Although, for wsa881x in soundwire mode the mute_unmute_on_trigger = true
gives decent result of supressing pop/clicks noise on the devices I have.

Maybe it varies from platform to platform and from board to board.

BR,
Alexey

  reply	other threads:[~2025-11-26 18:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24  6:45 [PATCH 0/6] wcd938x/wcd939x fixes Jonathan Marek
2025-11-24  6:45 ` [PATCH 1/6] ASoC: codecs: wsa884x: remove mute_unmute_on_trigger Jonathan Marek
2025-11-24 14:08   ` Srinivas Kandagatla
2025-11-24 14:55     ` Jonathan Marek
2025-11-26 18:44       ` Alexey Klimov [this message]
2025-11-27 10:14       ` Srinivas Kandagatla
2025-11-27 13:57         ` Jonathan Marek
2025-11-24  6:45 ` [PATCH 2/6] ASoC: codecs: wsa883x: " Jonathan Marek
2025-11-24  6:45 ` [PATCH 3/6] ASoC: codecs: wcd939x: fix headphone pop/click sound Jonathan Marek
2025-11-24  6:45 ` [PATCH 4/6] ASoC: codecs: wcd938x: " Jonathan Marek
2025-11-24  6:45 ` [PATCH 5/6] ASoC: codecs: wcd939x: fix get_swr_port behavior Jonathan Marek
2025-11-24  6:45 ` [PATCH 6/6] ASoC: codecs: wcd938x: " Jonathan Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DEIUJWR51WIX.43GDTH9RA8UH@linaro.org \
    --to=alexey.klimov@linaro.org \
    --cc=broonie@kernel.org \
    --cc=jonathan@marek.ca \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=perex@perex.cz \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox