Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failed to use SOF on HP zbook 15 G6 #1985

Closed
elorriaux opened this issue Mar 24, 2020 · 112 comments
Closed

[BUG] Failed to use SOF on HP zbook 15 G6 #1985

elorriaux opened this issue Mar 24, 2020 · 112 comments
Labels
bug Something isn't working Dual GFX Cards Both Intel integrated GPU and external GFX card are present. HDA Applies to HD-Audio bus for codec connection WHL Applies to WhiskeyLake platform

Comments

@elorriaux
Copy link

Describe the bug
dmesg reports:
[ 4.122285] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 4.122812] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[ 4.123269] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[ 4.123798] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[ 4.124252] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 4.124851] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 4.125485] sof-audio-pci 0000:00:1f.3: error: init i915 and HDMI codec failed
[ 4.126042] sof-audio-pci 0000:00:1f.3: error: failed to probe DSP -19
[ 4.126496] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -19

Impact
Cannot use built-in mic on this laptop

Environment

  1. sof (firmware/topology) and linux (kernel driver).
    • Kernel: 5.5.11 (gentoo-sources patchset)
    • SOF: 1.4.2
  2. Name of the topology file
    • Topology: sof-cnl-v1.4.2.ri
  3. Name of the platform(s) on which the bug is observed.
    • Platform: x86_64

Screenshots or console output
lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers [8086:3ec4] (rev 07)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07)
00:04.0 Signal processing controller [1180]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem [8086:1903] (rev 07)
00:12.0 Signal processing controller [1180]: Intel Corporation Cannon Lake PCH Thermal Controller [8086:a379] (rev 10)
00:14.0 USB controller [0c03]: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller [8086:a36d] (rev 10)
00:14.2 RAM memory [0500]: Intel Corporation Cannon Lake PCH Shared SRAM [8086:a36f] (rev 10)
00:15.0 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0 [8086:a368] (rev 10)
00:15.1 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO I2C Controller thesofproject/sof#1 [8086:a369] (rev 10)
00:16.0 Communication controller [0780]: Intel Corporation Cannon Lake PCH HECI Controller [8086:a360] (rev 10)
00:17.0 SATA controller [0106]: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller [8086:a353] (rev 10)
00:1b.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port thesofproject/sof#17 [8086:a340] (rev f0)
00:1c.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port thesofproject/sof#3 [8086:a33a] (rev f0)
00:1c.4 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port thesofproject/sof#5 [8086:a33c] (rev f0)
00:1d.0 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port thesofproject/sof#9 [8086:a330] (rev f0)
00:1d.5 PCI bridge [0604]: Intel Corporation Cannon Lake PCH PCI Express Root Port thesofproject/sof#14 [8086:a335] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:a30e] (rev 10)
00:1f.3 Multimedia audio controller [0401]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
00:1f.4 SMBus [0c05]: Intel Corporation Cannon Lake PCH SMBus Controller [8086:a323] (rev 10)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH SPI Controller [8086:a324] (rev 10)
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (7) I219-LM [8086:15bb] (rev 10)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU117GLM [Quadro T1000 Mobile] [10de:1fb9] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10fa] (rev a1)
02:00.0 Non-Volatile memory controller [0108]: ADATA Technology Co., Ltd. XPG SX8200 Pro PCIe Gen3x4 M.2 2280 Solid State Drive [1cc1:8201] (rev 03)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01)
05:00.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06)
06:00.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06)
06:01.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06)
06:02.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06)
06:04.0 PCI bridge [0604]: Intel Corporation JHL7540 Thunderbolt 3 Bridge [Titan Ridge 4C 2018] [8086:15ea] (rev 06)
07:00.0 System peripheral [0880]: Intel Corporation JHL7540 Thunderbolt 3 NHI [Titan Ridge 4C 2018] [8086:15eb] (rev 06)
3b:00.0 USB controller [0c03]: Intel Corporation JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 4C 2018] [8086:15ec] (rev 06)
70:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD Black 2018/PC SN720 NVMe SSD [15b7:5002]
71:00.0 Network controller [0280]: Intel Corporation Wi-Fi 6 AX200 [8086:2723] (rev 1a)

