From: David Henningsson <david.henningsson@canonical.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: HDA: Create phantom jacks for fixed inputs and outputs
Date: Wed, 13 Jun 2012 11:52:46 +0200 [thread overview]
Message-ID: <4FD862EE.6060409@canonical.com> (raw)
In-Reply-To: <s5h7gvctsdf.wl%tiwai@suse.de>
2012-06-12 18:19, Takashi Iwai skrev:
> At Mon, 11 Jun 2012 13:58:43 +0200,
> David Henningsson wrote:
>> On 06/08/2012 10:52 AM, Takashi Iwai wrote:
>>> At Thu, 7 Jun 2012 15:52:08 +0200,
>>> David Henningsson wrote:
>>>> PulseAudio sometimes have difficulties knowing that there is a
>>>> "Speaker" or "Internal Mic", if they have no individual volume
>>>> controls or selectors. As a result, only e g "Headphone" might
>>>> be created for a laptop, but no "Speaker".
>>>> To help out, create phantom jacks (that are always present,
>>>> at least for now) for "Speaker", "Internal Mic" etc, in case we
>>>> detect them.
>>>> The naming convention is e g "Speaker Phantom Jack".
>>>>
>>>> In order not to pollute the /dev/input namespace with even more
>>>> devices, these are added to the kcontrols only, not the input devices.
>>>>
>>>> An implementation note:
>>>> The possibility to override how to actually do jack sensing opens
>>>> up for more advanced usage of the jack infrastructure in the future
>>>> (e g letting the headphone jack detection set presence status for
>>>> both headphone and mic in case of a headset jack, among other things).
>>>>
>>>> Signed-off-by: David Henningsson<david.henningsson@canonical.com>
>>>> ---
>>>> sound/pci/hda/hda_jack.c | 64 ++++++++++++++++++++++++++++++++++------------
>>>> sound/pci/hda/hda_jack.h | 5 ++++
>>>> 2 files changed, 52 insertions(+), 17 deletions(-)
>>>>
>>>> diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
>>>> index 2dd1c11..c5569f1 100644
>>>> --- a/sound/pci/hda/hda_jack.c
>>>> +++ b/sound/pci/hda/hda_jack.c
>>>> @@ -133,6 +133,13 @@ static void jack_detect_update(struct hda_codec *codec,
>>>> }
>>>> }
>>>>
>>>> +static void jack_detect_always_present(struct hda_codec *codec,
>>>> + struct hda_jack_tbl *jack)
>>>> +{
>>>> + jack->pin_sense = AC_PINSENSE_PRESENCE;
>>>> + jack->jack_dirty = 0;
>>>> +}
>>>> +
>>>> /**
>>>> * snd_hda_set_dirty_all - Mark all the cached as dirty
>>>> *
>>>> @@ -162,7 +169,8 @@ u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
>>>> {
>>>> struct hda_jack_tbl *jack = snd_hda_jack_tbl_get(codec, nid);
>>>> if (jack) {
>>>> - jack_detect_update(codec, jack);
>>>> + if (jack->update_func)
>>>> + jack->update_func(codec, jack);
>>> IMO, it's easier to modify jack_detect_update().
>>> Instead of adding update_func pointer, add a new flag phantom_jack
>>> (can be a bit field), then in jack_detect_update():
>> The idea was to open up for other types of jack overrides as well, but
>> if you prefer to keep it simpler while we can, I'm okay with that.
>>
>> I'm attaching the modified patch.
> Thanks, this looks better to me.
> Is it OK to merge this to 3.6 tree?
Hmm, good question. I guess the answer is, it would be nice to have in
3.5 but not strictly necessary.
With the Ubuntu hat on, the autumn version of Ubuntu is more likely to
use 3.5 (but maybe 3.6, it has not yet been decided), and I'm going to
need this fix in there, but if necessary I can backport it into the
Ubuntu kernel.
With the PulseAudio hat on, as it helps us resolve a problem that hits
quite a few machines, it would be good to have it ASAP, but OTOH, since
we're currently discussing the PulseAudio release schedule, it's
difficult to tell whether we will actually have a PulseAudio version out
that uses these new phantom jacks anyway before Linux 3.6 is released.
(and with the kernel hat on, I have to admit it isn't strictly a
regression fix, and that the merge window is over...)
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
next prev parent reply other threads:[~2012-06-13 9:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 13:52 [PATCH] ALSA: HDA: Create phantom jacks for fixed inputs and outputs David Henningsson
2012-06-08 8:52 ` Takashi Iwai
2012-06-11 11:58 ` David Henningsson
2012-06-12 16:19 ` Takashi Iwai
2012-06-13 9:52 ` David Henningsson [this message]
2012-06-14 11:00 ` Takashi Iwai
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=4FD862EE.6060409@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--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 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.