You are not logged in.

#1 2020-02-04 18:36:19

Alfred456654
Member
Registered: 2008-09-15
Posts: 15

[SOLVED] No more sound on HDMI audio output

EDIT: Solved by upgrading to linux-5.5.2, thanks!

____

Hi!

Since a few days ago (after upgrade to kernel 5.5 maybe? currently running 5.5.1), I no longer hear any sound on my TV, which is connected on the HDMI port of my nvidia gtx 980 ti (proprietary driver 440.59-1 running). I'm not sure what I'm doing wrong. I have looked through every forum post I could find, both here and on google, but nothing seems to fit. Any help is appreciated. Thanks in advance!

Here are the details:

I use pulseaudio and alsa.

pavucontrol displays the HDMI audio output as unplugged and unavailable:

2020-02-04-191628-3840x2160-scrot.png

I don't have any .asoundrc.

Here is my /etc/asound.conf:

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

Here is /etc/pulse/default.pa:

.fail
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
load-module module-augment-properties
load-module module-alsa-sink device=hw:0,3
load-module module-alsa-source device=hw:0,3
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
load-module module-detect
.endif
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
load-module module-dbus-protocol
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif
load-module module-default-device-restore
load-module module-rescue-streams
load-module module-always-sink
load-module module-intended-roles
load-module module-suspend-on-idle
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif
load-module module-position-event-sounds
load-module module-role-cork
load-module module-filter-heuristics
load-module module-filter-apply

pacmd list-cards