@plbossart
Copy link
Member

@elorriaux that looks like a known issue where an external NVIDIA GPU is used, the log is similar to #1658

@kv2019i I think you fixed this with #1731, but can it be back-ported to 5.5-stable?

@elorriaux
Copy link
Author

@plbossart thanks Pierre for the quick answer. Actually you're wright my IT disabled the intel graphics card, I did not pay attention to that. If I reactivate it I can go through that error but my X server does not work anymore, and my other distro does not boot anymore. So I will probably have to

I was also wrong regarding the firmware, the next error is that sof-cfl.ri is missing.

@kv2019i
Copy link
Collaborator

kv2019i commented Mar 25, 2020

@plbossart Ack, this is fixed by upstream commit "ASoC: SOF: Intel: hda: allow operation without i915 gfx" . This is currently not queued even for 5.6, so only in 5.7 queue. Mark wasn't happy recently with the volume of changes to 5.5, so not sure if this is accepted. There is going to be a fair amount of patches, so maybe this is still worth it.

UPDATE: @plbossart I'll try the patches on top of 5.5.y and if seems good, I'll send a mail to alsa-devel about this. Not 100% what's the Mark preferred process to pick up older patches for stable, but I'll follow what Jaroslav did (the most recent example I could find).

@kv2019i
Copy link
Collaborator

kv2019i commented Mar 25, 2020

@plbossart @elorriaux Hmm, backport to 5.5.y is not really straightforward. A minimum set requires many more patches than the one mentioned. I backported three patches, but then realized that the upstream fix depends on the refactored machine selection code (in 5.5.y, bus probe is done after machine driver selection, so the upstream logic to ignore lack of i915 won't work). Backport to 5.5.y within limits of stable kernel rules (all patches need to be in upstream, <100 lines), does not seem feasible.

@plbossart
Copy link
Member

@kv2019i I think we need to start thinking about a 5.5 SOF branch, it'd still be useful for a number of people who have non-functional devices. You can argue that 5.6 is just around the corner though but some distros will stick with 5.5. Some will even stick with 5.4 LTS.

@elorriaux
Copy link
Author

Hi, I tried to configure bumblebee to keep intel built-in grapĥics card enabled and it solves my initial error, I can go further but it fails to load the firmware (I symlinked sof-cfl.ri tp sof-cfl.ri):

dmesg | grep audio
[ 4.130562] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 4.131228] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[ 4.131839] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[ 4.132512] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[ 4.134776] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 4.135454] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 4.136682] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops 0xffffffffa069a3c0)
[ 4.147497] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[ 4.148610] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 4.151704] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof/sof-cfl.ri failed with error -2
[ 4.152441] sof-audio-pci 0000:00:1f.3: error: request firmware intel/sof/sof-cfl.ri failed err: -2
[ 4.153791] sof-audio-pci 0000:00:1f.3: error: failed to load DSP firmware -2
[ 4.153953] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -2

ls /lib/firmware/intel/sof/sof-cfl.ri -alrt
lrwxrwxrwx 1 root root 10 Apr 2 20:33 /lib/firmware/intel/sof/sof-cfl.ri -> sof-cnl.ri

(firmware version 1.4.2)

@plbossart
Copy link
Member

@elorriaux you sure about the symlink? If the file was in the right location it'd be a different error...

@elorriaux
Copy link
Author

@plbossart That's the first thing I checked. You are confirming that I should continue to check in that direction.

I guess that read permission on cof-cnl.ri should be sufficient?

I simply took sof-cnl-v1.4.2.ri from https://github.com/thesofproject/sof/releases and copied it to /lib/firmware/intel/sof/sof-cnl.ri and then created a sof-cfl.ri symlink. I'll try to copy it directly with the right name without symlink.

