Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Hui Wang <hui.wang@canonical.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: hda/hdmi - Don't report Jack event if no need to do that
Date: Tue, 30 Apr 2019 09:35:03 +0200	[thread overview]
Message-ID: <s5hh8aghro8.wl-tiwai@suse.de> (raw)
In-Reply-To: <20190430065711.14977-1-hui.wang@canonical.com>

On Tue, 30 Apr 2019 08:57:11 +0200,
Hui Wang wrote:
> 
> On the machines with AMD GPU or Nvidia GPU, we often meet this issues:
> after s3, there are 4 HDMI/DP audio devices in the gnome-sound-setting
> even there is no any monitors plugged.
> 
> When this problem happens, we check the /proc/asound/cardX/eld#N.M, we
> will find the monitor_present=1, eld_valid=0.
> 
> The root cause is somehow the pin_sense reports the monitor is present
> and eld is valid when there is no monitor plugged.
> 
> The current driver will read the eld data if the pin_sense reports the
> eld is valid, because of no monitor is plugged, there is no valid eld
> data, then the eld->valid is set to 0.
> 
> If we don't let driver report Jack event when monitor_present=1 while
> eld_valid=0, there will be no this issue.
> 
> After this change, the driver only reports Jack event with one of the
> below 2 conditons:
>  eld->monitor_present=1 and eld->eld_valid=1 (a valid monitor detect)
>  eld->monitor_present=0 (a monitor is unplugged)
> 
> Signed-off-by: Hui Wang <hui.wang@canonical.com>

Well, if the eld_valid=1 is mandatory, basically we can use it as the
condition of jack=1, like the patch below.  The return value from
hdmi_present_sense() indicates only whether we may sync jack state or
not, and it's not about the jack state itself.


thanks,

Takashi

---
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1625,7 +1625,7 @@ static void sync_eld_via_acomp(struct hda_codec *codec,
 	if (jack == NULL)
 		goto unlock;
 	snd_jack_report(jack,
-			eld->monitor_present ? SND_JACK_AVOUT : 0);
+			(eld->monitor_present && eld->eld_valid) ? SND_JACK_AVOUT : 0);
  unlock:
 	mutex_unlock(&per_pin->lock);
 }

  reply	other threads:[~2019-04-30  7:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  6:57 [PATCH] ALSA: hda/hdmi - Don't report Jack event if no need to do that Hui Wang
2019-04-30  7:35 ` Takashi Iwai [this message]
2019-04-30  8:42   ` Hui Wang
2019-04-30  9:02     ` Takashi Iwai
2019-05-02  2:52       ` Hui Wang
2019-05-02 15:49         ` Takashi Iwai
2019-05-03  4:05           ` Hui Wang
2019-05-03 15:57             ` Takashi Iwai
2019-05-04  2:45               ` Hui Wang
2019-05-04  7:18                 ` Takashi Iwai
2019-05-04  9:25                   ` Hui Wang

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=s5hh8aghro8.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=hui.wang@canonical.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox