From: Zidan Wang <zidan.wang@freescale.com>
To: Mark Brown <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <perex@perex.cz>, <tiwai@suse.de>,
<ckeepax@opensource.wolfsonmicro.com>, <lars@metafoo.de>,
<patches@opensource.wolfsonmicro.com>,
<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel][PATCH 1/4] ASoC: wm8960: codec mclk should be enabled early to avoid jack detect error
Date: Fri, 12 Jun 2015 14:32:33 +0800 [thread overview]
Message-ID: <20150612063231.GA23608@shlinux2> (raw)
In-Reply-To: <20150611162028.GT14071@sirena.org.uk>
On Thu, Jun 11, 2015 at 05:20:28PM +0100, Mark Brown wrote:
> On Thu, Jun 11, 2015 at 07:14:33PM +0800, Zidan Wang wrote:
> > It will playback from speaker in the first 2 seconds, then switch to
> > headphone. Steps to reproduce this issue:
> > 1. plug out headphone and playback a wav.
> > 2. stop playback and wait for at least 5 seconds, then
> > plug in headphone and playback a wav.
>
> I'd really like to understand the logic behind this in more detail -
> what is the actual problem here and how does this fix it? You're moving
> the clock management from the bias level setting to the stream startup
> and teardown which doesn't seem directly related, if anything it seems
> like it'd be making things worse since it reduces the proportion of the
> time where the clock is enabled. My guess is that the jack detection
> needs MCLK enabling.
I select RINPUT3/JD3 pins as headphone jack detect inputs. I found that
it would detected as speaker sometimes even if headphone jack is plugged in.
And it would be reproduced everytime when i followed below steps:
1. Unplug headphone jack and playback a wav. It will playback from speaker.
2. Stop playback and wait for at least 5 seconds, then plug in headphone jack
and playback a wav. I will playback from speaker in the first 1-2 seconds,
and then switch to headphone.
I suspect the codec need some time to prepare jack detect function after SYSCLK
enable. When Unplug headphone jack and playback, it will detect as speaker. After
this playback, the mclk will be disabled, and the detect function will be disabled
too. So when you plug in the headphone jack in this moment, the codec can't detect
as headphone. And when playback a wav, it will playback from speaker. After the
headphone jack detect function works, it will switch to headphone.
I have done some test today, and found that after mclk enable, we should delay
at least 150ms to prepare the jack detect function. So no need to move mclk
enable to startup.
Best Regards,
Zidan Wang
next prev parent reply other threads:[~2015-06-12 6:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1434020423.git.zidan.wang@freescale.com>
2015-06-11 11:14 ` [alsa-devel][PATCH 1/4] ASoC: wm8960: codec mclk should be enabled early to avoid jack detect error Zidan Wang
2015-06-11 16:20 ` Mark Brown
2015-06-12 6:32 ` Zidan Wang [this message]
2015-06-12 10:33 ` Mark Brown
2015-06-16 9:30 ` Zidan Wang
2015-06-11 11:14 ` [alsa-devel][PATCH 2/4] ASoC: wm8960: support configure headphone jack detect pin and polarity from device tree Zidan Wang
2015-06-12 12:50 ` Charles Keepax
2015-06-16 7:47 ` Zidan Wang
2015-06-11 11:14 ` [alsa-devel][PATCH 3/4] ASoC: wm8960: add kcontrol to select ADC data output Zidan Wang
2015-06-12 12:29 ` Charles Keepax
2015-06-11 11:14 ` [alsa-devel][PATCH 4/4] ASoC: wm8960: the enum of "DAC Polarity" should be wm8960_enum[1] Zidan Wang
2015-06-12 12:31 ` Charles Keepax
2015-06-12 13:02 ` 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=20150612063231.GA23608@shlinux2 \
--to=zidan.wang@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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