@plbossart
Copy link
Member

@elorriaux try to use the go.sh script, it does all the symlinks for you

@plbossart
Copy link
Member

@elorriaux
Copy link
Author

Reinstalled all the firmwares with the go.sh script, not exactly the same error msg:

dmesg | grep audio
[ 4.114546] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 4.115214] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[ 4.115821] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[ 4.116463] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[ 4.117060] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 4.117753] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 4.118752] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops 0xffffffff90a9a3c0)
[ 4.128847] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[ 4.129424] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 4.131533] sof-audio-pci 0000:00:1f.3: error: codec #0 probe error, ret: -2
[ 4.132544] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof/sof-cfl.ri failed with error -2
[ 4.133668] sof-audio-pci 0000:00:1f.3: error: request firmware intel/sof/sof-cfl.ri failed err: -2
[ 4.134939] sof-audio-pci 0000:00:1f.3: error: failed to load DSP firmware -2
[ 4.135094] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -2

@lgirdwood
Copy link
Member

@elorriaux what was the script output ? You will need to run as root/sudo as it will be installing files under /lib/firmware (or wherever your distro places system firmware)

@elorriaux
Copy link
Author

everything was done with root account.

./go.sh
Installing Intel firmware and topology v1.4.2 to lib/firmware/intel
Done installing Intel firmware and topology v1.4.2

ls -alrt /lib/firmware/intel/sof
total 12
drwxr-xr-x 4 root root 4096 Apr 3 15:43 v1.4.2
lrwxrwxrwx 1 root root 24 Apr 3 15:43 sof-bdw.ri -> v1.4.2/sof-bdw-v1.4.2.ri
lrwxrwxrwx 1 root root 24 Apr 3 15:43 sof-cht.ri -> v1.4.2/sof-cht-v1.4.2.ri
lrwxrwxrwx 1 root root 24 Apr 3 15:43 sof-byt.ri -> v1.4.2/sof-byt-v1.4.2.ri
lrwxrwxrwx 1 root root 37 Apr 3 15:43 sof-apl.ri -> v1.4.2/intel-signed/sof-apl-v1.4.2.ri
lrwxrwxrwx 1 root root 37 Apr 3 15:43 sof-glk.ri -> v1.4.2/intel-signed/sof-apl-v1.4.2.ri
lrwxrwxrwx 1 root root 37 Apr 3 15:43 sof-cnl.ri -> v1.4.2/intel-signed/sof-cnl-v1.4.2.ri
lrwxrwxrwx 1 root root 37 Apr 3 15:43 sof-cfl.ri -> v1.4.2/intel-signed/sof-cnl-v1.4.2.ri
lrwxrwxrwx 1 root root 37 Apr 3 15:43 sof-cml.ri -> v1.4.2/intel-signed/sof-cnl-v1.4.2.ri
lrwxrwxrwx 1 root root 37 Apr 3 15:43 sof-icl.ri -> v1.4.2/intel-signed/sof-icl-v1.4.2.ri

If you pay attention on dmesg logs, the usage of the script to install firmware causes one additional line compared to the firmware install I did manually:

[ 4.131533] sof-audio-pci 0000:00:1f.3: error: codec #0 probe error, ret: -2

@elorriaux
Copy link
Author

Forgot to add a listing to the directory where the link is pointing at:

ls -alrt /lib/firmware/intel/sof/v1.4.2/intel-signed/
total 844
-rw-r--r-- 1 root root 286720 Apr 3 15:43 sof-cnl-v1.4.2.ri
-rw-r--r-- 1 root root 282624 Apr 3 15:43 sof-apl-v1.4.2.ri
drwxr-xr-x 2 root root 4096 Apr 3 15:43 .
-rw-r--r-- 1 root root 286720 Apr 3 15:43 sof-icl-v1.4.2.ri
drwxr-xr-x 4 root root 4096 Apr 3 15:43 ..

