lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150612063231.GA23608@shlinux2>
Date:	Fri, 12 Jun 2015 14:32:33 +0800
From:	Zidan Wang <zidan.wang@...escale.com>
To:	Mark Brown <broonie@...nel.org>
CC:	<lgirdwood@...il.com>, <perex@...ex.cz>, <tiwai@...e.de>,
	<ckeepax@...nsource.wolfsonmicro.com>, <lars@...afoo.de>,
	<patches@...nsource.wolfsonmicro.com>,
	<alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [alsa-devel][PATCH 1/4] ASoC: wm8960: codec mclk should be
 enabled early to avoid jack detect error

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