From: Ezequiel Garcia <ezequiel@collabora.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Stephen Barber <smbarber@chromium.org>,
Mac Chiang <mac.chiang@intel.com>,
Ezequiel Garcia <ezequiel@collabora.co.uk>,
kernel@collabora.com
Subject: Re: [PATCH] ASoC: max98357a: Fix speaker pop when starting playback
Date: Tue, 27 Mar 2018 18:57:44 -0300 [thread overview]
Message-ID: <1522187864.2289.48.camel@collabora.com> (raw)
In-Reply-To: <20180327113631.GB29239@sirena.org.uk>
On Tue, 2018-03-27 at 19:36 +0800, Mark Brown wrote:
> On Thu, Mar 22, 2018 at 10:01:32AM -0300, Ezequiel Garcia wrote:
> > On Thu, 2018-03-22 at 09:54 +0800, Mark Brown wrote:
> > > On Wed, Mar 21, 2018 at 07:30:15PM -0300, Ezequiel Garcia wrote:
> > > > +- sdmode-delay : specify a delay time for SD_MODE pin.
> > > > According
> > > > + to the DAC datasheet, if LRCLK is removed while BCLK
> > > > is
> > > > present,
> > > > + the DAC output can cause loud pop/crack noises. This
> > > > property
> > > > + specifies a delay for the SD_MODE pin assert, required
> > > > to
> > > > + eliminate the noise.
> > > Why is this configurable? This sounds like something entirely
> > > within
> > > the digital domain of the device rather than something that
> > > depends
> > > on
> > > board configuration and it's hard to see how someone would
> > > configure
> > > this.
> > The amount of delay needed seems specific to the CPU DAI,
> > not specific to the DAC. The CPU DAIs or the machine
> > could specify this as a parameter, but I can't don't see how.
>
> This sounds like it's just trying to reimplement the digital mute
> feature we already have, it sounds more like what you're seeing is
> noise
> playing out of the SoC at the start of playback due to startup issues
> or non-flushed FIFOs. Can you try implementing there please?
>
On a second look, I don't think digital mute helps here. And I don't
think the problem is fixable at the CPU DAI level.
The noise has been reported on bcm2835-i2s and rockchip-i2s, which made
me think most SoCs were unable to guarantee the clocks could be stopped
properly.
As the commit explains, the root of the noise is that this amplifier
specifies that the LRCLK cannot be disabled with the BCLK being
enabled.
I don't see any mechanism at the SoC level to guarantee that the LRCLK
and BCLK clocks will be shutdown in order.
Hopefully, I'm making sense here.
> > Perhaps it could be a driver parameter?
>
> Driver parameters are almost never a good idea. Nobody turns them on
> and the mechanisms for doing so are bad.
>
Well, from the above description, it seems this noise arises from a
limitation of the amplifier, so it doesn't seem too bad to apply a
small delay and make it configurable.
The default value (no delay) will work for most users, and the delay
parameter would be turned on by those having noise issues with this
driver.
That is what patch v2 does, let me know if you still think it's
horrible, or if you think I am still missing anything.
Thanks,
Eze
next prev parent reply other threads:[~2018-03-27 21:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 22:30 [PATCH] ASoC: max98357a: Fix speaker pop when starting playback Ezequiel Garcia
2018-03-22 1:54 ` Mark Brown
2018-03-22 4:00 ` Ezequiel Garcia
2018-03-22 13:01 ` Ezequiel Garcia
2018-03-27 11:36 ` Mark Brown
2018-03-27 18:11 ` Ezequiel Garcia
2018-03-27 21:57 ` Ezequiel Garcia [this message]
2018-04-16 18:06 ` Mark Brown
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=1522187864.2289.48.camel@collabora.com \
--to=ezequiel@collabora.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ezequiel@collabora.co.uk \
--cc=kernel@collabora.com \
--cc=lgirdwood@gmail.com \
--cc=mac.chiang@intel.com \
--cc=smbarber@chromium.org \
/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;
as well as URLs for NNTP newsgroup(s).