thesofproject / linux

Linux kernel source tree
Other
88 stars 128 forks source link

[Alldocube GT Book] cl_copy_fw timeout #3210

Closed tomty89 closed 2 years ago

tomty89 commented 2 years ago

Hi. I get the following errors when trying to get audio working by using sof-audio-pci-intel-icl and the sof firwware:

[    7.130662] sof-audio-pci-intel-icl 0000:00:1f.3: error: cl_copy_fw: timeout HDA_DSP_SRAM_REG_ROM_STATUS read
[    7.131298] sof-audio-pci-intel-icl 0000:00:1f.3: error: extended rom status:  0x80000012 0x2c 0x0 0x0 0x0 0x0 0x2100186 0x0
[    7.131332] sof-audio-pci-intel-icl 0000:00:1f.3: error: load fw failed ret: -110
[    7.131403] sof-audio-pci-intel-icl 0000:00:1f.3: error: failed to reset DSP
[    7.131425] sof-audio-pci-intel-icl 0000:00:1f.3: error: failed to boot DSP firmware -110
[    7.183055] sof-audio-pci-intel-icl 0000:00:1f.3: error: hda_dsp_core_reset_enter: timeout on HDA_DSP_REG_ADSPCS read
[    7.183091] sof-audio-pci-intel-icl 0000:00:1f.3: error: dsp core reset failed: core_mask 1
[    7.183452] sof-audio-pci-intel-icl 0000:00:1f.3: error: sof_probe_work failed err: -110

I'm on Arch Linux (kernel 5.14.11). I've tried both the v1.8 and v1.9 release of the firmware (and the former with kernel 5.10.72). Same errors.

The laptop has Celeron N5100. (Probably a SoC?)

P.S. Btw is is expected that I have to blacklist snd-hda-intel so that sof-audio-pci-intel-icl will at least try to kick in?

plbossart commented 2 years ago

@tomty89 can you share the full dmesg log, without blacklisting snd-hda-intel? In theory you only need the SOF driver if you have a DMIC or SoundWire interface, it could very well be that the DSP is not enabled on your platform.

Also sharing the results of 'alsa-info' would help.

See https://thesofproject.github.io/latest/getting_started/index.html#debug-audio-issues-on-intel-platforms for more ideas, e.g. if you disabled the ME.

tomty89 commented 2 years ago