2 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_0d_00.3>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xf7f00000 irq 83"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:0d:00.3"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0d:00.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.string = "1"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		input:analog-stereo: Analog Stereo Input (priority 65, available: no)
		output:analog-stereo: Analog Stereo Output (priority 6500, available: no)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: no)
		output:analog-surround-21: Analog Surround 2.1 Output (priority 1300, available: no)
		output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (priority 1365, available: no)
		output:analog-surround-40: Analog Surround 4.0 Output (priority 1200, available: no)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 1265, available: no)
		output:analog-surround-41: Analog Surround 4.1 Output (priority 1300, available: no)
		output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (priority 1365, available: no)
		output:analog-surround-50: Analog Surround 5.0 Output (priority 1200, available: no)
		output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (priority 1265, available: no)
		output:analog-surround-51: Analog Surround 5.1 Output (priority 1300, available: no)
		output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (priority 1365, available: no)
		output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5565, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <output:iec958-stereo>
	sinks:
		alsa_output.pci-0000_0d_00.3.iec958-stereo/#1: Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)
	sources:
		alsa_output.pci-0000_0d_00.3.iec958-stereo.monitor/#1: Monitor of Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)
	ports:
		analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
			properties:
				
		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
			properties:
				
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				
    index: 1
	name: <alsa_card.pci-0000_0a_00.1>
	driver: <module-alsa-card.c>
	owner module: 26
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0xf7080000 irq 81"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:0a:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "0fb0"
		device.product.name = "GM200 High Definition Audio"
		device.string = "0"
		device.description = "GM200 High Definition Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)
		output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)
		output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)
		output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)
		output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: no)
		output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: no)
		output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (priority 5700, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (priority 600, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (priority 600, available: no)
		output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (priority 5700, available: no)
		output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (priority 600, available: no)
		output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (priority 600, available: no)
		off: Off (priority 0, available: unknown)
	active profile: <output:hdmi-stereo>
	ports:
		hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
				device.product.name = "SAMSUNG
     "
		hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-5: HDMI / DisplayPort 6 (priority 5400, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"
		hdmi-output-6: HDMI / DisplayPort 7 (priority 5300, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "video-display"

pacmd list-sinks

3 sink(s) available.
    index: 0
	name: <alsa_output.hw_0_3>
	driver: <module-alsa-sink.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9030
	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
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 0
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
	module: 4
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 0"
		alsa.id = "HDMI 0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0xf7080000 irq 81"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:0a:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "0fb0"
		device.product.name = "GM200 High Definition Audio"
		device.string = "hw:0,3"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.description = "GM200 High Definition Audio"
		device.icon_name = "audio-card-pci"
    index: 1
	name: <alsa_output.pci-0000_0d_00.3.iec958-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY 
	state: SUSPENDED
	suspend cause: IDLE
	priority: 9038
	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
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 0 KiB
	max rewind: 0 KiB
	monitor source: 1
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	fixed latency: 100.14 ms
	card: 0 <alsa_card.pci-0000_0d_00.3>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC892 Digital"
		alsa.id = "ALC892 Digital"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "1"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xf7f00000 irq 83"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:0d:00.3"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0d:00.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.string = "iec958:1"
		device.buffering.buffer_size = "17664"
		device.buffering.fragment_size = "2944"
		device.access_mode = "mmap"
		device.profile.name = "iec958-stereo"
		device.profile.description = "Digital Stereo (IEC958)"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)"
		alsa.mixer_name = "Realtek ALC892"
		alsa.components = "HDA:10ec0892,18497893,00100302"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				
	active port: <iec958-stereo-output>
  * index: 2
	name: <combined>
	driver: <module-combine-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: SUSPENDED
	suspend cause: IDLE
	priority: 1000
	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
	volume steps: 65537
	muted: no
	current latency: 0.00 ms
	max request: 17 KiB
	max rewind: 0 KiB
	monitor source: 2
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 0
	configured latency: 0.00 ms; range is 0.50 .. 200.00 ms
	module: 12
	properties:
		device.class = "filter"
		device.description = "Simultaneous output to GM200 High Definition Audio, Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)"
		device.icon_name = "audio-card"

pactl list sinks

Sink #0
	State: SUSPENDED
	Name: alsa_output.hw_0_3
	Description: GM200 High Definition Audio
	Driver: module-alsa-sink.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 4
	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: alsa_output.hw_0_3.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 0"
		alsa.id = "HDMI 0"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "3"
		alsa.card = "0"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0xf7080000 irq 81"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:0a:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "0fb0"
		device.product.name = "GM200 High Definition Audio"
		device.string = "hw:0,3"
		device.buffering.buffer_size = "352768"
		device.buffering.fragment_size = "176384"
		device.access_mode = "mmap+timer"
		device.description = "GM200 High Definition Audio"
		device.icon_name = "audio-card-pci"
	Formats:
		pcm

Sink #1
	State: SUSPENDED
	Name: alsa_output.pci-0000_0d_00.3.iec958-stereo
	Description: Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 7
	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: alsa_output.pci-0000_0d_00.3.iec958-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY SET_FORMATS 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC892 Digital"
		alsa.id = "ALC892 Digital"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "1"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xf7f00000 irq 83"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:0d:00.3"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:0d:00.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		device.product.id = "1457"
		device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
		device.string = "iec958:1"
		device.buffering.buffer_size = "17664"
		device.buffering.fragment_size = "2944"
		device.access_mode = "mmap"
		device.profile.name = "iec958-stereo"
		device.profile.description = "Digital Stereo (IEC958)"
		device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)"
		alsa.mixer_name = "Realtek ALC892"
		alsa.components = "HDA:10ec0892,18497893,00100302"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		iec958-stereo-output: Digital Output (S/PDIF) (priority: 0)
	Active Port: iec958-stereo-output
	Formats:
		pcm

Sink #2
	State: SUSPENDED
	Name: combined
	Description: Simultaneous output to GM200 High Definition Audio, Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)
	Driver: module-combine-sink.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 12
	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: combined.monitor
	Latency: 0 usec, configured 0 usec
	Flags: DECIBEL_VOLUME LATENCY 
	Properties:
		device.class = "filter"
		device.description = "Simultaneous output to GM200 High Definition Audio, Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)"
		device.icon_name = "audio-card"
	Formats:
		pcm

Here are a few tests I ran:

% aplay -D hw:0,3 /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1347: Channels count non available

% aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

Last edited by Alfred456654 (2020-02-09 11:33:34)

Offline

#2 2020-02-04 19:05:41

Archlin
Member
Registered: 2018-05-09
Posts: 8

Re: [SOLVED] No more sound on HDMI audio output

It is a kernel bug and there is a patch already

Fixes: 5398e94fb753 ("ALSA: hda - Add DP-MST support for NVIDIA codecs")
Signed-off-by: Nikhil Mahale <nmahale@nvidia.com>
---
 sound/pci/hda/patch_hdmi.c | 94 +++++++++++++++++++++++++++++++---------------
 1 file changed, 63 insertions(+), 31 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 48bddc218829..c1d3ce423142 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1550,6 +1550,34 @@ static bool update_eld(struct hda_codec *codec,
    return eld_changed;
 }
 
+static struct snd_jack *pin_idx_to_pcm_jack(struct hda_codec *codec,
+                   struct hdmi_spec_per_pin *per_pin)
+{
+   struct hdmi_spec *spec = codec->spec;
+   struct snd_jack *jack = NULL;
+   struct hda_jack_tbl *jack_tbl;
+
+   /* if !dyn_pcm_assign, get jack from hda_jack_tbl
+    * in !dyn_pcm_assign case, spec->pcm_rec[].jack is not
+    * NULL even after snd_hda_jack_tbl_clear() is called to
+    * free snd_jack. This may cause access invalid memory
+    * when calling snd_jack_report
+    */
+   if (per_pin->pcm_idx >= 0 && spec->dyn_pcm_assign) {
+      jack = spec->pcm_rec[per_pin->pcm_idx].jack;
+   } else if (!spec->dyn_pcm_assign) {
+      /*
+       * jack tbl doesn't support DP MST
+       * DP MST will use dyn_pcm_assign,
+       * so DP MST will never come here
+       */
+      jack_tbl = snd_hda_jack_tbl_get_mst(codec, per_pin->pin_nid,
+                      per_pin->dev_id);
+      if (jack_tbl)
+         jack = jack_tbl->jack;
+   }
+   return jack;
+}
 /* update ELD and jack state via HD-audio verbs */
 static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
                 int repoll)
