Repository navigation
[Bug] No SOF sound card for error 'ASoC: CODEC DAI intel-hdmi-hifi1 not registered' if NVidia audio probes earlier #1672
Description
Describe the bug
Test Device has a nvidia GFX card and so has another sound card for NVidia HDMI audio outputs. The Nvidia sound card is created by legacy HD-Audio driver. Both sof and nvidia hdmi use snd-hda-codec-hdmi.
-
Good scenario: If SOF driver is probed earlier, everything is fine. Both SOF and NVidia sound cards can be created successfully and work well. NVidia supports audio output from HDMI port, and SOF can support audio output from USB-C port via HDMI adapter.
-
Bad scenario: If we blacklist SOF driver, and so NVidia will probe first. The NV sound card can be created. And then we manually load SOF driver. No SOF sound card can be created for 'ASoC: CODEC DAI intel-hdmi-hifi1 not registered' (this issue)
It seems if NV card is initialized at first, Gen GFX status is different and can impact audio.
To Reproduce
- Blacklist sof_pci_dev in /etc/modprobe.d/blacklist.conf
- Do system reboot via "sudo reboot"
- sudo modprobe sof_pci_dev
Reproduce Rate
3/3
Actual result
No sof soundcard for 'ASoC: CODEC DAI intel-hdmi-hifi1 not registered'
Expected result
SOF soundcard should be registered.
Environment
Kernel: release/sof-v5.0 32c6c62
Firmware: cml-hda-dmic-002-drop-stable (0f7362835)
Kernel config: Run https://github.com/thesofproject/kconfig/blob/master/kconfig-sof-default.sh
Topology: Same with FW branch, sof-hda-generic-2ch.tplg
platform: CML-H Laptop with codec ALC3254 in HDA mode
UCM: https://github.com/thesofproject/alsa-ucm-conf/tree/sof_ucm1/
Dmesg
[ 754.980063] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[ 754.980068] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 754.980221] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 754.980604] sof-audio-pci 0000:00:1f.3: Linked as a consumer to 0000:00:02.0
[ 754.980637] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 754.989579] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[ 754.989580] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 754.999379] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[ 754.999381] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[ 755.136069] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:1:0-0f736
[ 755.136074] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:7:0 Kernel ABI 3:6:0
[ 755.136076] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than kernel
[ 755.136430] sof-audio-pci 0000:00:1f.3: firmware boot complete
[ 755.142836] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link iDisp1
[ 755.142838] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link iDisp2
[ 755.142840] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link iDisp3
[ 755.142842] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link Analog Playback and Capture
[ 755.142844] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link Digital Playback and Capture
[ 755.142846] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link dmic01
[ 755.142847] skl_hda_dsp_generic skl_hda_dsp_generic: info: override FE DAI link dmic16k
[ 755.142854] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: CODEC DAI intel-hdmi-hifi1 not registered
[ 782.203750] usb 1-2: new high-speed USB device number 5 using xhci_hcd
[ 782.353403] usb 1-2: New USB device found, idVendor=05e3, idProduct=0608, bcdDevice=85.36
[ 782.353409] usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 782.353412] usb 1-2: Product: USB2.0 Hub
[ 782.355246] hub 1-2:1.0: USB hub found
[ 782.355542] hub 1-2:1.0: 4 ports detected
modprobSOF_afterbootupwithSOFblacklist.txt
And also attach boot up log without blacklist sof.
bothNVand SOFHDMI_boot.txt
Activity
plbossart commentedon Jan 8, 2020
@kv2019i seems another example where we have to avoid the dependency on Intel integrated graphics?
[-][Bug] No sof soundcard for 'ASoC: CODEC DAI intel-hdmi-hifi1 not registered' after modprobe sof[/-][+][Bug] No SOF sound card for error 'ASoC: CODEC DAI intel-hdmi-hifi1 not registered' if NVidia audio probes earlier[/+]mengdonglin commentedon Jan 9, 2020
It seems NV driver is robust. Canonical confirmed that NV sound card can always be created and its audio functionality is good . In their stress reboot test, NV and SOF probe in parallel.
kv2019i commentedon Jan 9, 2020
@mengdonglin and @plbossart
It seems this is not really a problem with our i915 interaction, but rather our board files. The rootcause for this seems to be that we hardcode the codec name in all our board files, e.g. "ehdaudio0D2" in the DAILINK_COMP_ARRAY definition. If the NV driver is loaded first, our HDMI codec won't be "ehdaudio0D2" and probe will fail.UPDATE: this is not really it, hdac_ext hardcodes the bus->idx and NV doesn't go through the hdac_ext path, so this doesn't explain the problem. Debug continues.
I'll look into to how to fix this, but this unfortunately may need patching of a lot of board files.
kv2019i commentedon Jan 9, 2020
@ClarexZhou Can you get logs from failing case using following recipe to load the module:
as root, SOF not loaded
sudo modprobe snd_soc_core
sudo bash -c "echo -n 'module snd_soc_core +p' >/sys/kernel/debug/dynamic_debug/control"
sudo bash -c "echo '1' > /sys/kernel/debug/tracing/events/asoc/enable"
sudo bash -c "echo '1' > /sys/kernel/debug/tracing/events/snd_pcm/enable"
sudo modprobe snd_sof_pci
It seems the DAI prelink for HDMI is present before topology is loaded and this causes the error, but I can't yet pinpoint how this can happen. The extended logs should reveal better what is happening.
kv2019i commentedon Jan 9, 2020
@ClarexZhou Potential fix is here. Can you try verifying with this:
#1679
(if any issues, take the logs with above recipe with additional logs)
ClarexZhou commentedon Jan 10, 2020
Error not seen after verify PR#1679 on sof-v5.0, but there are many i915 issues for Nvidia HDMI. This isn't caused by PR. See log sof-v5.0_nvidiaHDMI.txt, obvious noise via Nvidia HDMI. SoF hdmi only update once opening sound setting / wakeup from suspend.
Error not seen after verify PR#1679 on sof-dev, but nvidia HDMI seems not loaded, display is also off. Though HDA Nvidia is listed in soundcard. see log sof_dev_notsupportNvidiaHDMI.txt
Original issue was actually reproduced with special x44 image which contains SOF from sof-v5.0.
@jason77-wang , could you share more Nvidia HDMI/i915 support details with x44 image? Or could provide new image with PR#1679?
kv2019i commentedon Jan 10, 2020
Thanks @ClarexZhou ! It seems the fix work, I'll submit a polished version.
Getting both displays to work correctly will require some extra configuration -- I have the same result with vanilla Ubuntu 18.04 and Intel+NV GPUs enabled at the same time -> only one display works ok. But this is beyond audio scope.
plbossart commentedon Jan 10, 2020
so what's the expectation for audio here? we would still enable audio w/ iDISP, but if it's not connected the paths are not to be used, i.e. we enable iDISP but rely on jack detection to enable those paths?
kv2019i commentedon Jan 10, 2020
@plbossart In short yes, if both GPUs are enabled and have audio codecs, we enable them both and based on jack status user can be given indication which PCMs are connected (via ELD you can also get the monitor type).
plbossart commentedon Jan 10, 2020
ok, so it's only the case where internal GPU is disabled that we need to do extra-work, yes?
kv2019i commentedon Jan 10, 2020
@plbossart
Yes, that case is still broken with the generic HDA driver and needs more work.