fixed "HDMI ATI/AMD: no speaker allocation for ELD" on Radeon module

Bug #1993217 reported by Paul Dufresne
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This is on my friend laptop with his TV.
HDMI audio not available in pavucontrol (profile say unplugged, unavailable) in kernel versions with bugs.
It is just shown as an audio output (HDMI audio) on kernels where it is working.
When not working, I can play with aplay -D HDMI ...
When working... I select HDMI audio in output, and test sound ok, Youtube videos ok, etc.

4.9.177 working.
4.9.178 not working.

I suspect commit 72cf0b07418a9c8349aa9137194b1ccba6e54a9d because it is between those versions, and is related to audio (realtek in part).

More info at:
https://forums.linuxmint.com/viewtopic.php?f=49&t=383607&p=2246352#p2246352
although the laptop now runs ... 17.10 I think (a version with a not broken kernel).
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: client 1023 F.... pulseaudio
 /dev/snd/pcmC0D0p: client 1023 F...m pulseaudio
 /dev/snd/controlC1: client 1023 F.... pulseaudio
CasperMD5json: {
DistroRelease: Linux Mint 21
InstallationDate: Installed on 2022-10-18 (0 days ago)
InstallationMedia: Linux Mint 21 "Vanessa" - Release amd64 20220726
MachineType: SAMSUNG ELECTRONICS CO., LTD. R425D/R525D
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
Package: linux (not installed)
ProcEnviron:
 LANGUAGE=fr_CA:fr
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=fr_CA.UTF-8
 SHELL=/bin/bash
ProcFB: 0 radeondrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.15.0-50-generic root=UUID=2db14083-ebb6-4a5a-b0b1-4a65e79069d7 ro quiet splash
ProcVersionSignature: Ubuntu 5.15.0-50.56-generic 5.15.60
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
 linux-restricted-modules-5.15.0-50-generic N/A
 linux-backports-modules-5.15.0-50-generic N/A
 linux-firmware 20220329.git681281e4-0ubuntu3.5
Tags: vanessa apport-hook-error
Uname: Linux 5.15.0-50-generic x86_64
UnreportableReason: Ce rapport concerne un paquet qui n'est pas installé.
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: N/A
_MarkForUpload: False
dmi.bios.date: 10/16/2010
dmi.bios.release: 2.0
dmi.bios.vendor: Phoenix Technologies Ltd.
dmi.bios.version: 02UF
dmi.board.name: R425D/R525D
dmi.board.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.board.version: Not Applicable
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLtd.:bvr02UF:bd10/16/2010:br2.0:svnSAMSUNGELECTRONICSCO.,LTD.:pnR425D/R525D:pvrNotApplicable:rvnSAMSUNGELECTRONICSCO.,LTD.:rnR425D/R525D:rvrNotApplicable:cvnSAMSUNGELECTRONICSCO.,LTD.:ct10:cvrN/A:sku:
dmi.product.name: R425D/R525D
dmi.product.version: Not Applicable
dmi.sys.vendor: SAMSUNG ELECTRONICS CO., LTD.

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 1993217

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
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote : Re: HDMI audio not available RS880 between 4.9.177 and 4.9.178

4.9 is quite old. Please try mainline kernel v6.0.

Revision history for this message
Paul Dufresne (dufresnep) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected apport-hook-error vanessa
description: updated
Revision history for this message
Paul Dufresne (dufresnep) wrote : CRDA.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : HookError_ubuntu.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : IwConfig.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : Lspci.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : Lspci-vt.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : Lsusb.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : Lsusb-t.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : Lsusb-v.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : PaInfo.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : ProcModules.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : RfKill.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : UdevDb.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : WifiSyslog.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : acpidump.txt

apport information

Revision history for this message
Paul Dufresne (dufresnep) wrote : Re: HDMI audio not available RS880 between 4.9.177 and 4.9.178

bug present in vmlinuz-5.15.0-50
I admit I did not try 6.x kernels.

Searching in 4.9, because doing a git-bisect to find the offending commit in that version.

Revision history for this message
Paul Dufresne (dufresnep) wrote :
Revision history for this message
Paul Dufresne (dufresnep) wrote :

paul@rabachi:~/colinKernels/new4.9.180/my4.9.180$ git bisect log
git bisect start
# bad: [a5f56b52c878585b12b8bc37f737dcce4a660c64] Linux 4.9.178
git bisect bad a5f56b52c878585b12b8bc37f737dcce4a660c64
# good: [8baec4ebdf084961516f17cadbad14cac082ee4e] Linux 4.9.177
git bisect good 8baec4ebdf084961516f17cadbad14cac082ee4e
# bad: [fef85fb00224cb22f9efec262e9ffe8970e555ee] mm/mincore.c: make mincore() more conservative
git bisect bad fef85fb00224cb22f9efec262e9ffe8970e555ee
# good: [45fe6deee2f2b8889368c5fa5ac832b571c6ea52] sched/x86: Save [ER]FLAGS on context switch
git bisect good 45fe6deee2f2b8889368c5fa5ac832b571c6ea52

Compiling
commit f934bf3f57769282c371c978eb9bbe3930f6ed35 (HEAD)
Author: Wenwen Wang <email address hidden>
Date: Sat Apr 27 01:06:46 2019 -0500

    ALSA: usb-audio: Fix a memory leak bug

    commit cb5173594d50c72b7bfa14113dfc5084b4d2f726 upstream.

    In parse_audio_selector_unit(), the string array 'namelist' is allocated
    through kmalloc_array(), and each string pointer in this array, i.e.,
    'namelist[]', is allocated through kmalloc() in the following for loop.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

The commit isn't related to HDMI audio though...

Can you please try
$ git checkout f934bf3f57769282c371c978eb9bbe3930f6ed35 # then compile and test

$ git checkout f934bf3f57769282c371c978eb9bbe3930f6ed35^ # then compile and test

So we are sure it's the offending commit?

Revision history for this message
Paul Dufresne (dufresnep) wrote :

Sorry I did not meant f934bf3f57769282c371c978eb9bbe3930f6ed35 was the offending commit.

This is just where I am at testing with git bisect.

There should need about 3 others steps to find the offending commit.

Revision history for this message
Paul Dufresne (dufresnep) wrote :

Found the offending commit:
Did not verify this, but I suspect this is the case:
    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.

paul@rabachi:~/colinKernels/new4.9.180/my4.9.180$ LANG=en git bisect replay bisect.log
Already on 'master'
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)
72cd3810e52c606595f9e1a2d442a4cc6e6a3551 is the first bad commit
commit 72cd3810e52c606595f9e1a2d442a4cc6e6a3551
Author: Hui Wang <email address hidden>
Date: Mon May 6 22:09:32 2019 +0800

    ALSA: hda/hdmi - Consider eld_valid when reporting jack event

    commit 7f641e26a6df9269cb25dd7a4b0a91d6586ed441 upstream.

    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 <email address hidden>
    Cc: <email address hidden>
    Signed-off-by: Takashi Iwai <email address hidden>
    Signed-off-by: Greg Kroah-Hartman <email address hidden>

