Closed playXE closed 2 years ago
I just bought Huawei Matebook d15 i3-10110U and can confirm the sound does not work (Dummy output shown as Output device).
OS: Ubuntu 22.04 (development branch) Kernel 5.15.0-051500rc7-generic
Also tried the same kernel as @playXE linked https://github.com/himozzza/essx8336. After booting with it It displayed "Intel Corporation Comet Lake PCH-LP cAVS" as Output device and it correctly prompted me to select between "Headset" and "Headphones" when I plugged in headpone jack, but there was no sound neither on builtin speaker or headpones.
I could not hear any sound with speaker-test
utility.
This is my alsa-info: http://alsa-project.org/db/?f=95f73cdf9497ae38f36b4e12646d74826fbecdba
Bluetooth audio works great.
Thank you
Thanks for reporting this @simonboot and @playXE . We are indeed missing quirks for this CML device.
Can you retry with the branch https://github.com/plbossart/sound/tree/fix/es8336-codec
You should boot the DSP and reach the point where a topology file is missing.
You will have to try each of the files in this zip cml.tar.gz
Please try with sof-cml-es8336-0.tplg copied as /lib/firmware/intel/sof-tplg/sof-cml-es8336.tplg, then 1 and 2. We need this trial-and-error method to figure out where the codec is attached to (I2S/SSP interface 0 1 or 2).
forgot to add @hli25 on this one, not sure if you can help with the SSP connection - which SSP should be used on CML-based devices?
atm I am running Windows on my laptop, is there any way to load this kernel with USB drive? Maybe compile kernel on WSL and then move it to bootable USB?
@plbossart I am trying to build kernel in WSL and it fails:
➜ sound git:(fix/es8336-codec) make -j6
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/conmakehash
HOSTCC scripts/sortextable
CHK scripts/mod/devicetable-offsets.h
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
In file included from scripts/selinux/mdp/mdp.c:49:
./security/selinux/include/classmap.h:245:2: error: #error New address family defined, please update secclass_map.
245 | #error New address family defined, please update secclass_map.
| ^~~~~
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/mdp/mdp] Error 1
In file included from scripts/selinux/genheaders/genheaders.c:19:
./security/selinux/include/classmap.h:245:2: error: #error New address family defined, please update secclass_map.
245 | #error New address family defined, please update secclass_map.
| ^~~~~
make[2]: *** [scripts/Makefile.build:573: scripts/selinux/mdp] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:573: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:573: scripts/selinux] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:562: scripts] Error 2
Looks like the problem is a slightly newer version of GLibc?
atm I am running Windows on my laptop, is there any way to load this kernel with USB drive? Maybe compile kernel on WSL and then move it to bootable USB?
I don't have a Windows device so can't help with WSL.
It's possible to take an existing USB drive with e.g. Ubuntu and add a different kernel. I did it a couple of years ago with the help of @linuxium, see https://github.com/plbossart/UbuntuLiveUSB. No idea if this still works or not. You might have more luck with Cubic.
I'll probably buy a larger SSD and will install Linux near Windows because it seems to be quite hard to build linux kernel in WSL...
Hi, I still do not have the ability to dualboot, is there something I can help with using my machine? I see that there are some commits that mention ES8336
all quirks for CML support were picked for inclusion in the 5.15 stable kernel.
We still need help to figure out which topology is needed on those Huawei devices.
I have access to a D15... How or what to test?
If you can recompile a kernel, you'll need to use https://github.com/thesofproject/linux/pull/3107 (plbossart:fix/es8336-codec)
then you'll have to use cml.tar.gz from https://github.com/thesofproject/linux/issues/3248#issuecomment-959573378 to test which interface this device uses.
( Please try with sof-cml-es8336-0.tplg copied as /lib/firmware/intel/sof-tplg/sof-cml-es8336.tplg, then 1 and 2. We need this trial-and-error method to figure out where the codec is attached to (I2S/SSP interface 0 1 or 2). )
Is it sufficient to cherry-pick the three commits from #3107 (1d5f32fdeaea16d2809d0e1c7246fa11d503410c 8c33dd96060266f9b86b55ef0519c2819c50b9a5 32049ece2677fc55ba1aa9e5addd93aa3afcb7ce) on top of linux 5.15.6?
Is it sufficient to cherry-pick the three commits from #3107 (1d5f32f 8c33dd9 32049ec) on top of linux 5.15.6?
possibly. all the quirks were picked up for linux-stable, but there are not yet in linux-5.15.y, so likely in the next stable release.
You will need the codec hack regardless of what linux-stable does, it's not yet upstream.
I tried with...
Rebooted trice, with different firmware files in place. Still no sound. 😢
thanks for testing @eworm-de. I take from your answer that you did see a card created, started playing/streaming on the ALSA device but did not hear any sound? can you confirm the diagnosis and attach the alsa-info log?
@hli25 would you happen to have a set of ALSA mixer values that are needed for this codec?
Uh, I had some borked module parameters around for snd_intel_dspfix
... Droped these and tried again.
I do not see a card created (in pavucontrol
, as this host is running pulseaudio
/pipewire
).
On shutdown the system panics...
I have this in logs (with journalctl -b | grep -iE '(snd|sof-audio)'
):
Dec 07 16:58:24 linux kernel: snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Dec 07 16:58:24 linux kernel: snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
Dec 07 16:58:24 linux kernel: snd_soc_skl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Dec 07 16:58:24 linux kernel: snd_soc_skl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: enabling device (0000 -> 0002)
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: use msi interrupt mode
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: hda codecs found, mask 4
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 1:9:2-e096c
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:20:0 Kernel ABI 3:18:0
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: warn: FW ABI is more recent than kernel
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware info: version 1:9:2-e096c
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: Firmware: ABI 3:20:0 Kernel ABI 3:18:0
Dec 07 16:58:24 linux kernel: sof-audio-pci-intel-cnl 0000:00:1f.3: warn: FW ABI is more recent than kernel
@eworm-de the 'digital mics' log wasn't expected. need more info.
Can you please add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the entire 'dmesg' log? This will enable dynamic debug on the modules we care about. thanks!
thanks for testing @eworm-de. I take from your answer that you did see a card created, started playing/streaming on the ALSA device but did not hear any sound? can you confirm the diagnosis and attach the alsa-info log?
@hli25 would you happen to have a set of ALSA mixer values that are needed for this codec? FYI, I ever met no suound issue, it is fixed by chaning DAC: alsamixser to set "DAC" to 100
Ha, totally forgot about this... Will try to find some spare time tomorrow (and lend the device).
Can you confirm that Linux 5.15.7 should contain all quirks and only patches from #3107 are required on top?
@eworm-de
It looks like 5.15.7 is also missing additional patches. You'll need these patches from upstream
a164137ce91a ASoC: Intel: add machine driver for SOF+ES8336 9d36ceab9415 ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on ES8336 codec fa9730b4f28b ALSA: intel-dsp-config: add quirk for JSL devices based on ES8336 codec ae26c08e6c80 ALSA: intel-dsp-config: add quirk for CML devices based on ES8336 codec 790049fb6623 ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on ES8336 codec 63ff4c50ac56 ASoC: Intel: soc-acpi: add entry for ESSX8336 on JSL 8a6cc0ded6d9 ASoC: Intel: soc-acpi: add entry for ESSX8336 on CML
and the codec patches from PR #3107
also make sure to add to select CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH=m
That explains why my tests did not succeed. I will have a look.
Cherry-picking the given commits on top of 5.15.7 gives errors... I will investigate tomorrow.
Ok, I tried with...
Rebooted trice, with different firmware files in place. Still no sound. 😢
Can you please add this file sof-dyndbg.conf.txt as /etc/modprobe.d/sof-dyndbg.conf, reboot and attach the entire 'dmesg' log? This will enable dynamic debug on the modules we care about. thanks!
See attached dmesg.log.
BTW, system now panics on shutdown.
Does it help if I prepare a live system and give access to the system?
Ah, thanks for the log.
Doesn't look like there are any dmics handled in your system
[ 8.110772] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: physical link dmic01 (id 1) not exist
[ 8.110774] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: topology: could not load header: -22
[ 8.110825] sof-audio-pci-intel-cnl 0000:00:1f.3: error: tplg component load failed -22
[ 8.110831] sof-audio-pci-intel-cnl 0000:00:1f.3: error: failed to load DSP topology -22
[ 8.110832] sof-audio-pci-intel-cnl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
but they are indeed detected in the hardware
[ 7.850139] sof-audio-pci-intel-cnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[ 7.850158] sof-audio-pci-intel-cnl 0000:00:1f.3: intel_nhlt_get_dmic_geo: found 2 format definitions
[ 7.850159] sof-audio-pci-intel-cnl 0000:00:1f.3: intel_nhlt_get_dmic_geo: max channels found 2
[ 7.850161] sof-audio-pci-intel-cnl 0000:00:1f.3: intel_nhlt_get_dmic_geo: Array with 2 dmics
[ 7.850162] sof-audio-pci-intel-cnl 0000:00:1f.3: intel_nhlt_get_dmic_geo: dmic number 2 max_ch 2
You should really not have any card created. can you confirm @eworm-de that 'aplay -l' shows nothing.
The good thing is that we have a quirk to test options
Can you try with the following option in /etc/modprobe.d/alsa-base.conf
options snd-soc-sof-es8336 quirk=0x20 (with SSP0 topology) options snd-soc-sof-es8336 quirk=0x21 (with SSP1 topology) options snd-soc-sof-es8336 quirk=0x22 (with SSP2 topology)
This may work with the headphone, for the speakers there may be additional work needed, on some platforms there's a GPIO. The following may be used instead.
options snd-soc-sof-es8336 quirk=0x30 (with SSP0 topology) options snd-soc-sof-es8336 quirk=0x31 (with SSP1 topology) options snd-soc-sof-es8336 quirk=0x32 (with SSP2 topology)
Make sure you are not using loud files when testing and never ever put a headphone over your ears before a test. Keep in mind that such experiments may blow your ears or your speakers, or both. All standards disclaimers apply.
Actually also provide the acpi table dump as attachment, I should be able to find the right SSP from ACPI stuff
'sudo acpidump > cml-dump.bin' and gzip/attach the result.
Here we go... See cml-dump.bin.gz. I will have a look at the other stuff any time soon.
@eworm-de from what I see in the table with the latest version of acpica-tools (20210930), the SSP0 seems to be used.
/* Endpoint Descriptor #2 */
[1769h 5993 4] Descriptor Length : 000000AB
[176Dh 5997 1] Link Type : 03 [Type SSP]
[176Eh 5998 1] Instance Id : 01
[176Fh 5999 2] Vendor Id : 8086
[1771h 6001 2] Device Id : AE34
[1773h 6003 2] Revision Id : 0001
[1775h 6005 4] Subsystem Id : 00000001
[1779h 6009 1] Device Type : 04
[177Ah 6010 1] Direction : 00 [Render]
[177Bh 6011 1] Virtual Bus Id : 00 <<< This is the SSP Port
so you'd need to make sure the SSP0 is used in the topology and machine driver. Note that the tool seg faults on this config so take the information with a grain of salt.
So, is there any working patches right now? I am willing to test any potentially working solutions, as i have Huawei Matebook D16 2021 and no sound
I bought a Huawei Matebook D14 and didn't know that.. I'm actually living without sound, and waiting for a solution, please give us a patch ! :((
Also, the name of issue is about Intel-based PCs, but i have an AMD-based Matebook and sound doesn't work AFAIK
@Timarrr
Also, the name of issue is about Intel-based PCs, but i have an AMD-based Matebook and sound doesn't work AFAIK
here's issue for amd version https://github.com/thesofproject/linux/issues/3249
@playXE Oh, thanks
Can you try with the following option in /etc/modprobe.d/alsa-base.conf
options snd-soc-sof-es8336 quirk=0x20 (with SSP0 topology)
With the quirk (either 0x20 or 0x30), the speaker started to work on MateBook D15 (Product Name: BOHB-WAX9). The microphone is marked as unavailable. Plugging a headphone also cuts the output. So, it sounds that the topology is not quite right, but at least it is starting to give life signs ;-)
PS.: I applied the relevant patches on the top of 5.15.11: https://github.com/mchehab/linux/tree/sound-es8336, and I'm using this topology firmware: sof-cml-es8336-0.tplg
Sound logs enclosed.
I can confirm what @mchehab wrote. I have exactly the same device (MateBook D15 BOHB-WAX9
) with identical behavior.
Looks like I borked the code when cherry-picking. This time I used his tree (but dropped the Fedora patches and applied to Arch Linux linux 5.15.11.arch2-1
). Also the panic on shutdown is gone.
I can confirm what @mchehab wrote. I have exactly the same device (MateBook D15
BOHB-WAX9
) with identical behavior.
Nice to have another test on it.
Btw, with this patch:
https://github.com/mchehab/linux/commit/d560a1c76edb633c37acf04a9a82518b6233a719
the speaker will work properly without needing to pass a quirk=0x20
parameter to snd_soc_sof_es8336
via modprobe.d
. All it is needed for it to work is to set to SSP0.
Looks like I borked the code when cherry-picking. This time I used his tree (but dropped the Fedora patches and applied to Arch Linux
linux 5.15.11.arch2-1
).
FYI, I opted to place the Fedora patch there just to warrant that no regressions outside sound would happen. Usually, distro-specific patches are not required, but, as this is a new device, I added it anyway, just in case ;-)
Also the panic on shutdown is gone.
Yeah, it sounds that there's something wrong at the error path... if SSP2 is selected on this device, despite the modprobe errors, it hits an OOPS during device unbind. maybe an use-after-free or something like that. Haven't time to check exactly why it is happening.
You should boot the DSP and reach the point where a topology file is missing.
You will have to try each of the files in this zip cml.tar.gz
Please try with sof-cml-es8336-0.tplg copied as /lib/firmware/intel/sof-tplg/sof-cml-es8336.tplg, then 1 and 2. We need this trial-and-error method to figure out where the codec is attached to (I2S/SSP interface 0 1 or 2).
At least for Intel Matebook D15 (2021 version, afaikt), the codec is attached to I2S/SSP 0. Yet, as only the speaker is working (neither internal mic nor headset works), I suspect that something else could be missing at the topology file. How those sof-cml-es8336-[0-2].tplg
files were generated? Could the topology be inferred from the ACPI BIOS or from the windows .inf files?
Has someone tried linux 5.16 out? On the amd issue someone said the driver will come with the next kernel release.
EDIT 2: Linux 5.16 is out. Can someone please check if the problem is fixed?
@mchehab the topologies are generated with a macro, see https://github.com/thesofproject/sof/blob/main/tools/topology/topology1/CMakeLists.txt#L166 I generated the CML topologies with a local change, it's not released yet.
It would indeed be best to use information from ACPI instead of starting an endless list of quirks and random topologies
For the SSP used and topology, I tried to see if the information from NHLT is usable, please see https://github.com/thesofproject/linux/pull/3338. if you try it on your device it should also detect SSP0 being used.
unfortunately, we have no way of detecting how the GPIOs are configured, or rather I don't know how we might infer which GPIOs are used for what, so there might still be a need for quirks there.
EDIT 2: Linux 5.16 is out. Can someone please check if the problem is fixed?
just did in https://github.com/thesofproject/linux/issues/3365 but it didn t work on my Gemini Lake Kuu Yobook M looks like if you are lucky then the correct "interface" is chosen by the "current system" and it ll work ...
now the sof project wants to guess the correct "interface" with https://github.com/thesofproject/linux/pull/3338 (linux kernel changes that thorvalds have to accept ... maybe I ll try to merge and compile if I feel l have the time and energy ...)
PS for myself : . here are some instructions on how to create the 3 kernel .deb files from the sof project : https://thesofproject.github.io/latest/getting_started/build-guide/build-from-scratch.html#step-6-build-linux-kernel ... ... oops a precompiled custom kernel seems to be already available here : https://github.com/thesofproject/linux/issues/2955#issuecomment-1010654476
@pierro78 would that kernel work with CML?
@playXE maybe check what they are saying about issues with CML in https://github.com/thesofproject/linux/pull/3338 (I have GML so I didn t read it)
@playXE @dattiluca I installed 5.16 kernel (with Ubuntu 22.04) with CML my sound card is not recognized. Alsa info: http://alsa-project.org/db/?f=b47d70cceb570c0ccf77e1f9187e96f8c1e8c427
@butavicius your card is recognized but the quirk you added is not compatible with the topology file you used
[ 4.178290] sof-essx8336 sof-essx8336: Overriding quirk 0x2 => 0x20
that forces DMIC to be enabled,
but then kaboom you don't have dmic support. [ 4.179416] sof-essx8336 sof-essx8336: ASoC: failed to load widget DMIC0.IN
try quirk=0x0 or 0x10
@plbossart I have tried with 0x0, 0x10, 0x20, 0x21, 0x22, 0x30, 0x31, 0x32 with no luck. After each alsa-base.conf edit i ran sudo alsa force-reload and alsa-info. After each change, it was reflected in alsa-info ALSA/HDA dmesg
part. Last alsa-info has info on all these variations:
options snd-soc-sof-es8336 quirk=0x22 http://alsa-project.org/db/?f=c7c104e91b961b6f344d654973fb140fcda95857
options snd-soc-sof-es8336 quirk=0x21 http://alsa-project.org/db/?f=13d24fceaaf4c7cda65d8602c9694e76f7f55457
options snd-soc-sof-es8336 quirk=0x20 http://alsa-project.org/db/?f=56771297c61a7a304c54b7c2f79e875e3b6e1cb7
options snd-soc-sof-es8336 quirk=0x0 http://alsa-project.org/db/?f=a3aaace401351503233f73928f69739f6558c4d9
options snd-soc-sof-es8336 quirk=0x32 http://alsa-project.org/db/?f=d22e1b0744d584108944ce49a4edb7aa6ba5ffb0
options snd-soc-sof-es8336 quirk=0x31 http://alsa-project.org/db/?f=d61f4414e488890090fd1cb656403fd657214964
options snd-soc-sof-es8336 quirk=0x10 http://alsa-project.org/db/?f=9cd398148eb53435fdb4f4ae5635c1e588f6ad57
options snd-soc-sof-es8336 quirk=0x30 http://alsa-project.org/db/?f=246d37b398b99e1e8136beaee000a588e679d87b
P.S. I really don't know what i'm doing so I can try whatever you need me to, but you'd have to walk me through it, thanks.
@butavicius it's just too difficult to provide support like this, I am working on a better solution with no quirks. stay tuned.
Not sound matebook 14 (intel) linux kernel 5.16
same problem on matebook 16 d with ryzen 5 4600. is it possible to expect that drivers will be written at least in kernel version 5.16 in January 2022? maybe spam the huawei mailbox with a request? ;-(
I am experiencing similar issues on the Huawei Matebook D15 - Intel i3-10110U. Sound output devices is only showing 'Dummy Output', and input is not showing any devices at all.
OS: Ubuntu 20.04.3 LTS (Focal Fossa) Kernel 5.13.0-27-generic
@lennartvg you can update the kernel to the latest version 5.16 and you might get sound. This only works on matebooks with an Intel processor.
Moved from thesofproject/sof
Is your feature request related to a problem? Please describe. Huawei laptops ship with an Everest ES8336 sound card that is not supported by sofproject. Describe the solution you'd like Adding support for it would be really awesome Describe alternatives you've considered I already tried this repo which seems to contain a kernel built with support for it but the audio clearly does not work: https://github.com/himozzza/essx8336 Additional context Booting Linux and trying lsmod or dmsg shows only one valid HDMI sound output on the laptop and nothing more. Here's what I get from Device Manager on Windows: