alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Raymond Yau <superquad.vortex2@gmail.com>
To: Takashi Iwai <tiwai@suse.de>,
	ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: Re: snd jack report and unsolicited event ad1988
Date: Mon, 9 May 2011 11:56:11 +0800	[thread overview]
Message-ID: <BANLkTinNiWDMKVt8U-7o9GRvJG3KmC-osQ@mail.gmail.com> (raw)
In-Reply-To: <s5hsjstmq6i.wl%tiwai@suse.de>

2011/5/5 Takashi Iwai <tiwai@suse.de>

>> This mean that the driver need to define FRONT_MIC_EVENT, REAR_MIC_EVENT,
>> LINE_IN_EVENT in addition to HP_EVENT

>Does it mean that the codec can't accept the same id tag for multiple
>pins?

No, the event can be received by the event handler but there is no way to
know the event is related to which jack

>> Can  snd_jack_report used to report the mic event of two pink jacks
(front
>> panel and rear panel) of the desktop to the user space program?

> I assumed so, but someone needs to confirm.
> Assigning different tags is easy and safe, so even if it worked, we
> can go forward for individual tags.

So  the point is whether the user space program need to know

1) the event is related to the plug in or out of the front mic jack / rear
mic jack
2) whether earphone or speaker is plugged into correct/wrong jacks by
measured impedance .


 So, adding some delay like below makes it working?
>

       if (!codec->no_trigger_sense) {
>                pincap = snd_hda_query_pin_caps(codec, nid);
> -               if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
> +               if (pincap & AC_PINCAP_TRIG_REQ) { /* need trigger? */
>                        snd_hda_codec_read(codec, nid, 0,
>                                        AC_VERB_SET_PIN_SENSE, 0);
> +                       if (codec->trigger_delay > 0)
> +                               mdelay(codec->trigger_delay);
> +               }
>        }
>        return snd_hda_codec_read(codec, nid, 0,
>                                  AC_VERB_GET_PIN_SENSE, 0);
>

Noise appear  when delay is add at here

Have to wait until someone find a safe way to get the impedance without any
side effect


       spec->vmaster_nid = 0x04;
>
> -       codec->no_trigger_sense = 1;
> +       /* codec->no_trigger_sense = 1; */
> +       codec->trigger_delay = 5;
>        codec->no_sticky_stream = 1;
>
>        return 0;
>


So no need to change if the objective of snd_hda_jack_detect() is to get
presence detect bit

As mentioned in 729d55ba972348234759f8e40abf8d
e020f0d505

use tigger at pin-sensing seem generate a lot of responses

Is there any way to stop the measurement ?

  reply	other threads:[~2011-05-09  3:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05  7:05 snd jack report and unsolicited event ad1988 Raymond Yau
2011-05-05  9:50 ` Takashi Iwai
2011-05-09  3:56   ` Raymond Yau [this message]
2011-05-09 12:09     ` Takashi Iwai
2011-05-18  2:10       ` Raymond Yau

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=BANLkTinNiWDMKVt8U-7o9GRvJG3KmC-osQ@mail.gmail.com \
    --to=superquad.vortex2@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).