thesofproject / linux

Linux kernel source tree
Other
89 stars 128 forks source link

ES8336: Audio input and output devices are unavailable #4002

Open imtangmeng opened 1 year ago

imtangmeng commented 1 year ago

When using Huawei matebook 13, it is found that the sound card it carries cannot recognize the input and output devices, the sound card information is as follows:

$ hwinfo --sound 13: PCI 1f.3: 0401 Multimedia audio controller
[Created at pci.386] Unique ID: nS1_.mw3hUWAgijA SysFS ID: /devices/pci0000:00/0000:00:1f.3 SysFS BusID: 0000:00:1f.3 Hardware Class: sound Model: "Intel Multimedia audio controller" Vendor: pci 0x8086 "Intel Corporation" Device: pci 0xa0c8 SubVendor: pci 0x152d "QUANTA Computer Inc" SubDevice: pci 0x1304 Revision: 0x20 Driver: "sof-audio-pci-intel-tgl" Driver Modules: "snd_sof_pci_intel_tgl" Memory Range: 0x6001120000-0x6001123fff (rw,non-prefetchable) Memory Range: 0x6001000000-0x60010fffff (rw,non-prefetchable) IRQ: 150 (11 events) Module Alias: "pci:v00008086d0000A0C8sv0000152Dsd00001304bc04sc01i00" Driver Info #0: Driver Status: snd_hda_intel is active Driver Activation Cmd: "modprobe snd_hda_intel" Driver Info #1: Driver Status: snd_sof_pci_intel_tgl is active Driver Activation Cmd: "modprobe snd_sof_pci_intel_tgl" Config Status: cfg=new, avail=yes, need=no, active=unknown

After the system is started, it is found that the /dev/snd directory contains only the following contents: $ ls /dev/snd/ seq timer

For information obtained by alsa-info, refer to the following link: https://github.com/imtangmeng/intel-audio/blob/master/alsa-info.txt.P5SStzeiTi

plbossart commented 1 year ago
/sys/bus/acpi/devices/ESSX8336:00/status     15

-> please see https://github.com/thesofproject/linux/wiki/ES8336-support https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support

plbossart commented 1 year ago

and clearly 5.18.17 will not support this codec, need 6.0 + patches listed in the wiki, and even that is not a sure bet of success.

imtangmeng commented 1 year ago

I used the 6.1.0-rc4 version + New topology files added in /lib/firmware/intel/sof-tplg (es8336_topologies_main.tar.gz), but the input and output devices are still not recognized, and the kernel still reports an error, see the link for details: https://github.com/imtangmeng/intel-audio/blob/master/alsa-info.txt.8pNeq2sof7 https://github.com/imtangmeng/intel-audio/blob/master/dmesg.log

plbossart commented 1 year ago

https://github.com/thesofproject/linux/wiki/ES8336-support#background

You also want to enable dynamic debug as suggested in https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#enable-dynamic-debug. The recommended configuration is to copy this file sof-dyndbg.conf.txt

imtangmeng commented 1 year ago

https://github.com/imtangmeng/intel-audio/blob/master/alsa-info.txt.mxZCX3G4qW https://github.com/imtangmeng/intel-audio/blob/master/sof-dyndbg.conf-log

plbossart commented 1 year ago

You are using an ancient firmware from maybe 2 years ago.

[    5.468805] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 1:6:0-18fab

It's not really surprising that you get an error, this firmware should not even work on TGL :-)

Please update your firmware, depending on distributions this can be in different packages.

plbossart commented 1 year ago

ubuntu: firmware-sof-signed fedora: alsa-sof-firmware

imtangmeng commented 1 year ago

Thanks for your guidance and reminder, according to your instructions, I updated the firmware. But it still doesn't work properly.

After updating the firmware, it seems to work, there are no more obvious error messages in the log, but the audio device still has the following problems:

  1. The speaker is recognized but cannot be used.
  2. The built-in microphone is not recognized.
  3. There is no feedback from the microphone and mic after the 4-segment earphone is inserted.

Detailed logs refer to the link below: https://github.com/imtangmeng/intel-audio/blob/master/alsa-info.txt.i1fIaPDZAQ

I have noticed that in the "Changelog between 1.2.6.3 and 1.2.7 releases"(https://www.alsa-project.org/wiki/Changes_v1.2.6.3_v1.2.7), there are "ucm2: sof-essx8336" related repair enhancements. Does it mean that I need to use a higher version of alsa?

imtangmeng commented 1 year ago

But after updating alsa-ucm-conf to 1.2.7.2 version, the problem is still not resolved. (This release contains your https://github.com/alsa-project/alsa-ucm-conf/commit/62a00497f40bb4e0b3431b8dc3bc9bd7ade09990 commit)

plbossart commented 1 year ago

yeah, well it's the classic problem with this codec, we have no idea what configuration needs to be used for a particular instance. That's why we added quirks left and right for the user to tweak. Some users reported success, most reported failures. There is limited hope of a turn-key solution given the lack of information and variability.

The description of the quirks you can change is here: https://thesofproject.github.io/latest/getting_started/intel_debug/suggestions.html#es8336-support