@paulstelian97
Copy link

4 seconds, which means early boot... Do you have an initramfs? It's possible you may need to add the /lib/firmware/intel/sof and /lib/firmware/intel/sof-tplg folders inside the initramfs.

root ignores read/write permissions and so should the kernel module itself.

@plbossart
Copy link
Member

maybe a red-herring but do you compile all SOF stuff as modules? if you use built-ins the request_firmware won't work.

Also the error you have
[ 4.131533] sof-audio-pci 0000:00:1f.3: error: codec #0 probe error, ret: -2

shows a problem with HDMI, so are you sure you are using the intel card?

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 3, 2020

Ouch, you @elorriaux seem to be hitting many issues. Thanks for trying and reporting back. You could try reloading "modprobe -r snd_sof_pci ; modprobe snd_sof_pci" after the system has booted. If the issue is with firmware files missing from initramfs, that should work around that.

@plbossart wrote:

Also the error you have
[ 4.131533] sof-audio-pci 0000:00:1f.3: error: codec #0 probe error, ret: -2

shows a problem with HDMI, so are you sure you are using the intel card?

#0 is still the external HDA codec. I'm afraid this is a case of #1807 I've been waiting for the reporter of that one to try my patch:
#1807 (comment)

Or both symptoms are explained by what @plbossart described, e.g. not building SOF as module. That could explain the errors.

@elorriaux
Copy link
Author

@paulstelian97 good remark, I don't use initramfs but I can include the firmware when compiling the kernel

@plbossart No I was not using modules, I'll search in that direction. And yes I was using the intel card, when intel card is disabled in the BIOS, I'm getting the error described at the beginning of the bug:

[ 4.125485] sof-audio-pci 0000:00:1f.3: error: init i915 and HDMI codec failed

as soon as I enable hybrid graphics and add i915.enable_guc=2 to the kernel line I can go through that.

@plbossart
Copy link
Member

@elorriaux To remove any timing or resource dependency, can you first blacklist snd-sof-pci, then after boot do a manual modprobe snd-sof-pci.

@plbossart
Copy link
Member

Another trick @elorriaux is to add the attached file as /etc/modprobe.d/sof-dyndbg.conf, that will generate a longer dmesg trace and help us figure out what's going on. don't copy/paste the results, attach a file or provide a link, thanks!
ddebug.txt

@elorriaux
Copy link
Author

So, using modules instead of built in kernel solved the question, no need to blacklist the module. The firmware seems to be successfully loaded, there remains one error, I don't know if it's critical.

[ 6.110301] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 6.110426] sof-audio-pci 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[ 6.110436] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[ 6.110509] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[ 6.110512] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[ 6.110630] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 6.110708] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops 0xffffffff84c9ce80)
[ 6.119405] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[ 6.119406] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 6.131233] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[ 6.131235] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[ 6.261736] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:4:2-66a5a
[ 6.261737] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:11:0 Kernel ABI 3:11:0
[ 6.261991] sof-audio-pci 0000:00:1f.3: firmware boot complete

At the end I have no sound and no mic, I've upgraded pulseaudio to version 13.99.1, alsa 1.2.2. From now I don't know in which direction I should search.

@plbossart: here is the dmesg log with dynamic debug (had to add CONFIG_DYNAMIC_DEBUG) in my kernel.
dmesg_dyndbg.log

Other strange thing, I used to build snd-hda-intel in the kernel to get sound, now I'm trying to load it as a module but I can't get sound after the module is loaded, and the dmesg states that snd-hda-intel is trying to use SOF for DMIC...

[ 2027.208939] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 2027.209181] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[ 2027.209291] snd_hda_intel 0000:01:00.1: enabling device (0000 -> 0002)
[ 2027.209354] snd_hda_intel 0000:01:00.1: Disabling MSI

@plbossart
Copy link
Member