Hmm, sounds like I've made a wrong assumption. Well I do get an "alsa card", it's just that it has no analog device at all. (I'm not sure if DP sound can actually work though, and I have no idea if the USB-C port supports HDMI Alt Mode.) I get sound in Windows btw.

P.S. A few irrelevant (iwlwifi) lines has been stripped from the dmesg file.

alsa-info.txt dmesg.txt

plbossart commented 2 years ago

ok, so the only good news is that the DSP is enabled on your platform

snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100

Everything else tells me your platform is not supported in a turn-key way by even the latest upstream code :-(

you seem to have an ESSX8336 codec, which isn't supported well upstream

/sys/bus/acpi/devices/ESSX8336:00/status     15

You would need the patches in https://lore.kernel.org/alsa-devel/20211004213512.220836-1-pierre-louis.bossart@linux.intel.com/ and https://github.com/thesofproject/linux/pull/3107 (the last part is a hack, a cleaner version has to be provided by the codec vendor).

In addition you have a variant we've never seen, so the patches above wouldn't fully work. Gah.

soc/sof/intel/pci-icl.c:        { PCI_DEVICE(0x8086, 0x4dc8), /* JSL-N */

@hli25 were you aware of this variant? so far we've seen APL, GLK and TGL only?

plbossart commented 2 years ago

@tomty89 I blindly added PR #3212, if you combine this with PR #3107, and unzip + copy this topology file sof-jsl-es8336.tplg.gz as /lib/firmware/intel/sof-tplg/sof-jsl-es8336.tplg things "should" probe and detect your hardware.

hli25 commented 2 years ago
soc/sof/intel/pci-icl.c:        { PCI_DEVICE(0x8086, 0x4dc8), /* JSL-N */

@hli25 were you aware of this variant? so far we've seen APL, GLK and TGL only? @plbossart i only tried ES8336 on GLK and TGL devices. But i would like to try to find a JSL with ES8336 if possible

tomty89 commented 2 years ago

@plbossart I just built 5.14.11 with #2962, #3107 and #3212 applied. Unsurprisingly, I get the errors I pasted at the very beginning. I suspect that my laptop suffers from the same CSME key issue you mentioned in #2990 (which is not exactly surprising either, I suppose; sounds like some typical "lame vendor forgot / didn't care enough to have the placeholder key changed" issue?). I'm not sure where I can get those "debug" firmware mentioned in the thread though. Didn't seem to see any link for that.

plbossart commented 2 years ago

@tomty89 Intel uses a 'debug key' for initial development on early silicon. When the silicon reaches a specific validation milestone, the key is changed to a production version. To the best of my knowledge firmware signed with the debug key SHALL NOT be distributed outside of Intel, what you mentioned with issue #2990 is a deviation from the rule with someone that was rather confused or screwed-up, who knows.

If you happen to have the Windows setup, can you try to see which firmware was used in the audio driver?

ghost commented 2 years ago

Can confirm this trouble. Same Alldocube GT Book laptop. Same output. Tried rc. kernel, custom compilation, driver patching. No luck.

plbossart commented 2 years ago

@tomty89 @systematicat If you have this working in Windows, maybe you can try to find which firmware is used. There should be something like dsp_fw_release.bin or dsp_fw_debug.bin If I copy what others provided in the past, thy to find something like this: the DEV would be 4DC8 and GLK->JSL?

Driver seems to match: %IntcAudioBus.DeviceDesc% = IntcAudioBus, PCI\VEN_8086&DEV_3198&CC_0401 ; GLK
tomty89 commented 2 years ago

@plbossart

Screenshot 2021-10-14 224814
plbossart commented 2 years ago

@tomty89 so you really have a device using the Intel production key, so clearly it's a firmware authentication issue. Not good.

@lgirdwood @mwasko what would be your recommentation here? Would it help if we tried using the Windows dsp_fw_release.bin on the Linux side (i.e. cp dsp_fw_release.bin /lib/firmware/intel/sof/sof-jsl.ri) to see if we can get the firmware authentication to work? Could it also be one of those problematic bits we've had to set in the past?

plbossart commented 2 years ago

This firmware boot issue was reproduced by Intel engineers. Let's use https://github.com/thesofproject/sof/issues/4916 to track this problem

jirisarri10 commented 2 years ago

Please fix It! I do not want use Windows!

RezinoviyDed commented 2 years ago

Please fix It! I do not want use Windows!

I solved this problem on my GT book i1405 by buying an budget external type-C sound card. Works well on elementary OS. For now, it's the only way to use it :(

tomty89 commented 2 years ago

I on the other hand got firmware loading error with 5.18.1 on Arch. sof-firmware 2.1.1 provides ssp-0 and ssp-2 topology but the kernel looks for an ssp-1 one.

ujfalusi commented 2 years ago

@tomty89, can you please create a new issue for the missing SSP1 topology file with more details so it can be tracked and fixed?

Thank you.

tomty89 commented 2 years ago

Should I file on this repo or https://github.com/thesofproject/sof-bin?

ujfalusi commented 2 years ago

I would rather file it for https://github.com/thesofproject/sof the sof-bin is just a binary drop made from the sources as releases.

RezinoviyDed commented 2 years ago

I tried an MX Linux 21.1 (AHS edition) with a new kernel: 5.16.0-5mx-amd64 Output Devices in Volume Control: Dummy Output. I checked the dmesg: $ sudo dmesg | grep -i -E "snd|audio|dsp|sof" log file @ujfalusi What can I try to do to fix?

ujfalusi commented 2 years ago

@RezinoviyDed, I can not find a hint that you are facing with the same cl_copy_timeout?

please add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf (the extension matters), reboot and attach the (fuill) kernel log gathered in this mode.

The report generated by alsa-info.sh might also help.

Thank you!

RezinoviyDed commented 2 years ago

@ujfalusi The MX linux image was used in a live-usb mode. Elementary OS 6.1 is currently installed. The logs were obtained from this system. alsa-info archived kernel log Thanks for you help.

RezinoviyDed commented 2 years ago

Sorry. The kernel log was too big. the small log for the current date.

ujfalusi commented 2 years ago

@RezinoviyDed , based on the kernel log you have signature verification issue with the firmware:

[    6.633396] sof-audio-pci-intel-icl 0000:00:1f.3: unknown ROM status value 80000012
[    6.633400] sof-audio-pci-intel-icl 0000:00:1f.3: error: status = 0x0000002c panic = 0x00000000
[    6.633411] sof-audio-pci-intel-icl 0000:00:1f.3: error: extended rom status:  0x80000012 0x2c 0x0 0x0 0x0 0x0 0x2100186 0x0
[    6.633414] sof-audio-pci-intel-icl 0000:00:1f.3: unknown ROM status value 80000012

0x12 is the validation step (in 0x80000012) 0x2c is the error code for validation failure

There is a module parameter to override the firmware path, but personally I have not used that, it might be:

options snd-sof-pci fw_path=intel/sof/community

to try to load the community signed firmware instead of the intel/sof/sof-jsl.ri

RezinoviyDed commented 2 years ago

I download and install sof-bin v2.1.1 and сreated a new modprobe.d/sof-patch.conf file with options: options snd-sof-pci fw_path=intel/sof/community Result: alsa-info kern.log

RezinoviyDed commented 2 years ago

@ujfalusi Need to do anything else?

ujfalusi commented 2 years ago

That also fails with the same validation error. I'm not sure what that means and how it can be solved, but @plbossart might know it.

plbossart commented 2 years ago

Sorry. The kernel log was too big. the small log for the current date.

Doesn't look like you have sof-bin installed.

Jun 23 12:39:11 slayki1405 kernel: [    3.598497] sof-audio-pci-intel-icl 0000:00:1f.3: loading firmware
Jun 23 12:39:11 slayki1405 kernel: [    3.601643] sof-audio-pci-intel-icl 0000:00:1f.3: Direct firmware load for intel/sof/sof-jsl.ri failed with error -2
Jun 23 12:39:11 slayki1405 kernel: [    3.601652] sof-audio-pci-intel-icl 0000:00:1f.3: error: request firmware intel/sof/sof-jsl.ri failed err: -2
Jun 23 12:39:11 slayki1405 kernel: [    3.601656] sof-audio-pci-intel-icl 0000:00:1f.3: you may need to download the firmware from https://github.com/thesofproject/sof-bin/
Jun 23 12:39:11 slayki1405 kernel: [    3.601659] sof-audio-pci-intel-icl 0000:00:1f.3: error: failed to load DSP firmware -2
Jun 23 12:39:11 slayki1405 kernel: [    3.602021] sof-audio-pci-intel-icl 0000:00:1f.3: error: sof_probe_work failed err: -2

make sure sof-bin is installed and remove this option, this is only valid for Chromebooks and Up boards.

options snd-sof-pci fw_path=intel/sof/community
RezinoviyDed commented 2 years ago

Ok, option removed. sof-bin is guaranteed to be installed: [ 3.560159] sof-audio-pci-intel-icl 0000:00:1f.3: loading firmware [ 3.565314] sof-audio-pci-intel-icl 0000:00:1f.3: request_firmware intel/sof/sof-jsl.ri successful @plbossart My new alsa-info log.

plbossart commented 2 years ago

@RezinoviyDed I see no firmware boot issue in your log, if the card is not functional it's because you have an ES8336 codec on this device, and it's known to be problematic. You would need to update to 5.19-rc1+ and likely configure quirks for this device.

/sys/bus/acpi/devices/ESSX8336:00/status     15
RezinoviyDed commented 2 years ago

I did the same steps on the MX Linux distribution (kernel 5.18.0-0.bpo.1-amd64). A new entry appeared in the dmesg log: created machine sof-essx8336 dmesg.txt alsa-info @plbossart Could this help?

plbossart commented 2 years ago

I did the same steps on the MX Linux distribution (kernel 5.18.0-0.bpo.1-amd64).

@RezinoviyDed to repeat myself, 5.18 does not contain all the patches for this codec, "you would need to update to 5.19-rc1+ and likely configure quirks for this device."

RezinoviyDed commented 1 year ago

@tomty89 Did you manage to solve the problem with the sound on GT Book i1405?

tomty89 commented 1 year ago

Nope:

$ journalctl --no-hostname -kp 4 | grep sof
Jul 25 18:05:07 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: warn: FW ABI is more recent than kernel
Jul 25 18:05:07 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: warn: FW ABI is more recent than kernel
Jul 25 18:05:08 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: Direct firmware load for intel/sof-tplg/sof-jsl-es8336-ssp1.tplg failed with error -2
Jul 25 18:05:08 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: error: tplg request firmware intel/sof-tplg/sof-jsl-es8336-ssp1.tplg failed err: -2
Jul 25 18:05:08 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: you may need to download the firmware from https://github.com/thesofproject/sof-bin/
Jul 25 18:05:08 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: error: failed to load DSP topology -2
Jul 25 18:05:08 kernel: sof-audio-pci-intel-icl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -2
Jul 25 18:05:08 kernel: sof-essx8336 sof-essx8336: ASoC: failed to instantiate card -2
Jul 25 18:05:08 kernel: sof-essx8336 sof-essx8336: snd_soc_register_card failed: -2
Jul 25 18:05:08 kernel: sof-essx8336: probe of sof-essx8336 failed with error -2
$ pacman -Ql sof-firmware | grep jsl-es8336-ssp
sof-firmware /usr/lib/firmware/intel/sof-tplg-v2.2/sof-jsl-es8336-ssp0.tplg
sof-firmware /usr/lib/firmware/intel/sof-tplg-v2.2/sof-jsl-es8336-ssp2.tplg
$ uname -r
5.18.13-arch1-1

I've been too lazy to properly report the issue. (Well I've wondering if the ssp1 topology files just for some reason aren't ready yet.) I'll probably wait until kernel 5.19.x becomes available (on Arch). (The thing is, I don't exactly "need" the builtin audio to work. It would be a plus but I don't exactly care a lot.)

RezinoviyDed commented 1 year ago

@plbossart I install new kernel: 5.19.0-trunk-amd64 Sound is not working. my alsa-info Output device: dummy output sof-bin v2.2 is installed dmesg.txt

plbossart commented 1 year ago

Recommended setup is described here; https://github.com/thesofproject/linux/issues/3336#issuecomment-1207200602

tomty89 commented 1 year ago

In case anyone is interested, as I saw https://github.com/thesofproject/sof/commit/190cfd79f77e3575b73e1dcf8ffeae923e74785e, I just created myself the ssp1 topology file needed on my machine (by binary patching according to cmp result on the ssp0 and ssp2 ones, and finally for the first time I get sound out of the speakers on Linux (Arch / 5.19.2).

There are a huge number of mixer controls and some of them seem completely useless, and at the same time MANY mixer controls affects the volume of the speakers (as in, how loud / mute or not):

Headphone (mute toggle doesn't matter)
Headphone Mixer
Speaker
DAC
DAC Source Mux
Left Headphone Mixer Left DAC
PGA1.0 1 Master
Right Headphone Mixer Right DAC

(I hope I haven't missed any)

Haven't tested whether the headphone jack works as well (and stuff like whether the speaker can / will be muted / unmuted when a pair of headphones is plugged in / unplugged).

Pops are a bit loud when the sound device is opened / closed.

P.S. Duh, it seems that the sound doesn't come back after suspend (to ram).

RezinoviyDed commented 1 year ago

@plbossart I install new kernel: Linux 6.0.10-224.current my alsa-info Output device: There are positive changes! My sound device is "Speakers - jasper Lake HD Audio" There is no sound, but after starting the operating system, the speakers make a click. sof-bin v2.2.2 is installed dmesg.txt

plbossart commented 1 year ago

6.0 is not enough, see https://github.com/thesofproject/linux/wiki/ES8336-support

RezinoviyDed commented 1 year ago

@plbossart Ok. Kernel command line: initrd=\EFI\com.solus-project\initrd-com.solus-project.current.6.0.10-224 root=PARTUUID=770af32c-d289-48e4-8d47-7157252e9dd0 quiet loglevel=3 splash systemd.show_status=false rw radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1 resume=UUID=16b614c6-58e0-4266-872f-f5391649ab65 CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m CONFIG_SND_SOC_ES8316=m

Output device: "Speakers - jasper Lake HD Audio"

I also unpacked the archive from es8336_topologies_main.tar.gz to /lib/firmware/intel/sof-tplg Unfortunately, there are no changes(( After starting the operating system, the speakers make a pops. I also noticed that the sound still works, but it is so quiet that at a volume of 150% it is almost inaudible. dmesg.txt

RezinoviyDed commented 1 year ago

I add /etc/modprobe.d/sof-dyndbg.conf and generate new alsa-info @plbossart Can it help?

plbossart commented 1 year ago

you don't have dynamic debug @RezinoviyDed

[    4.787182] dyndbg param is supported only in CONFIG_DYNAMIC_DEBUG builds
ujfalusi commented 1 year ago

@RezinoviyDed (@plbossart) if I read the recent comments, they have nothing to do with this issue, which is: [Alldocube GT Book] cl_copy_fw timeout There are 13 open and 28 closed Issues when I search for ES8336, which is the problem now. https://github.com/thesofproject/linux/issues?q=is%3Aissue+is%3Aopen+ES8336

Would it be better to move the discussion to one of them or create a support thread to get the ES8336 working?