All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Guanqun <guanqun.lu@intel.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: questions about asoc jack detection
Date: Wed, 20 Apr 2011 22:06:15 +0800	[thread overview]
Message-ID: <20110420140615.GK9074@qtel.sh.intel.com> (raw)
In-Reply-To: <20110420093102.GA4097@opensource.wolfsonmicro.com>

On Wed, Apr 20, 2011 at 05:31:02PM +0800, Mark Brown wrote:
> On Wed, Apr 20, 2011 at 02:52:12PM +0800, Lu Guanqun wrote:
> 
> > I have a question wrt jack detection, suppose now I have internal
> > speaker enabled and then headphone is inserted. According to the current
> > jack code in asoc, the Headphone pin wil be enabled, but it does nothing
> > to Internal Speaker. There is still sound coming out from speaker.
> 
> This is a policy question - depending on the use case the application
> may wish to still play sound out of the speaker.  One obvious example
> here is ringtones on phones.  If the user has been doing something like
> listen to music on headphones but then takes the headphones off they'll
> probably not hear anything that plays out of only the headphones so you
> should play ringtones out of both outputs in order to ensure that they
> are audible.

Yes, it's related to policy. But I see some inconsistencies in handling
this stuff. In this above example, you suggest we should play out of
both outputs. However in HDA code, the common way when headphone is
inserted is to mute the speaker and enable the headphone. Is there some
differences between the HDA code and the ASoC code? Or this is just due
to legacy code?

> 
> If you really want to you can add an invert to the hookup for a pin, but
> it's not recommended unless there's some physical reason both can't be
> enabled simultaneously.
> 
> > The possible solution is to let the application make the policy to
> > switch the output source to Headphone, because the jack event can be
> > observed. If we decide to let the userspace application make the policy,
> > then why do we bother to enable the jack pin at the first place?
> 
> If we can detect the physical presence of the output transducer it's not
> really a policy decision if it's worth enabling the audio path.

-- 
guanqun

  reply	other threads:[~2011-04-20 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20  6:52 questions about asoc jack detection Lu Guanqun
2011-04-20  9:31 ` Mark Brown
2011-04-20 14:06   ` Lu Guanqun [this message]
2011-04-20 14:53     ` Mark Brown
2011-04-20 15:00       ` Lu Guanqun
2011-04-20 15:14         ` Tobin Davis
2011-04-21  0:29           ` Lu Guanqun

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=20110420140615.GK9074@qtel.sh.intel.com \
    --to=guanqun.lu@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.