linux >= 6.7.x breaks NVidia HDMI audio
Hello,
I have already opened a bug report at bugzilla.kernel.org and was redirected here. In nutshell: The update from linux kernel 6.6.10 to 6.7 breaks my sound (over HDMI) on a computer with a GK208B [GeForce GT 710]. I could finally bisect the problem to the end. In order to be able to compile intermediate commits, I needed to cherry-pick
The result of the bisection was:
6c6abab20b99169f5fb11a8619012225ecd02f1e is the first bad commit
commit 6c6abab20b99169f5fb11a8619012225ecd02f1e
Author: Ben Skeggs <bskeggs@redhat.com>
Date: Tue Sep 19 17:56:14 2023 -0400
drm/nouveau/disp: add output hdmi config method
- was previously part of acquire()
- preparation for GSP-RM
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Danilo Krummrich <me@dakr.org>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-20-lyude@redhat.com
The mentioned commit changes the logic of nv50_hdmi_enable() in drivers/gpu/drm/nouveau/dispnv50/disp.c
Before a local variable u8 scdc = 0; was created in the function, filled and later nvif_outp_acquire_tmds() was called (where scdc was passed). The new logic creates also u8 scdc; locally, but does not pass it to nvif_outp_hdmi() - the function that replaced the call to nvif_outp_acquire_tmds(). Instead it passes a bool variable hdmi->scdc.supported
These values are later used in uoutp.c in the function nvkm_uoutp_mthd_hdmi(), respectively nvkm_uoutp_mthd_acquire_tmds() (before the last commit). Here is a debug output of the last good commit (c0f7b729) at the beginning of nvkm_uoutp_mthd_acquire_tmds():
outp=000000007ea185c3, head=0, hdmi=1, hdmi_max_ac_packet=7, hdmi_rekey=56, hdmi_scdc=0, hdmi_hda=1
and here the output after the bad commit (6c6abab2) of nvkm_uoutp_mthd_hdmi():
args->v0.head=0, args->v0.enable=1, args->v0.max_ac_packet=7, args->v0.rekey=56, args->v0.scdc=1, args->v0.scdc_scrambling=1, args->v0.scdc_low_rates=0, args->v0.khz=297000
You see hdmi_scdc was 0 before and is now replaced with bool args->v0.scdc, which is 1 on the affected machine. I updated disp.c to use the old logic before (create a local _u8 and use this in nvif_outp_hdmi) that fixes the problem for me and attach the patch here: fix_v6.12.patch
It can be applied to kernel tag v6.12 (adc21867) and results in working sound for me - tested alto with v6.7.
The different value of scdc results in the (for me) broken commit. With it we take in the nvkm_uoutp_mthd_hdmi() function the branch:
if (args->v0.scdc && !ior->func->hdmi->scdc)
and
return -EINVAL;
In the former function, nvkm_uoutp_mthd_acquire_tmds(), we did not enter this branch and returned 0.
Maybe the problem can be generally fixed upsteram? Thank you very much and many greetings Mathias