@elorriaux that's progress you now boot successfully and detect HDAudio cards ([ 6.119405] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
)

Can you try and do aplay -l and arecord -l, you should now see playback and capture devices. and should be able to play/capture using the -Dhw:0,x devices (replace x by what you see).

Let's take pulseaudio separately.

@plbossart
Copy link
Member

ah and also don't use snd-hda-intel, it cannot be used for capture. You need SOF to deal with the digital mics.

@elorriaux
Copy link
Author

@plbossart for snd-hda-intel I was just trying to get sound while sof is not operational.

When loading snd-sof-pci, I don't have any interface:

~ # aplay -l
aplay: device_list:274: no soundcards found...
~ # arecord -l
arecord: device_list:274: no soundcards found...

@plbossart
Copy link
Member

@elorriaux I don't know what to tell you except: please retry and check that you did remove blacklists or did a manual modprobe snd-sof-pci

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 6, 2020

@elorriaux wrote:

~ # aplay -l
aplay: device_list:274: no soundcards found...
~ # arecord -l
arecord: device_list:274: no soundcards found...

Did you run these as root (seems so but just checking)? On most distros, only members of "audio" group can access the ALSA device nodes so "aplay -l" as a normal user will not report any soundcards. But as root it should work.

The log in https://github.com/thesofproject/sof/issues/2623#issuecomment-609033760 seems good, no errors anymore, firmware is loaded and probe works for the all codecs.

When you load snd-sof-pci, could you still send the output of "alsa-info.sh". There's still something we are missing.

@elorriaux
Copy link
Author

@plbossart I did so many attempts ;) I've even tried to upgrade to a 5.6.2 kernel without more success. Loading snd-sof-pci when booting or after booting does not change anything. My blacklist is empty (my system does not load snd-hda-intel automatically)

@kv2019i yes I ran scripts as root and my users ares in audio group

alsa-info: http://alsa-project.org/db/?f=b47e6e3b699a29d2769da51f8cd0acfa65807468

Is there a live distro with recent enough kernel and which is known to work for such a hardware?

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 6, 2020

@elorriaux wrote:

Other strange thing, I used to build snd-hda-intel in the kernel to get sound, now I'm trying to load it as a module but I can't get sound after the module is loaded, and the dmesg states that snd-hda-intel is trying to use SOF for DMIC...

With newer kernel's there is a mechanism to decide automatically which driver to choose. You can force a specific choice by putting to e.g. /etc/modprobe.d/blacklist-dsp.conf

#Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF
options snd\_intel\_dspcfg dsp\_driver=1

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 6, 2020

@elorriaux wrote:

@kv2019i yes I ran scripts as root and my users ares in audio group

alsa-info: http://alsa-project.org/db/?f=b47e6e3b699a29d2769da51f8cd0acfa65807468

Ack, this confirms the driver load did not complete. You have no PCM devices:

!!ALSA Device nodes
!!-----------------

crw-rw---- 1 root audio 116,  1 Apr  5 15:35 /dev/snd/seq
crw-rw---- 1 root audio 116, 33 Apr  5 15:35 /dev/snd/timer 

In your dynamic-dbg log, it would seem init of snd_soc_skl_hda_dsp machine driver does not happen at all. It also seems the module is not loaded based on your alsa-info output.

A few things to try:

  • can you confirm CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH is enabled in your kernel config
  • you can try loading the driver manually: sudo modprobe snd_soc_skl_hda_dsp
  • double-check this module is not blacklisted in any file in /etc/modprobe.d

Is there a live distro with recent enough kernel and which is known to work for such a hardware?

I'm not aware of other HP zbook15g6 users that have tried SOF, so there are no verified to work cases. You could try Fedora Rawhide Live, but it's a bit of a stretch as there is nothing wrong in your current config that would explain the problems.

@elorriaux
Copy link
Author

@kv2019i : you are actually pointing at something I've investigated yesterday after looking at that thread https://github.com/thesofproject/sof/issues/2275