:040000 040000 0280e65d8aca2561b6ed8ee27383d1cd0e3cc022 ebe57ab9f50fdb2851d074f5d2c95f5e74beb541 M sound
paul@rabachi:~/colinKernels/new4.9.180/my4.9.180$

Revision history for this message
Paul Dufresne (dufresnep) wrote :

I believe this is the situation discussed in:
https://gitlab.freedesktop.org/drm/amd/-/issues/1569

Also, I tested master head this morning (showing 6.0.0-rc6, and it was broken.

I had tried a reverse of this commit and previous one, but it was broken too (I probably did not made the right choices when seeing conflicts).

summary: - HDMI audio not available RS880 between 4.9.177 and 4.9.178
+ old commit make HDMI audio not available if not eld_valid
Revision history for this message
Paul Dufresne (dufresnep) wrote : Re: old commit make HDMI audio not available if not eld_valid
Revision history for this message
Paul Dufresne (dufresnep) wrote :
Revision history for this message
Paul Dufresne (dufresnep) wrote :

briefly tested (work) patch that manually reversed commit 72cd3810e52c606595f9e1a2d442a4cc6e6a3551 applied on HEAD of master on git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack

Revision history for this message
Paul Dufresne (dufresnep) wrote :

It would be good to verify if after applying the patch, the old bug that it was fixing come back (that after resuming from sleep, on some hardware, shows 4 (many) entries in preferences/sound/hardware [either because of a bug in TV BIOS or in GPU code]. I did not took time to test that.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

So yes, it's a GFX driver bug. The GFX driver should always report correct eld_valid so HDA driver can rely on it.

tags: added: patch
Revision history for this message
Paul Dufresne (dufresnep) wrote :
Revision history for this message
Paul Dufresne (dufresnep) wrote :

v.4. of the patch https://gitlab.freedesktop.org/drm/amd/ ... t-v4.patch published yesterday, have been accepted by the radeon maintainer: https://lore.kernel.org/all/CADnq5_N-4t ... gmail.com/ I tested it yesterday on top of 6.0.1-rc2 kernel and it was working fine.

Revision history for this message
Paul Dufresne (dufresnep) wrote :
Revision history for this message
Paul Dufresne (dufresnep) wrote :

The previously accepted patch have received itself a new patch that use a more fine grained mutex.

summary: - old commit make HDMI audio not available if not eld_valid
+ fixed "HDMI ATI/AMD: no speaker allocation for ELD" on Radeon module
Revision history for this message
Uriel Tunn (u2n) wrote :

@Paul_Dufresne, many thanks for driving the fix to this longstanding bug. It's been present for over three years and likely affects millions of users.

Following your work here: https://gitlab.freedesktop.org/drm/amd/-/issues/1569#note_1601169, it appears there's finally going to be a real, permanent correction upstream. Dancing in the streets is unlikely, but a vast number of users will get happy their HDMI audio works again, largely thanks to your efforts.

This should stand as an example of how even a single contributor who is dedicated to the task can make a huge difference.

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.