All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/hdmi - Don't report Jack event if no need to do that
@ 2019-04-30  6:57 Hui Wang
  2019-04-30  7:35 ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Hui Wang @ 2019-04-30  6:57 UTC (permalink / raw)
  To: alsa-devel, tiwai

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>
---
 sound/pci/hda/patch_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 8b3ac690efa3..e5a34fa6f358 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1548,7 +1548,7 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
 	else
 		update_eld(codec, per_pin, eld);
 
-	ret = !repoll || !eld->monitor_present || eld->eld_valid;
+	ret = !eld->monitor_present || eld->eld_valid;
 
 	jack = snd_hda_jack_tbl_get(codec, pin_nid);
 	if (jack)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-05-04  9:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.