thesofproject / linux

Linux kernel source tree
Other
91 stars 134 forks source link

SOF does not load in NUC10i7FNH computer #2330

Closed singalsu closed 4 years ago

singalsu commented 4 years ago

What happens is that I get no ALSA sound devices. There is only single line of sign of life from SOF in dmesg from sof-audio-pci module. By default an unmodified Ubuntu 20.04 booted with legacy sound driver where the built-in microphones and HDMI worked OK. The headphone connector playback audio remained totally silent.

According to /proc/cpuinfo this NuC has an i7-10710U CPU (CML). The kernel is fresh 5.8.0-rc6+, sof-dev b0739f66531ce62e279fb2c6eb047ecce7859d2a. I've based the kernel configuration to boot/config-5.4.0-42-generic and applied sof configuration with fresh git version of script kconfig-sof-default.sh. When looking at .config all relevant SND SOF options seem to be set.

I have blocklisted in /etc/modprobe.d modules snd-hda-intel, snd-soc-skl, and snd-sof-pci. When I modprobe snd-sof-pci I get to journalctl -f -k output:

heinä 30 12:03:13 vuohi kernel: sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380
heinä 30 12:03:13 vuohi kernel: acpi PRP00001:00: ACPI reports 4 SDW Link devices
heinä 30 12:03:13 vuohi kernel: acpi PRP00001:00: Link 0 not selected in firmware
heinä 30 12:03:13 vuohi kernel: acpi PRP00001:00: Link 1 not selected in firmware
heinä 30 12:03:13 vuohi kernel: acpi PRP00001:00: Link 2 not selected in firmware
heinä 30 12:03:13 vuohi kernel: acpi PRP00001:00: Link 3 not selected in firmware

I have dyndbg=+p options set for relevant kernel modules and this all output that I get. The following snd modules are loaded.

$ lsmod | grep snd
snd_sof_pci            24576  0
snd_sof_intel_hda_common    86016  1 snd_sof_pci
snd_soc_hdac_hda       24576  1 snd_sof_intel_hda_common
snd_sof_intel_hda      20480  1 snd_sof_intel_hda_common
snd_soc_acpi_intel_match    36864  2 snd_sof_pci,snd_sof_intel_hda_common
snd_sof               118784  2 snd_sof_pci,snd_sof_intel_hda_common
snd_sof_xtensa_dsp     16384  1 snd_sof_intel_hda_common
snd_soc_acpi           16384  2 snd_soc_acpi_intel_match,snd_sof_intel_hda_common
snd_hda_ext_core       24576  3 snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_intel_dspcfg       20480  2 snd_sof_pci,snd_sof_intel_hda_common
soundwire_intel        40960  2 snd_sof_intel_hda_common,snd_intel_dspcfg
snd_soc_core          237568  4 soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda
snd_hda_codec         126976  1 snd_soc_hdac_hda
snd_hwdep              16384  1 snd_hda_codec
snd_hda_core           86016  5 snd_hda_ext_core,snd_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_pcm               118784  6 snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_core,snd_hda_core
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  1 snd_seq_midi
snd_seq                81920  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              36864  2 snd_seq,snd_pcm
snd                    81920  8 snd_seq,snd_seq_device,snd_hwdep,snd_hda_codec,snd_timer,snd_soc_core,snd_pcm,snd_rawmidi
soundcore              16384  1 snd
ledtrig_audio          16384  1 snd_sof

Here's also lspci -vvv information about Audio device

00:1f.3 Audio device: Intel Corporation Device 02c8 (prog-if 80)
    Subsystem: Intel Corporation Device 2081
    Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 255
    Region 0: Memory at 6023110000 (64-bit, non-prefetchable) [disabled] [size=16K]
    Region 4: Memory at 6023000000 (64-bit, non-prefetchable) [disabled] [size=1M]
    Capabilities: [50] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [80] Vendor Specific Information: Len=14 <?>
    Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit+
        Address: 0000000000000000  Data: 0000
    Kernel modules: snd_hda_intel, snd_sof_pci
plbossart commented 4 years ago

@singalsu can you attach the full dmesg (dmesg -C before doing the modprobe snd-sof-pci) and alsa-info results?

singalsu commented 4 years ago

There's no other output to dmesg than what I already pasted above. So I attached the entire dmesg, no -C applied. Here's the files:

alsa-info.txt dmesg.txt

plbossart commented 4 years ago

I have a vague hunch the sof probe aborts because somehow the autoselect fails, likely because you don't have DMICs on the platform:

can you trying adding this diff (patch -p1 < 1.diff.txt) to the sof-dev kernel? 1.diff.txt

Also if you see the log 'aborting probe' can you try adding this to /etc/modprobe.d/alsa-base.conf options snd_intel_dspcfg dsp_driver=3

This comes from sound/hda/intel-dsp-config.c: MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF)");

singalsu commented 4 years ago

Wow, thanks! SOF loads now and headphone plug output works (it didn't with whatever got used with no SOF). The microphones work too, there's two microphones though the front panel contains four microphone port holes. The used topology is sof-hda-generic.tplg.

I had to use the dsp_driver=3 option, without I got the aborting probe message. Could that debug message be added to know what's the issue?

plbossart commented 4 years ago

Thanks @singalsu I'll add this debug message, indeed it's hard otherwise to figure out what happens.

That said, can you remove the snd-hda-intel blacklist and blacklist snd-sof-pci? You should have the headset plug working with the legacy driver, if not there's something very very odd in the codec management.

singalsu commented 4 years ago

Great!

I tried your suggestion but when I kept only snd-sof-pci blacklisted I got no sound devices.

Then I removed all blacklists, and edited "options snd_intel_dspcfg dsp_driver=1" and got working headphone sound with legacy driver. I don't know what was the issue with 5.4.0 binary kernel with Ubuntu but this 5.8.0-rc6+ kernel seems to be OK.

plbossart commented 4 years ago

@singalsu if you remove the "options snd_intel_dspcfg dsp_driver=1" and all blacklists you should still get the HDaudio legacy to load. Do you mind testing, wondering if the auto-selection is not working. Thanks!

singalsu commented 4 years ago

Yep, it works OK with the options line removed. The dmesg | grep snd output looks this:

[    3.931798] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380
[    3.931831] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[    4.089388] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.132066] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC256: line_outs=1 (0x21/0x0/0x0/0x0/0x0) type:hp
[    4.132068] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    4.132069] snd_hda_codec_realtek hdaudioC0D0:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    4.132070] snd_hda_codec_realtek hdaudioC0D0:    mono: mono_out=0x0
[    4.132071] snd_hda_codec_realtek hdaudioC0D0:    inputs:
[    4.132072] snd_hda_codec_realtek hdaudioC0D0:      Internal Mic=0x13
[    4.132073] snd_hda_codec_realtek hdaudioC0D0:      Internal Mic=0x12
plbossart commented 4 years ago

Thanks Seppo, I added a log in PR #2335