@@ -1571,6 +1599,7 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
    int present;
    bool ret;
    bool do_repoll = false;
+   struct snd_jack *pcm_jack = NULL;
 
    present = snd_hda_jack_pin_sense(codec, pin_nid, dev_id);
 
@@ -1598,10 +1627,19 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
          do_repoll = true;
    }
 
-   if (do_repoll)
+   if (do_repoll) {
       schedule_delayed_work(&per_pin->work, msecs_to_jiffies(300));
-   else
+   } else {
+      /*
+       * pcm_idx >=0 before update_eld() means it is in monitor
+       * disconnected event. Jack must be fetched before
+       * update_eld().
+       */
+      pcm_jack = pin_idx_to_pcm_jack(codec, per_pin);
       update_eld(codec, per_pin, eld);
+      if (!pcm_jack)
+         pcm_jack = pin_idx_to_pcm_jack(codec, per_pin);
+   }
 
    ret = !repoll || !eld->monitor_present || eld->eld_valid;
 
@@ -1610,38 +1648,32 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
       jack->block_report = !ret;
       jack->pin_sense = (eld->monitor_present && eld->eld_valid) ?
          AC_PINSENSE_PRESENCE : 0;
-   }
-   mutex_unlock(&per_pin->lock);
-   return ret;
-}
 
-static struct snd_jack *pin_idx_to_jack(struct hda_codec *codec,
-             struct hdmi_spec_per_pin *per_pin)
-{
-   struct hdmi_spec *spec = codec->spec;
-   struct snd_jack *jack = NULL;
-   struct hda_jack_tbl *jack_tbl;
+      if (spec->dyn_pcm_assign && pcm_jack && !do_repoll) {
+         int state = 0;
+
+         if (!!(jack->pin_sense & AC_PINSENSE_PRESENCE))
+            state = SND_JACK_AVOUT;
+         snd_jack_report(pcm_jack, state);
+      }
 
-   /* if !dyn_pcm_assign, get jack from hda_jack_tbl
-    * in !dyn_pcm_assign case, spec->pcm_rec[].jack is not
-    * NULL even after snd_hda_jack_tbl_clear() is called to
-    * free snd_jack. This may cause access invalid memory
-    * when calling snd_jack_report
-    */
-   if (per_pin->pcm_idx >= 0 && spec->dyn_pcm_assign)
-      jack = spec->pcm_rec[per_pin->pcm_idx].jack;
-   else if (!spec->dyn_pcm_assign) {
       /*
-       * jack tbl doesn't support DP MST
-       * DP MST will use dyn_pcm_assign,
-       * so DP MST will never come here
+       * snd_hda_jack_pin_sense() call at the beginning of this
+       * function, updates jack->pins_sense and clears
+       * jack->jack_dirty, therefore snd_hda_jack_report_sync() will
+       * not override the jack->pin_sense.
+       *
+       * snd_hda_jack_report_sync() is superfluous for dyn_pcm_assign
+       * case. The jack->pin_sense update was already performed, and
+       * hda_jack->jack is NULL for dyn_pcm_assign.
+       *
+       * Don't call snd_hda_jack_report_sync() for
+       * dyn_pcm_assign.
        */
-      jack_tbl = snd_hda_jack_tbl_get_mst(codec, per_pin->pin_nid,
-                      per_pin->dev_id);
-      if (jack_tbl)
-         jack = jack_tbl->jack;
+      ret = ret && !spec->dyn_pcm_assign;
    }
-   return jack;
+   mutex_unlock(&per_pin->lock);
+   return ret;
 }
 
 /* update ELD and jack state via audio component */
@@ -1677,10 +1709,10 @@ static void sync_eld_via_acomp(struct hda_codec *codec,
    /* pcm_idx >=0 before update_eld() means it is in monitor
     * disconnected event. Jack must be fetched before update_eld()
     */
-   jack = pin_idx_to_jack(codec, per_pin);
+   jack = pin_idx_to_pcm_jack(codec, per_pin);
    changed = update_eld(codec, per_pin, eld);
    if (jack == NULL)
-      jack = pin_idx_to_jack(codec, per_pin);
+      jack = pin_idx_to_pcm_jack(codec, per_pin);
    if (changed && jack)
       snd_jack_report(jack,
             (eld->monitor_present && eld->eld_valid) ?

Last edited by Archlin (2020-02-04 19:50:26)

Offline

#3 2020-02-04 19:54:35

DEBuGRR
Member
From: CNY, USA
Registered: 2005-10-12
Posts: 2

Re: [SOLVED] No more sound on HDMI audio output

Patch is applied to 5.5.2 which is currently in the testing repo.

Just installed it from there, Sound Restored. -- this can probably be set to [Solved]

Last edited by DEBuGRR (2020-02-04 20:52:05)

Offline

#4 2020-02-05 00:37:48

corneelvm
Member
Registered: 2019-05-26
Posts: 3

Re: [SOLVED] No more sound on HDMI audio output

had the same problem,
updated to testing kernel
solved the problem for me.

Offline

Board footer

Powered by FluxBB