So yes snd-soc-skl_hda_dsp is enabled and compiled as module. My blacklist.conf is empty, and if I don't load modules by myself, nothing is loaded for audio devices (snd-hda-intel). Here is a dmesg log, where I modprobe snd-sof-pci after X login, and then modprobe snd-soc-skl_hda_dsp.

dmesg_modprobe.log

And alsa-info: http://alsa-project.org/db/?f=45578fbc786fd50fc89363ac494a38c27be525ac

Since installing gentoo is just like starting from a white page, I would not be surprised that I forgot something... I forgot to mention that I've also tried to generate a kernel with the genkernel tool which results in a generic kernel conf as the one which is used in gentoo live dvd.

I'll try to have a look to Fedora live... Since I really don't see where to look.

@elorriaux
Copy link
Author

@plbossart I suspect it is related to the option proposed by @kv2019i here #1917 (comment)

@elorriaux
Copy link
Author

@plbossart I confirm, removing it solves errors in dmesg. I've even been thinking that everything -rcwas working fine with that kernel and options snd_sof_intel_hda_common use_common_hdmi=Y... but after a few minutes it froze...

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 17, 2020

@elorriaux D'oh, ok -- I think I figured what is still missing. It seems alsa-ucm-1.2.2 is missing one patch that is needed on systems with external GPU. The patch was merged on March 5 to alsa-ucm to git, so I was under assumption it is in 1.2.2, but alas, I did not check, now I did it is not there. But that explains why Pulseaudio keeps on trying to open the HDMI3 device on your system.

Here's the patch that is missing:
"sof-hda-dsp: Support systems without integrated graphics audio"
alsa-project/alsa-ucm-conf@4722f5b

You can either take latest alsa-ucm-conf from git master, or just take the Hdmi.conf file and copy it to /usr/share/alsa/ucm2/sof-hda-dsp/Hdmi.conf
https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/sof-hda-dsp/Hdmi.conf

Without this, you get problems with Pulseaudio (independently from the #1917 setting of codec_mask).

@elorriaux
Copy link
Author

@kv2019i I repackaged alsa-ucm-conf from git to get the right Hdmi.conf. But I've not been able to get a pulseaudio log, it freezes almost immediately and pulseaudio log is empty :/

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 20, 2020

@kv2019i I repackaged alsa-ucm-conf from git to get the right Hdmi.conf. But I've not been able to get a pulseaudio log, it freezes almost immediately and pulseaudio log is empty :/

Ack, thanks @elorriaux . Did you have the HDMI codec filtered out with codec_mask (i.e. #1917 (comment) ) when you did the test?

@elorriaux
Copy link
Author

@kv2019i arg no, I forgot to reactivate it after #1985 (comment)

Anyway I uncommented it and it continues to freeze, most of the time right after I load sound modules. However during one attempt, I managed to get logs before freezing (I still don't have identified why some attempts are able to last longer than others before freezing). In dmesg there are 3 lines that do not appear regarding hdmi devices

log_dmesg_hdmi.log
log_pulseaudio_hdmi.log

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 21, 2020

@elorriaux Ok thanks! The logs now good. Pulseaudio no longer gets fooled with the non-existent i915 HDMI nodes, so this is good. Now the "only" thing left are the freezes. There's something positive to report on that front in that we have now reproduced this on another machine that we have in the team, which makes the debug faster:
thesofproject/sof#2806
.. and we now have a fix candidate in firmware! The 1.5 SOF FW (due out very soon) will have this fix.

@elorriaux
Copy link
Author

@kv2019i I feel a little bit less alone ;) Is the firmware available for testing purpose?

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 24, 2020

@elorriaux wrote:

@kv2019i I feel a little bit less alone ;) Is the firmware available for testing purpose?

Heh indeed - you've really hit a multitude of issues with your machine. There are rc candidate releases of the firmware at https://github.com/thesofproject/sof/releases (upto rc4 now), but unfortunately your system only works with production signed firmwares and the rc candidates won't work. So you'll have to wait a bit longer.

@dzikages555
Copy link

dzikages555 commented May 4, 2020

Yesterday I thought that I fixed this problem on my laptop (see #2065 (comment) for the "solution"). I have working microphone and speakers, but my system freezes randomly.

There are too many comments for this issue so I'm confused a little (in what setup, when, etc. someone's computer freezes). My observations are:

  • kernel 5.7-rc3 + sof firmware v1.4.2 + updated Hdmi.conf + nvidia-440.82 - system freezes at random moments (10-80 min after booting)
  • kernel 5.7-rc3 + sof firmware v1.4.2 + updated Hdmi.conf + nvidia-440.82 + disabled sof options snd-intel-dspcfg dsp_driver=1 - system is stable OK (except not working mic)
    • so this is not a problem with kernel/nvidia drivers

My setup is described in the first comment of #2065. I also have an additional display connected through HDMI port.

Sometimes my computer freezes when I change settings with alsamixer. Other times I'm simply listening to music on youtube (chrome + pulseaudio) and after a while (like 40 minutes after booting my computer) music stops playing. After that I have 5-20 seconds (so I can type dmesg in console once or twice - unfortunately there are no logged errors) and then my computer freezes completely (even sysrq does not work).

I could compile and try newer sof firmware or something but to be honest I'm sick and tired of fixing sound on my Linux laptop. Maybe next week I will try again (with different firmware or try to make it more reproducible and less random).

@elorriaux
Copy link
Author

@dzikages555 : stop compiling and searching, just wait for signed binaries of sof 1.5 ;) You cannot go really further at the moment.

