From: Mark Brown <broonie@kernel.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org, patches@opensource.cirrus.com,
alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>,
Jaroslav Kysela <perex@perex.cz>
Subject: Re: [PATCH 3/3] ASoC: wm8940: Mute also the speaker output
Date: Fri, 10 Jun 2022 12:48:08 +0100 [thread overview]
Message-ID: <YqMveGXbwMhLeo4M@sirena.org.uk> (raw)
In-Reply-To: <20220610112331.4dcc183b@ktm>
[-- Attachment #1: Type: text/plain, Size: 2841 bytes --]
On Fri, Jun 10, 2022 at 11:23:31AM +0200, Lukasz Majewski wrote:
> > On Mon, Jun 06, 2022 at 05:44:41PM +0200, Lukasz Majewski wrote:
> > > Without this change the BTL speaker produces some
> > > "distortion" noise when test program
> > > (speaker-test -t waw) is ended with ctrl+c.
> > > As our design uses speaker outputs to drive BTL speaker,
> > > it was necessary to also mute the speaker via the codec
> > > internal WM8940_SPKVOL register with setting
> > > WM8940_SPKMUTE bit.
> > This will not interact well with both the user visible control of the
> > speaker volume via the Speaker Playback Volume control and the analog
> > bypass paths that the device has - it'll change the state of the
> > control without generating any events, and cut off any bypassed audio
> > that's mixed in.
> I'm wondering why it is safe to call DAI's .digital_mute()
> callback, which explicitly changes state of the "DAC soft mute enable"
> bit (DACMU) ?
If there's a user visible control for the same register bit that's a
bug. If there's no user visible control for it then there's nothing to
conflict with.
> And on the other hand it is not correct to just mute the speakers?
No, that's not what we're muting playback for - the digital mute is
there specifically to deal with issues with host controllers outputing
noise during startup/teardown. If there are issues with the speaker
output then they need to be addressed at that point, especially given
that the device has bypass paths.
> > You can probably achieve a similar effect by making the control an
> > _AUTODISABLE one which will allow the core to mute the control when
> > it's not being used in a way that's not visible to userspace.
> The exact definition for the event, which I'm forcing above:
> SOC_SINGLE("Speaker Playback Switch", WM8940_SPKVOL, 6, 1, 1),
> And there is no SOC_SINGLE_AUTODISABLE() macro available.
That seems solvable? Though if the issue isn't triggered in connection
with a DAPM event (which sounds like the case) then it's probably not
going to help.
> The issue I'm trying to fix:
> - The mclk clock is stopped (after some time) by imx SOC when I end
> 'speaker-test' program with ctrl+c.
> - When the clock is not provided (after ~1sec) I do hear a single short
> noise from speakers.
> - The other solution (which also works) would be to enable clock once
> (during probe) and then do not disable it till system is powered
> off (yes it is a hack :-) ).
If the issue is triggered by the MCLK being disabled prematurely then
the simplest fix is probably to wire up the CODEC MCLK to the clock API
and manage it during set_bias_level() (probably on transition out of and
into _STANDBY) - that should have a similar effect to leaving it enabled
all the time.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-06-10 11:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-06 15:44 [PATCH 1/3] ASoC: wm8940: Remove warning when no plat data Lukasz Majewski
2022-06-06 15:44 ` [PATCH 2/3] ASoC: wm8940: Rewrite code to set proper clocks Lukasz Majewski
2022-06-06 16:18 ` Mark Brown
2022-06-07 12:13 ` Lukasz Majewski
2022-06-07 12:20 ` Mark Brown
2022-06-06 15:44 ` [PATCH 3/3] ASoC: wm8940: Mute also the speaker output Lukasz Majewski
2022-06-06 16:25 ` Mark Brown
2022-06-10 9:23 ` Lukasz Majewski
2022-06-10 11:48 ` Mark Brown [this message]
2022-06-06 15:49 ` [PATCH 1/3] ASoC: wm8940: Remove warning when no plat data Mark Brown
2022-06-06 16:17 ` Lukasz Majewski
2022-06-06 16:52 ` Mark Brown
2022-06-07 12:30 ` Lukasz Majewski
2022-06-07 12:35 ` 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=YqMveGXbwMhLeo4M@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@denx.de \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--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
all inboxes | Powered by JetHome®