[SRU][B/OEM-B/C/D][PATCH 0/2] There are 4 HDMI/Displayport audio output listed in sound setting without attach any HDMI/DP monitor

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][B/OEM-B/C/D][PATCH 0/2] There are 4 HDMI/Displayport audio output listed in sound setting without attach any HDMI/DP monitor

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1827967

[Impact]
In our OEM projects, we often meet this issues, there is no any monitor plugged,
but in the gnome-sound-setting, there are 4 hdmi/dp audio devices.


[Fix]
We check the eld_valid when reporting the hdmi/dp jack event

[Test Case]
On the problematic machines, we do s3 test without plugging monitor, there
is no hdmi audio device in the sound-setting.
On the machines without this problem, we do s3 test, pluggin/unplugging
monitor test, the hdmi audio work well as before.

[Regression Risk]
Low. We have done many tests on machines with or without this problem,
there is no regression so far.



Hui Wang (2):
  ALSA: hda/hdmi - Read the pin sense from register when repolling
  ALSA: hda/hdmi - Consider eld_valid when reporting jack event

 sound/pci/hda/patch_hdmi.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][B/OEM-B/C/D][PATCH 1/2] ALSA: hda/hdmi - Read the pin sense from register when repolling

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1827967

The driver will check the monitor presence when resuming from suspend,
starting poll or interrupt triggers. In these 3 situations, the
jack_dirty will be set to 1 first, then the hda_jack.c reads the
pin_sense from register, after reading the register, the jack_dirty
will be set to 0. But hdmi_repoll_work() is enabled in these 3
situations, It will read the pin_sense a couple of times subsequently,
since the jack_dirty is 0 now, It does not read the register anymore,
instead it uses the shadow pin_sense which is read at the first time.

It is meaningless to check the shadow pin_sense a couple of times,
we need to read the register to check the real plugging state, so
we set the jack_dirty to 1 in the hdmi_repoll_work().

Signed-off-by: Hui Wang <[hidden email]>
Cc: <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/patch_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 76d82eebeef2..3503ffbaa2a2 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1661,6 +1661,11 @@ static void hdmi_repoll_eld(struct work_struct *work)
  container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
  struct hda_codec *codec = per_pin->codec;
  struct hdmi_spec *spec = codec->spec;
+ struct hda_jack_tbl *jack;
+
+ jack = snd_hda_jack_tbl_get(codec, per_pin->pin_nid);
+ if (jack)
+ jack->jack_dirty = 1;
 
  if (per_pin->repoll_count++ > 6)
  per_pin->repoll_count = 0;
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][B/OEM-B/C/D][PATCH 2/2] ALSA: hda/hdmi - Consider eld_valid when reporting jack event

Hui Wang
In reply to this post by Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1827967

On the machines with AMD GPU or Nvidia GPU, we often meet this issue:
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 BIOS or GPU driver makes the PRESENCE valid even no
monitor plugged, and of course the driver will not get the valid
eld_data subsequently.

In this situation, we should not report the jack_plugged event, to do
so, let us change the function hdmi_present_sense_via_verbs(). In this
function, it reads the pin_sense via snd_hda_pin_sense(), after
calling this function, the jack_dirty is 0, and before exiting
via_verbs(), we change the shadow pin_sense according to both
monitor_present and eld_valid, then in the snd_hda_jack_report_sync(),
since the jack_dirty is still 0, it will report jack event according
to this modified shadow pin_sense.

After this change, the driver will not report Jack_is_plugged event
through hdmi_present_sense_via_verbs() if monitor_present is 1 and
eld_valid is 0.