@kv2019i
Copy link
Collaborator

kv2019i commented May 4, 2020

@elorriaux wrote:

@dzikages555 : stop compiling and searching, just wait for signed binaries of sof 1.5 ;) You cannot go really further at the moment.

Ack on that. I'm afraid @dzikages555 you hit one more issue. We have a fix coming in FW, but you'll have to wait until release of the signed firmware. See #1985 (comment) for the history.

@kv2019i
Copy link
Collaborator

kv2019i commented May 13, 2020

@elorriaux @dzikages555 and others, signed v1.5 firmware is now available for testing:
https://github.com/thesofproject/sof-bin/tree/stable-v1.5

@elorriaux
Copy link
Author

elorriaux commented May 13, 2020

@kv2019i test in progress, no freeze so far. Should I keep these lines?

#options snd_sof_intel_hda_common codec_mask=0x1
#options snd_sof_intel_hda_common use_common_hdmi=Y

I currently have discrete GPU disabled, I also have to test if everything is OK once I will re-enable it.

@kv2019i
Copy link
Collaborator

kv2019i commented May 13, 2020

@elorriaux wrote:

@kv2019i test in progress, no freeze so far. Should I keep these lines?

#options snd_sof_intel_hda_common codec_mask=0x1
#options snd_sof_intel_hda_common use_common_hdmi=Y

Thanks for the quick test and good to hear the results so far.

As for the parameters, if HDMI is working, you can keep them commented out.

I currently have discrete GPU disabled, I also have to test if everything is OK once
I will re-enable it.

Ack, it should work much the same way with discrete GPU enabled. HDMI audio will not go via SOF anymore, but that should be it.

@elorriaux
Copy link
Author

@kv2019i seems to work with discrete GPU too

@kv2019i
Copy link
Collaborator

kv2019i commented May 15, 2020

Thank you @elorriaux for testing once more. I'll go ahead and close this bug now.

@kv2019i kv2019i closed this as completed May 15, 2020
@elorriaux
Copy link
Author

@kv2019i Actually not fully tested, I don't know what I did exactly when I tried with discrete GPU, but nvidia drivers do not work with 5.7 kernels yet, so difficult to conclude. The patch I've tried do not allow me to get my X server working with nvidia and 5.7 kernel.

