thesofproject / linux

Linux kernel source tree
Other
91 stars 133 forks source link

[BUG] Lenovo Ideapad slim 3i: Invalid SoundWire configuration reported on HDaudio platform. #4962

Closed pavlokozlenko closed 7 months ago

pavlokozlenko commented 7 months ago

Hello. I'm have a Lenovo ideapad slim 3i. Don't work sound (not found sound card). System Arch Linux, kernel 6.8.8 arch, pkg sof-firmware installed

log dmesg - https://pastebin.com/WWudLnkF

fragment sof log dmesg

[    5.739159] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040380
[    5.739188] sof-audio-pci-intel-tgl 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[    5.739202] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[    5.739392] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[    5.739463] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    5.746087] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[    5.780311] sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 0
[    5.780317] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 5
[    5.783361] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware paths/files for ipc type 0:
[    5.783365] sof-audio-pci-intel-tgl 0000:00:1f.3:  Firmware file:     intel/sof/sof-adl-n.ri
[    5.783366] sof-audio-pci-intel-tgl 0000:00:1f.3:  Topology file:     intel/sof-tplg/sof-adl-rt711.tplg
[    5.783722] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    5.783724] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    5.783728] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[    5.787045] iwlwifi 0000:00:14.3: base HW address: bc:03:58:85:98:46
[    5.881061] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    5.881082] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[    5.883475] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.883483] soundwire_intel soundwire_intel.link.0: Bus clash for data word
[    5.883571] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.883650] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.883734] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.883844] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.883921] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.884036] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.884112] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.884191] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.884290] soundwire_intel soundwire_intel.link.0: Bus clash for control word
[    5.904724] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:22:1 Kernel ABI 3:23:0
[    5.904793] sof-audio-pci-intel-tgl 0000:00:1f.3: error: can't connect DAI HDA3.OUT stream iDisp4
[    5.904795] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to add widget id 0 type 27 name : HDA3.OUT stream iDisp4
[    5.904801] sof_sdw sof_sdw: ASoC: failed to load widget HDA3.OUT
[    5.904803] sof_sdw sof_sdw: ASoC: topology: could not load header: -22
[    5.904813] sof-audio-pci-intel-tgl 0000:00:1f.3: error: tplg component load failed -22
[    5.904816] sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP topology -22
[    5.904817] sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
[    5.904828] sof_sdw sof_sdw: ASoC: failed to instantiate card -22
[    5.904895] sof_sdw sof_sdw: error -EINVAL: snd_soc_register_card failed -22
[    5.904905] sof_sdw: probe of sof_sdw failed with error -22

I`m installed https://github.com/thesofproject/sof-bin, this doesn't work

plbossart commented 7 months ago

can you attach the results of 'bash alsa-info.sh.txt' alsa-info.sh.txt

At a high level it looks like you have an HDaudio platform (hda codecs found, mask 5) but trying to load a SoundWire topology with RT711. That's probably a bad ACPI table...

pavlokozlenko commented 7 months ago

can you attach the results of 'bash alsa-info.sh.txt' alsa-info.sh.txt

At a high level it looks like you have an HDaudio platform (hda codecs found, mask 5) but trying to load a SoundWire topology with RT711. That's probably a bad ACPI table...

https://pastebin.com/1f47K3Sn

plbossart commented 7 months ago

the Lenovo ACPI information is clearly bogus, it reports two RT711 jack codecs on link0 and link1. That makes zero sense.

Realtek 0x000020025d071100
Realtek 0x000120025d071100

We've got to ignore this and use HDaudio instead. Gah.

pavlokozlenko commented 7 months ago

Інформація про ACPI Lenovo явно фальшива, вона повідомляє про два кодеки роз’єму RT711 на link0 та link1. Це не має сенсу.

Realtek 0x000020025d071100
Realtek 0x000120025d071100

Ми повинні ігнорувати це і замість цього використовувати HDaudio. Гах.

I need to load snd_intel_hda? Or just waiting information from you?

plbossart commented 7 months ago

@PavloIT115 can you try the patch in PR #4963 ?

pavlokozlenko commented 7 months ago

@PavloIT115чи можете ви спробувати патч у PR #4963 ?

If you tell me step by step what to do, I can do it. I have little experience with github

plbossart commented 7 months ago

https://thesofproject.github.io/latest/getting_started/setup_linux/install_locally.html

pavlokozlenko commented 7 months ago

https://thesofproject.github.io/latest/getting_started/setup_linux/install_locally.html

thx. If anything, I'll write back

plbossart commented 7 months ago

@mrhpearson FYI. The Linux single-build support really relies on valid ACPI information to detect which of I2S/SoundWire/HDaudio interfaces/topologies to use, I really don't think the DSDT is correct in this case.

mrhpearson commented 7 months ago

Thanks - unfortunately I have very limited levers to get anything fixed on the Ideapads as they're not in the Linux program. I'll flag this to them in case I get lucky....

pavlokozlenko commented 7 months ago

https://thesofproject.github.io/latest/getting_started/setup_linux/install_locally.html 4.Get the kernel source.

If a maintainer requests that you check out a different branch to test a bug fix, add -b [branch] to the end of this command, where [branch] is the branch name.

Me need to specify something here? Or just continue according to the instructions?

plbossart commented 7 months ago

@PavloIT115 it's simpler if you take the code for your existing kernel and apply the patch from PR #4963 on top. Arch Linux usually have really good documentation on compiling your own stuff.

pavlokozlenko commented 7 months ago

@PavloIT115 it's simpler if you take the code for your existing kernel and apply the patch from PR #4963 on top. Arch Linux usually have really good documentation on compiling your own stuff.

Sorry but i am very confused in github. I see changes hda.c and hda.h here. But I don't know what to do with them locally (git *, uh, I can't even describe what I can't do, because I know practically nothing.). I'm far from kernel builds, I'm just lame in programming

plbossart commented 7 months ago

@PavloIT115 if you are not comfortable with compiling the kernel, you can still help with this option to add in /etc/modprobe.d/alsa-base.conf

options snd-intel-dspcfg dsp_driver=1

That will tell us if indeed the HDaudio-based card works or not.

pavlokozlenko commented 7 months ago

@PavloIT115 if you are not comfortable with compiling the kernel, you can still help with this option to add in /etc/modprobe.d/alsa-base.conf

options snd-intel-dspcfg dsp_driver=1

That will tell us if indeed the HDaudio-based card works or not.

This working! Thx You! But for some reason, the right speaker can be heard in the middle of the laptop. It's his maybe design...

plbossart commented 7 months ago

@PavloIT115 the speaker setup is a known problematic issue, we have nothing in Linux which tells us what to do, so usually the only way to progress is to reverse-engineer the Windows driver, see https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#reverse-engineer-the-windows-audio-driver

If it sounds crazy it's because it is...

pavlokozlenko commented 7 months ago

@PavloIT115 the speaker setup is a known problematic issue, we have nothing in Linux which tells us what to do, so usually the only way to progress is to reverse-engineer the Windows driver, see https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#reverse-engineer-the-windows-audio-driver

If it sounds crazy it's because it is...

By the way! Windows was never installed on this laptop : D. I`m need to check the sound there. If anything, I'll write back

pavlokozlenko commented 7 months ago

If anything, I'll write back

This is how the laptop speakers are arranged. In Windows it's the same