Signed-off-by: Hui Wang <[hidden email]>
Cc: <[hidden email]>
Signed-off-by: Takashi Iwai <[hidden email]>
(cherry picked from commit 7f641e26a6df9269cb25dd7a4b0a91d6586ed441
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/pci/hda/patch_hdmi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 3503ffbaa2a2..34d7085dfca8 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1549,9 +1549,11 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
  ret = !repoll || !eld->monitor_present || eld->eld_valid;
 
  jack = snd_hda_jack_tbl_get(codec, pin_nid);
- if (jack)
+ if (jack) {
  jack->block_report = !ret;
-
+ jack->pin_sense = (eld->monitor_present && eld->eld_valid) ?
+ AC_PINSENSE_PRESENCE : 0;
+ }
  mutex_unlock(&per_pin->lock);
  return ret;
 }
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][B/OEM-B/C/D][PATCH 0/2] There are 4 HDMI/Displayport audio output listed in sound setting without attach any HDMI/DP monitor

Kleber Souza
In reply to this post by Hui Wang
On 5/7/19 4:57 AM, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1827967
>
> [Impact]
> In our OEM projects, we often meet this issues, there is no any monitor plugged,
> but in the gnome-sound-setting, there are 4 hdmi/dp audio devices.
>
>
> [Fix]
> We check the eld_valid when reporting the hdmi/dp jack event
>
> [Test Case]
> On the problematic machines, we do s3 test without plugging monitor, there
> is no hdmi audio device in the sound-setting.
> On the machines without this problem, we do s3 test, pluggin/unplugging
> monitor test, the hdmi audio work well as before.
>
> [Regression Risk]
> Low. We have done many tests on machines with or without this problem,
> there is no regression so far.
>
>
>
> Hui Wang (2):
>   ALSA: hda/hdmi - Read the pin sense from register when repolling
>   ALSA: hda/hdmi - Consider eld_valid when reporting jack event
>
>  sound/pci/hda/patch_hdmi.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK / APPLIED[Unstable]: [SRU][B/OEM-B/C/D][PATCH 0/2] There are 4 HDMI/Displayport audio output listed in sound setting without attach any HDMI/DP monitor

Seth Forshee
In reply to this post by Hui Wang
On Tue, May 07, 2019 at 10:57:34AM +0800, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1827967
>
> [Impact]
> In our OEM projects, we often meet this issues, there is no any monitor plugged,
> but in the gnome-sound-setting, there are 4 hdmi/dp audio devices.
>
>
> [Fix]
> We check the eld_valid when reporting the hdmi/dp jack event
>
> [Test Case]
> On the problematic machines, we do s3 test without plugging monitor, there
> is no hdmi audio device in the sound-setting.
> On the machines without this problem, we do s3 test, pluggin/unplugging
> monitor test, the hdmi audio work well as before.
>
> [Regression Risk]
> Low. We have done many tests on machines with or without this problem,
> there is no regression so far.

Acked-by: Seth Forshee <[hidden email]>

Applied to unstable/master, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU][B/OEM-B/C/D][PATCH 0/2] There are 4 HDMI/Displayport audio output listed in sound setting without attach any HDMI/DP monitor

Kleber Souza
In reply to this post by Hui Wang
On 5/7/19 4:57 AM, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1827967
>
> [Impact]
> In our OEM projects, we often meet this issues, there is no any monitor plugged,
> but in the gnome-sound-setting, there are 4 hdmi/dp audio devices.
>
>
> [Fix]
> We check the eld_valid when reporting the hdmi/dp jack event
>
> [Test Case]
> On the problematic machines, we do s3 test without plugging monitor, there
> is no hdmi audio device in the sound-setting.
> On the machines without this problem, we do s3 test, pluggin/unplugging
> monitor test, the hdmi audio work well as before.
>
> [Regression Risk]
> Low. We have done many tests on machines with or without this problem,
> there is no regression so far.
>
>
>
> Hui Wang (2):
>   ALSA: hda/hdmi - Read the pin sense from register when repolling
>   ALSA: hda/hdmi - Consider eld_valid when reporting jack event
>
>  sound/pci/hda/patch_hdmi.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>

Applied to bionic, cosmic and disco/master-next branches.

Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team