I can only confirm that it works with intel GPU

@dzikages555
Copy link

dzikages555 commented May 16, 2020

@kv2019i I can confirm it works. Thank you guys!

My setup is:

  • linux-5.7-rc3
  • patched nvidia-440.82
  • sof firmware 1.5 (had to copy go.sh from 1.4.2 branch and change version)
  • updated hdmi.conf
  • using discrete GPU (HP does not allow me to use integrated GPU).
  • HP OMEN 17-cb0xxx

Digital microphone is working. Headphones and speakers are working. No freezes with v1.5 firmware.
Sometimes pulse audio (?) gets crazy when I unplug my headphones and tries to play sound via nvidia/HDMI instead of my laptop speakers, but that's a minor and unrelated issue.

@elorriaux
Copy link
Author

elorriaux commented Jul 30, 2020

Small feedback, everything seems to work without freezes.

The only issue concerns the digital mic level, it works but it's almost impossible to hear anything unless I push the speaker level to the maximum, and the sound level is still very very low. I remember in the early tests with SOF 1.4 that I was able to record and listen correctly to my voice when testing the mic. Does anybody has an idea where this issue can come from ?

I'm still using SOF 1.5, haven't tried 1.5.1 yet, I don't know if it can change something.

@juimonen
Copy link

@elorriaux we had "amplifying" eq on the dmic path, then it was removed (for some reason), and then we put it back....
I don't recall now was this just some thing we messed up or there was some higher purpose. Automatic level testing with physical dmic devices is little bit hairy and we try to improve on that.

So you might have this time-wise "middle ground" topology without the amplification, or then there is just some volume component in low volume in the dmic path.

You should be able to load newer/older topologies without signing, so if you have time, you could try out the latest corresponding topology for your platform from sof repositories. So you could just copy over the old topology and see what happens.

@elorriaux
Copy link
Author

@juimonen thanks for the answer, I've just updated to 1.5.1 and it looks like to work fine !

@elorriaux
Copy link
Author

Hello,

I don't know if I should continue this thread or open another one. There is still a small glitch on my system, from time to time, without being able to identify the root cause, my speaker stops working. I've never been able to find a way to get back the sound when it happens, I just know that the mic is still working as people can still hear me during meetings.

The only way to get back the speaker working correctly is to shut down the machine (reboot does not solve anything).

For a long time I was running kernel 5.7.7 and SOF 1.5.1. I've updated my kernel to 5.10.27 and SOF 1.6.1 and the problem persists.

This is quite difficult to investigate since I don't have anything in dmesg and that it occurs randomly, the laptop can work for days without any trouble...

Are there similar experiences / issues? I could not find any info in issues.

@plbossart
Copy link
Member

Hello,

I don't know if I should continue this thread or open another one. There is still a small glitch on my system, from time to time, without being able to identify the root cause, my speaker stops working. I've never been able to find a way to get back the sound when it happens, I just know that the mic is still working as people can still hear me during meetings.

The only way to get back the speaker working correctly is to shut down the machine (reboot does not solve anything).

For a long time I was running kernel 5.7.7 and SOF 1.5.1. I've updated my kernel to 5.10.27 and SOF 1.6.1 and the problem persists.

This is quite difficult to investigate since I don't have anything in dmesg and that it occurs randomly, the laptop can work for days without any trouble...

Are there similar experiences / issues? I could not find any info in issues.

this should be added as a new issue @elorriaux

The fact that the speakers don't work but the mic does makes me think there is a codec configuration issue or something. When SOF fails it typically fails big. Also we reset the DSP and re-download the firmware on each suspend-resume or reboot, so requiring a power cycle looks like a problem on the amplifier side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Dual GFX Cards Both Intel integrated GPU and external GFX card are present. HDA Applies to HD-Audio bus for codec connection WHL Applies to WhiskeyLake platform
Projects
None yet
Development

No branches or pull requests

9 participants