alsa/hdmi: support nvidia mst hdmi/dp audio

Bug #1867704 reported by Hui Wang
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Critical
Hui Wang
Bionic
Won't Fix
Undecided
Unassigned
Focal
Fix Released
High
Hui Wang
linux-oem (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

This is the justification for focal:

This patchset will introduce a big change on hda_jack and hda_hdmi,
So I sent the patcheset to oem-b 4 months ago. After 4 months of running
oem-b kernel, there is no any regression reported on this patchset,
now I am backporting the patchset to our focal kernel since our oem
project is waiting for the patchset to be landed to ubuntu 5.4 kernel
ASAP.

This patchset are already merged to mainline kernel 5.5-rc and 5.6-rc,
so there is no need to send the patchset to oem-5.6 or groovy kernel.

[Impact]
On some LENOVO I+N machines, when setting the graphic mode to discrete,
The dp/hdmi audio on the Docking Gen2 can't work with this machine +
LENOVO Docking Gen2, users can't find the hdmi audio entry in the
gnome-sound-setting.

[Fix]
Nvidia developer submit the mst audio support to 5.5-rcN and 5.6-RC1,
those patches could fix this issue.

[Test Case]
set the machien to discrete, plug the dock gen2 to it, then boot, after
booting, plug hdmi or dp to dock gen2, the hdmi or dp audio works.

test other machines without Nvidia graphic or without gen2, their hdmi/dp
audio still work, and check other output/input devices like headphone,
microphone, they all worked as well as before.

[Regression Risk]
one regression possibility is the audio jacks (including analogue and hdmi)
can't work anymore, that means after users plug a headphone, headset, hdmi
monitor or microphone to the audio jacks or hdmi connectors, the audio
driver can't detect the plugging event.

But regression's possibility is very low:
 - this patchset was already applied to oem-b kernel for 4 months, and
   oem projects didn't report any regression on the patchset
 - I tested the testing focal kernel with this patchset on many machines,
   includes a dell hda audio machine, a dell dmic machine, a Lenovo I+N
   hda audio machine, a lenovo I+N dmic machine, a lenovo I hda audio
   machine, a lenovo amd hda audio machine. The audio on them all worked
   as well as before.

This is the justification for oem-b

Drop the B, so far only need to merge this patchset to OEM-B first, After the patchset is widely verified with oem-b kernel, I send the patchset to B and F then.

This patchset will add support of mst audio for nvidia hdmi/dp, this
patchset changes lots of common code on hda_jack and hdmi codec, so it
is not easy to say it is 100% safe for other machines, but our oem
project needs this patchset to be backported to ubuntu kernel, because
the tight sechdule of oem project, we backport this patchset to B and
OEM-B first, if the hdmi audio works well for a period of time after
this patchset is merged, I will backport this patchset to focal, maybe
eoan as well.

[Impact]
On some LENOVO I+N machines, when setting the graphic mode to discrete,
The dp/hdmi audio on the Docking Gen2 can't work with this machine +
LENOVO Docking Gen2

[Fix]
Nvidia developer submit the mst audio support to 5.5-rcN and 5.6-RC1,
those patches could fix this issue.

[Test Case]
set the machien to discrete, plug the dock gen2 to it, then boot, after
booting, plug hdmi or dp to dock gen2, the hdmi or dp audio works.

test other machines without Nvidia graphic or without gen2, their hdmi/dp
audio still work.

[Regression Risk]
Low, those patches come from mainline kernel, I have tested those patches
on the machiens with or without nvidia hdmi, and on the machines with or without
docks, all worked well as before.

CVE References

Hui Wang (hui.wang)
Changed in linux (Ubuntu):
importance: Undecided → Critical
tags: added: originate-from-1857514 sutton
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1867704

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Hui Wang (hui.wang)
description: updated
Revision history for this message
Anthony Wong (anthonywong) wrote :

Does Focal have this issue?

Revision history for this message
Hui Wang (hui.wang) wrote :

It has, the bug description already stated it.

Hui Wang (hui.wang)
Changed in linux (Ubuntu Bionic):
status: New → Won't Fix
Changed in linux (Ubuntu):
status: Incomplete → Won't Fix
status: Won't Fix → Incomplete
description: updated
AceLan Kao (acelankao)
Changed in linux-oem (Ubuntu Bionic):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-oem - 4.15.0-1079.89

---------------
linux-oem (4.15.0-1079.89) bionic; urgency=medium

  * bionic/linux-oem: 4.15.0-1079.89 -proposed tracker (LP: #1869302)

  [ Ubuntu: 4.15.0-94.95 ]

  * bionic/linux: 4.15.0-94.95 -proposed tracker (LP: #1868984)
  * Missing wireless network interface after kernel 5.3.0-43 upgrade with eoan
    (LP: #1868442)
    - iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices

 -- Chia-Lin Kao (AceLan) <email address hidden> Fri, 27 Mar 2020 13:08:19 +0800

Changed in linux-oem (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-oem (Ubuntu):
status: New → Confirmed
Hui Wang (hui.wang)
Changed in linux-oem (Ubuntu Focal):
status: Confirmed → Invalid
no longer affects: linux-oem (Ubuntu Focal)
Changed in linux (Ubuntu Focal):
importance: Critical → High
status: Incomplete → Triaged
Changed in linux-oem (Ubuntu):
status: Confirmed → Fix Released
Changed in linux (Ubuntu):
status: Incomplete → Fix Released
Hui Wang (hui.wang)
description: updated
description: updated
Hui Wang (hui.wang)
tags: added: originate-from-1889530
Changed in linux (Ubuntu Focal):
status: Triaged → Fix Committed
Rex Tsai (chihchun)
tags: added: oem-priority timbuktu
tags: added: originate-from-1889531
no longer affects: oem-priority
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Shengyao Xue (xueshengyao) wrote :

Tesed the kernel 5.4.0-46.50 in focal-proposed on a ThinkPad P73, this issue was fixed.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (42.6 KiB)

This bug was fixed in the package linux - 5.4.0-48.52

---------------
linux (5.4.0-48.52) focal; urgency=medium

  * focal/linux: 5.4.0-48.52 -proposed tracker (LP: #1894654)

  * mm/slub kernel oops on focal kernel 5.4.0-45 (LP: #1895109)
    - SAUCE: Revert "mm/slub: fix a memory leak in sysfs_slab_add()"

  * Packaging resync (LP: #1786013)
    - update dkms package versions
    - update dkms package versions

  * Introduce the new NVIDIA 450-server and the 450 UDA series (LP: #1887674)
    - [packaging] add signed modules for nvidia 450 and 450-server

  * [UBUNTU 20.04] zPCI attach/detach issues with PF/VF linking support
    (LP: #1892849)
    - s390/pci: fix zpci_bus_link_virtfn()
    - s390/pci: re-introduce zpci_remove_device()
    - s390/pci: fix PF/VF linking on hot plug

  * [UBUNTU 20.04] kernel: s390/cpum_cf,perf: changeDFLT_CCERROR counter name
    (LP: #1891454)
    - s390/cpum_cf, perf: change DFLT_CCERROR counter name

  * [UBUNTU 20.04] zPCI: Enabling of a reserved PCI function regression
    introduced by multi-function support (LP: #1891437)
    - s390/pci: fix enabling a reserved PCI function

  * CVE-2020-12888
    - vfio/type1: Support faulting PFNMAP vmas
    - vfio-pci: Fault mmaps to enable vma tracking
    - vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

  * [Hyper-V] VSS and File Copy daemons intermittently fails to start
    (LP: #1891224)
    - [Packaging] Bind hv_vss_daemon startup to hv_vss device
    - [Packaging] bind hv_fcopy_daemon startup to hv_fcopy device

  * alsa/hdmi: support nvidia mst hdmi/dp audio (LP: #1867704)
    - ALSA: hda - Rename snd_hda_pin_sense to snd_hda_jack_pin_sense
    - ALSA: hda - Add DP-MST jack support
    - ALSA: hda - Add DP-MST support for non-acomp codecs
    - ALSA: hda - Add DP-MST support for NVIDIA codecs
    - ALSA: hda: hdmi - fix regression in connect list handling
    - ALSA: hda: hdmi - fix kernel oops caused by invalid PCM idx
    - ALSA: hda: hdmi - preserve non-MST PCM routing for Intel platforms
    - ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms
    - ALSA: hda - Fix DP-MST support for NVIDIA codecs

  * Focal update: v5.4.60 upstream stable release (LP: #1892899)
    - smb3: warn on confusing error scenario with sec=krb5
    - genirq/affinity: Make affinity setting if activated opt-in
    - genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq()
    - PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()
    - PCI: Add device even if driver attach failed
    - PCI: qcom: Define some PARF params needed for ipq8064 SoC
    - PCI: qcom: Add support for tx term offset for rev 2.1.0
    - btrfs: allow use of global block reserve for balance item deletion
    - btrfs: free anon block device right after subvolume deletion
    - btrfs: don't allocate anonymous block device for user invisible roots
    - btrfs: ref-verify: fix memory leak in add_block_entry
    - btrfs: stop incremening log_batch for the log root tree when syncing log
    - btrfs: remove no longer needed use of log_writers for the log root tree
    - btrfs: don't traverse into the seed devices in show_devname
    - btrfs: open device...

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Hui Wang (hui.wang)
Changed in hwe-next:
status: New → Fix Released
Revision history for this message
Norbert (asterix52) wrote :

Hello!
We have the problem with linux-5.4.0-48 that the hdmi port (alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1) not activ is after boot. linux-5.4.0-47 works fine. We use pulse audio. Ubuntu 20.04

linux-5.4.0-48
Active Profile: off

linux-5.4.0-47
Active Profile: output:hdmi-stereo-extra1

Is it possible that this patch the reason is?

Revision history for this message
Hui Wang (hui.wang) wrote :

@asterix52,

(pci-0000_01_00.1) means this is a discrete Nvidia or AMD hdmi audio controller, did you install the Nvidia or AMD graphic driver under 5.4.0-48?.

Please upload the log of pa-info with hdmi/dp monitor plugged.

thx.

Revision history for this message
Norbert (asterix52) wrote :
Revision history for this message
Norbert (asterix52) wrote :

It is a nvidia GT1030 graphics card. We use the nvidia driver 440 and 450.

Revision history for this message
Norbert (asterix52) wrote :

Log with linux-5.4.0-47

Revision history for this message
Norbert (asterix52) wrote :

As i run pa-info at linux-5.4.0-48 the sound switched on.

norbert@vdr:~$ pa-info > log
Invalid card number.
Invalid card number.
alsactl: save_state:1595: No soundcards found...
cat: /tmp/alsa-info.pPgZrJ4h4x/alsactl.tmp: No such file or directory

Revision history for this message
Hui Wang (hui.wang) wrote :

@Norbert,

According to the painfo_linux47.txt in the #14, the active profile is still off with 47 kernel:

Default Sink: auto_null

Sink #0
 State: SUSPENDED
 Name: auto_null
 Description: Dummy-Ausgabe
 Driver: module-null-sink.c
 Sample Specification: s16le 2ch 44100Hz
 Channel Map: front-left,front-right
 Owner Module: 10
 Mute: no
 Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
         balance 0.00
 Base Volume: 65536 / 100% / 0.00 dB
 Monitor Source: auto_null.monitor
 Latency: 0 usec, configured 0 usec
 Flags: DECIBEL_VOLUME LATENCY SET_FORMATS
 Properties:
  device.description = "Dummy-Ausgabe"
  device.class = "abstract"
  device.icon_name = "audio-card"
 Formats:
  pcm

Revision history for this message
Norbert (asterix52) wrote :

I did a lot of testing with linux 5.4.0-48: When the HDMI-TV is off at boot. The default sink isn't listed. But you can switch the output profile for the sink.

Revision history for this message
Hui Wang (hui.wang) wrote :

For your testing, what is the difference between -47 and -48?

Revision history for this message
Norbert (asterix52) wrote :
Download full text (7.0 KiB)

I found a error message with kernel 5.4.0-48:

Boot with TV off
switch tv on -> no Sound

#pacmd list-cards
No PulseAudio daemon running, or not running as session daemon.

#aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: PCH [HDA Intel PCH], Gerät 0: ALC892 Analog [ALC892 Analog]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 0: PCH [HDA Intel PCH], Gerät 1: ALC892 Digital [ALC892 Digital]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 1 [HDMI 1]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 2 [HDMI 2]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 3 [HDMI 3]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 10: HDMI 4 [HDMI 4]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

****Sound turns on****

#pacmd list-cards
2 card(s) available.
    index: 0
 name: <alsa_card.pci-0000_01_00.1>
 driver: <module-alsa-card.c>
 owner module: 7
 properties:
  alsa.card = "1"
  alsa.card_name = "HDA NVidia"
  alsa.long_card_name = "HDA NVidia at 0xf7080000 irq 17"
  alsa.driver_name = "snd_hda_intel"
  device.bus_path = "pci-0000:01:00.1"
  sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"
  device.bus = "pci"
  device.vendor.id = "10de"
  device.vendor.name = "NVIDIA Corporation"
  device.product.id = "0fb8"
  device.product.name = "GP108 High Definition Audio Controller"
  device.string = "1"
  device.description = "GP108 High Definition Audio Controller"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-card-pci"
 profiles:
  output:hdmi-stereo: Digital Stereo (HDMI)-Ausgabe (priority 5900, available: no)
  output:hdmi-surround: Digital Surround 5.1 (HDMI)-Ausgabe (priority 800, available: no)
  output:hdmi-surround71: Digital Surround 7.1 (HDMI)-Ausgabe (priority 800, available: no)
  output:hdmi-stereo-extra2: Digital Stereo (HDMI 3)-Ausgabe (priority 5700, available: no)
  output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3)-Ausgabe (priority 600, available: no)
  output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3)-Ausgabe (priority 600, available: no)
  output:hdmi-stereo-extra3: Digital Stereo (HDMI 4)-Ausgabe (priority 5700, available: no)
  output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4)-Ausgabe (priority 600, available: no)
  output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4)-Ausgabe (priority 600, available: no)
  output:hdmi-stereo-extra4: Digital Stereo (HDMI 5)-Ausgabe (priority 5700, available: no)
  output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5)-Ausgabe (priority 600, available: no)
  output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5)-Ausgabe (priority 600, available: no)
  off: Aus (priority 0, available: unknown)
 active profile: <off>
 ports:
  hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "video-display"
  hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 us...

Read more...

Revision history for this message
Norbert (asterix52) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.