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] No sound on AMD Ryzen 5 4600H + ES8336 codec #3249

Open
IlyaSkriblovsky opened this issue Oct 29, 2021 · 99 comments
Open

[BUG] No sound on AMD Ryzen 5 4600H + ES8336 codec #3249

IlyaSkriblovsky opened this issue Oct 29, 2021 · 99 comments
Labels
AMD codec ES8336 codec Codec HW or driver restriction enhancement New feature or request

Comments

@IlyaSkriblovsky
Copy link

I have Matebook D 16 AMD laptop with Ryzen 5 4600H and ES8336 I2S codec chip.

Speakers, headphones and microphone are not recognized at all. Only the "Dummy output" is visible in GUI sound settings and only HDMI outputs are visible in aplay -l.

I've tried to build the kernel from topic/sof-dev (on 2021-10-28) with #3107 on top, but it didn't help. Attached logs are collected with that kernel build and with dyndbg=+p enabled for most snd modules.

Thanks for attention!

alsa-info: http://alsa-project.org/db/?f=30a1156b94b7749f02229ee19487dc36adb9d506
dmidecode.txt
dmesg.txt
lsmod.txt
aplay-l.txt
arecord-l.txt

@plbossart
Copy link
Member

@ajitkupandey this is for you guys. I have enough on my plate with the same codec for Intel platforms :-)

@dantefff
Copy link

dantefff commented Nov 5, 2021

Hi! I'm in the same situation. I have a Matebook D 14 with a ryzen 4800H. I have a dual boot config so I can help with any tests you need.

@serjsaraev
Copy link

Same problem with Huawei Matebook d16

@bhiregoudar
Copy link

AMD platforms doesn't have a support for ES8336 codec on Linux OS environment. There is no machine driver support available for this codec. As for as I Know, only windows OS support is available for ES8336 codec.

@IlyaSkriblovsky
Copy link
Author

@bhiregoudar Yep, and this is the issue. Hoping someone familiar with kernel sound architecture will save us by writing machine driver :(

I've tried to figure out how to do it myself, but failed at the moment (I have some linux driver experience, but I'm completely new to the sound subsystem).

ES8336 seems to be working on LInux with @plbossart's #3107 PR and other patches on Intel platform in #3248. That makes me hoping that AMD support is not so hard problem. Hope AMD or Huawei folks, or maybe some smart enthusiast will eventually get this working...

@mengdonglin mengdonglin added codec Codec HW or driver restriction enhancement New feature or request labels Nov 15, 2021
@tomty89
Copy link

tomty89 commented Nov 15, 2021

I'm not sure if this is related to "AMD or not". #3107 (plus #2962 and #3212) doesn't really give me sound either when on my Celeron N5100 laptop (with the properly signed firmware).

I do get an analog alsa device but it only gives a pop when it is opened and closed. No idea if digital sound work though.

@IlyaSkriblovsky
Copy link
Author

@tomty89 there are several issues here about ES8336 and in one of them @plbossart replied that AMD support for ES8336 is another matter than Intel support: #2955 (comment)

@ps3vdo
Copy link

ps3vdo commented Nov 22, 2021

The problem is like everyone else, there is no sound on Linux. huawei matebook d16

@accountForIssues
Copy link

Same problem here with a Matebook 14 w/ Ryzen 4800H and the same 8336 chipset on Fedora 35. Using arecord -l, the microphone is recognized but not in Gnome. It's not able to record anything.

Live booting Deepin OS with Kernel 5.15, the microphone is recognized in the DE and seems to be working well.

Apparently, using Arch with Kernel 5.16 rc3, the microphone is able to record as well (here).

Speakers and the stereo jack don't work.

@Kemsekov
Copy link

Kemsekov commented Dec 4, 2021

Matebook d16 the same problem is here. This is sad how often manufacturers completely forgets about linux support.

@yimboka
Copy link

yimboka commented Dec 5, 2021

Matebook 14 with Ryzen 4800h , same problem here.

@ak4nv
Copy link

ak4nv commented Dec 5, 2021

The same for Matebook 14 AMD 2021 (Ryzen 5 5500U)

@rejjjer
Copy link

rejjjer commented Dec 6, 2021

I have the same problem on Matebook d 16 (Ryzen 5 4600H).

@george-martinec
Copy link

Same issue on DualBoot Windows 11 (Audio works) and Zorin OS 16 (Dummy output device)
AMD Ryzen 7 4800H with Radeon Graphics** (16 CPUs), 2,9Ghz


Linux Zorin OS 16 (Kernel 5.11.0-41-generic) | FRESH INSTALL (Updated via Zorin Software Updater)
No sound - Dummy output device
HDMI audio: works
Bluetooth audio: works
USB Audio: works (tested via Corsair Virtuoso RGB Wireless)
Jack: not tested

Windows 11 Bios Info
System Model: KLVL-WXX9
BIOS: 2.03


Windows 11 Sound Info
Name Speakers (AMD Audio Device)
Hardware ID: ACP\VEN_1022&DEV_15E2&AFD_0000
Drivers: amdacpafd.sys
Version: 6.0.0.10 (English)

@MorozovNikolay1995
Copy link

MorozovNikolay1995 commented Dec 13, 2021

The same problem on Huawei Matebook D16 with AMD Ryzen 5 4800H.
OS: Linux Mint 20.2 with kernel version 5.16.

@Timarrr
Copy link

Timarrr commented Dec 16, 2021

Same. Huawei Matebook D16 2021 w/Ryzen 5 4600H

@bhiregou
Copy link

It is better to raise a ticket or issue with Huawei so that Huawei can reach out to AMD for fix.

@IlyaSkriblovsky
Copy link
Author

It is better to raise a ticket or issue with Huawei so that Huawei can reach out to AMD for fix.

So far local Huawei support just answers "Sorry, Matebooks doesn't have official Linux support".

I've emailed a couple of linux sound subsystem contributors from AMD and Huawei but didn't got any response.

I don't know how to reach to Linux team inside Huawei or anybody other who can help us :(

@ak4nv
Copy link

ak4nv commented Dec 17, 2021

@IlyaSkriblovsky stop the panic :)

The next release of Linux kernel 5.16 will bring support to this codec. (planned on Jan,2022)
I think SOF project guys will close this issue too.

@superm1
Copy link

superm1 commented Dec 17, 2021

The next release of Linux kernel 5.16 will bring support to this codec. (planned on Jan,2022)
I think SOF project guys will close this issue too.

Intel and AMD support for this codec are two different things. Please see the other comment above:

There is no machine driver support available for this codec. As for as I Know, only windows OS support is available for ES8336 codec

AFAIK this way this codec is setup is unique to Huawei designs. It is up to them whether they want to support Linux or not. If they do, they can work with AMD to make it happen.

@ak4nv
Copy link

ak4nv commented Dec 17, 2021

@superm1 are you talking about this one ?

@superm1
Copy link

superm1 commented Dec 17, 2021

this one

I was quoting earlier in the thread. That's the one for Intel's platforms.

@IlyaSkriblovsky
Copy link
Author

@ak4nv It certainly won't work in 5.16 since upstream kernel doesn't support AMD+ES8336 and merge window is already closed.

@superm1 Is it feasible to someone outside of Huawei to ever make the platform driver? I might be ready to invest some time to make myself familiar with the SOF architecture, but can it ever be done without technical documentation from Huawei? Or I will probably will get stuck without some magic constants?

@superm1
Copy link

superm1 commented Dec 17, 2021

I think you misunderstood my comment to be Huawei needs to write the driver. Their engineering team would need to collaborate together w/ teams at AMD and Everest on the full solution which would involve development or modifications of multiple components. Let me put it this way - if they don't want to support Linux for their products then AMD's development of some components for the solution would be a wasted effort.

@superm1 Is it feasible to someone outside of Huawei to ever make the platform driver? I might be ready to invest some time to make myself familiar with the SOF architecture, but can it ever be done without technical documentation from Huawei? Or I will probably will get stuck without some magic constants?

@bhiregou can correct me if I'm wrong - but I don't believe SOF is actually a requirement for this.

@Timarrr
Copy link

Timarrr commented Dec 21, 2021

So what should fellow AMD users do?

@bhiregou
Copy link

Yes, SOF is not the requirement for this.

@IlyaSkriblovsky
Copy link
Author

@superm1 @bhiregou I would be very grateful if you point me in the right direction: corresponding docs, another similar platform driver, etc. Thanks!

@hakanrw
Copy link

hakanrw commented Oct 30, 2022

Fedora 36, kernel 6.0.5

Issue persists :/

@bandundu
Copy link

bandundu commented Oct 30, 2022

I was so excited to use the Matebook 14 2021 AMD to get the best customized laptop experience.... welp no sound sadly.

If anyone is interested in getting their MICs working, I got it working with following link:

https://forums.linuxmint.com/viewtopic.php?t=373391

Still waiting for a speaker fix and im open for testing

@stealth-program
Copy link

@bandundu can you clarify what exactly did you got working? Only microphone? Or speaker too?

@bandundu
Copy link

@stealth-program Only the microphone is working as of now.

@DioEgizio
Copy link

I received a call from Huawei today.

Like others mentioned, their team still has no plans on supporting Linux whatsoever.

However, they said AMD team is working on the issue. This combined with recent commits to the kernel from AMD, makes me hopeful

Sad that that didn't go anywhere :/
Such a shame Huawei doesn't want to support linux

@yimboka
Copy link

yimboka commented Jan 7, 2023

You can try this : https://github.com/codepayne/linux-sound-huawei
from https://bugzilla.kernel.org/show_bug.cgi?id=215119

@AlexUkr73
Copy link

Kernel patch developer (Marian) celebrated New Year 2023 in a very original manner ;o)

Has anybody tried the patch from links above [yimboka's post)?

@hakanrw
Copy link

hakanrw commented Jan 7, 2023

i have compiled the kernel patch by Marian, although unfortunately the problem persists on my system (D15 Ryzen 5 5500U)
i contacted them via e-mail, and i am currently waiting for their response. Marian mentioned there are different hardware combinations, so it might need some tweaking until the problem is solved.

even though some models do not work just yet, they will eventually. this is huge news for us.

thanks, Marian. you did what companies could not do.

@AlexUkr73
Copy link

@hakanrw
It will be the good idea to build the minimal live USB iso with this patched kernel and share it.
This can help to quickly figure out all possible hardware combinations (working/not).
Moreover - not all notebook owners are mastered in applying patch and building kernel (like me).

Just some instruction should be added in such live ISO - what commands should be executed and where to send their output. And, of cause - status - working or not.

@martyn0ff
Copy link

I have compiled the patch as well and on MateBook D16 that didn't yield much success either. The only change I had noticed is some new HDMI entries appeared in pavucontrol. I have emailed Marian, waiting eagerly for his response too.

@yimboka
Copy link

yimboka commented Jan 7, 2023

With my Matebook D16 (Ryzen 7 4800H) , I have sound (right/left), headphone from jack works too.
As he said to me :

Because` of issues with AMD drivers for ACP controller the wrong driver
may be loaded for your laptop. I would recommend to blacklist the wrong
drivers and explicitly load the correct drivers at startup:

Modify /etc/modprobe.d/blacklist.conf and add the following lines:
blacklist snd_acp3x_rn
blacklist snd_pci_acp5x
blacklist snd_rn_pci_acp3x

Modify /etc/modules-load.d/modules.conf and add the following lines:
snd_soc_es8316
snd_acp3x_pcm_dma
snd_acp3x_i2s
snd_pci_acp3x
snd_soc_acp3x_es8336_mach`

During first load of sound card driver the settings of the card are
wrong and no sound can be heard, you have to go in alsamixer, select
the new sound card amd-acp3x-essx8336 and in the playback tab change
to maximum value the following knobs:
Master, Headphone Mixer, DAC
Enable the following knobs:
Left Headphone Mixer Left DAC, Right Headphone Mixer Right DAC
After doing these changes you should be hearing the sound.

If you want to have the headset microphone work, you have to change once the settings in alsamixer in the capture tab to maximum value:
Headphone Mixer, ADC

@martyn0ff
Copy link

martyn0ff commented Jan 8, 2023

@yimboka Mine is AMD Ryzen 5 4600H. Your suggestion unfortunately didn't work. Did you compile driver as module (m) or built-in (y)? Kernel boots fine, but no sound is produced still. I notice that snd_soc_acp3x_es8336_mach module is not loaded, and when I try to load it manually, I get modprobe: ERROR: could not insert 'snd_soc_acp3x_es8336_mach': No such device.

EDIT: dmesg says: [ 21.051057] amd-acp3x-essx8336 amd-acp3x-essx8336.0: this system has a ES8336 codec defined in ACPI, but the driver doesn't have this system registered in DMI table

@yimboka
Copy link

yimboka commented Jan 8, 2023

I compile as module. I think driver need few modifications to work for all configurations. Marian may help you.

@martyn0ff
Copy link

martyn0ff commented Jan 8, 2023

Update: I got it working! Use dmidecode to find out DMI values and add them to sound/soc/amd/acp3x-es8336.c. Mine looked like this:

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: HUAWEI
	Product Name: HVY-WXX9
	Version: M1040
	Serial Number: [redacted]
	UUID: [redacted]
	Wake-up Type: Power Switch
	SKU Number: C171
	Family: MateBook D

Then follow @yimboka's advice. After those manipulations the sound works! This is surreal. See https://github.com/codepayne/linux-sound-huawei/pull/2/files for an example on how to add your card. I claim no responsibility for the consequences of this advice. ;-)

P.S. Headphone jack doesn't seem to work.

@hakanrw
Copy link

hakanrw commented Jan 8, 2023

i now followed @yimboka's steps. i can hear noise from both of my speakers now, but it's all static white noise. no other sound can be heard.

@nkhost
Copy link

nkhost commented Jan 8, 2023

@martyn0ff I have compiled kernel with patch and your commit. Sound works on my Matebook D16 with AMD Ryzen 5 4600H! But now builtin microphone not working. Maybe something wrong in alsamixer settings or in pulseaudio config. Do you have a problem with builtin microphone, or it works?
Headphone jack doesn't works too.

@yimboka
Copy link

yimboka commented Jan 8, 2023

@nkhost Internal microphone doesn't work for the moment with this driver.

@codepayne
Copy link

Since I see a lot of people are discussing the support for Huawei laptops with AMD and ES8336 codec here, I will paste the instructions here on how to make sound work on these laptops. If the latest commit from the master branch from the repo https://github.com/codepayne/linux-sound-huawei doesn't fix your sound, raise an issue there.

To enable the driver you have to enable the following kernel config
options:
SND_SOC_AMD_ACP3x, SND_SOC_AMD_ACP3x_ES8336_MACH, SND_SOC_ACPI,
SND_SOC_ES8316

There are a few issues with this driver:

  • The internal microphone(not the one from the headphones, the one inside the laptop) doesn't work

  • If suspending the laptop with the Headphones plugged in the jack, at resume time the sound will stop working.

  • It may be possible in rare cases for the sound to stop working after
    suspend/resume (this can be fixed by restarting pulseaudio), though in my testing this doesn't happen.

  • Because of issues with AMD drivers for ACP controller the wrong driver
    may be loaded for your laptop. I would recommend to blacklist the wrong
    drivers and explicitly load the correct drivers at startup:

    Modify /etc/modprobe.d/blacklist.conf and add the following lines:
    blacklist snd_acp3x_rn
    blacklist snd_pci_acp5x
    blacklist snd_rn_pci_acp3x

Modify /etc/modules-load.d/modules.conf and add the following lines:
snd_soc_es8316
snd_acp3x_pcm_dma
snd_acp3x_i2s
snd_pci_acp3x
snd_soc_acp3x_es8336_mach

  • During first load of sound card driver the settings of the card are
    wrong and no sound can be heard, you have to go in alsamixer, select
    the new sound card amd-acp3x-essx8336 and in the playback tab change
    to maximum value the following knobs:
    Master, Headphone Mixer, DAC

    Enable the following knobs:
    Left Headphone Mixer Left DAC, Right Headphone Mixer Right DAC
    After doing these changes you should be hearing the sound.

    If you want to have the headset microphone work, you have to change
    once the settings in alsamixer in the capture tab to maximum value:
    Headphone Mixer, ADC

@Sever-IN
Copy link

How to compile the kernel correctly?
I'm not very good at this subject. After creating the .config via make menuconfig, I tried to compile the kernel via the "make -j12" command, at first it gave the error "there is no rule for building the debian/canonical-certs.pem target required for certs/x509_certificate_list", removing SYSTEM_TRUSTED_KEYS and SYSTEM_REVOCATION_KEYS from the config, compilation was successful, though the folder with the kernel weighed about 20GB, which is very strange. Next, I used "make modules" "sudo make modules_install" "sudo make install", the kernel appeared in the grub bootloader, but I can't boot from it. What am I doing wrong?

@nkhost
Copy link

nkhost commented Jan 11, 2023

@Sever-IN I can send you the compiled kernel in a deb package for ubuntu/kubuntu or tell you how to build kernel. My email spiniks@gmail.com

@outbreak
Copy link

What do I need to do to check the solution by @codepayne for my HUAWEI KLVL-WXXW on Fedora 37, kernel 6.0.18?

@codepayne
Copy link

codepayne commented Jan 11, 2023

Lets move the discussion to https://github.com/codepayne/linux-sound-huawei/wiki It doesn't make sense to continue the discussion on the sof repos since the final solution for this driver will not use sof.

@stafuz
Copy link

stafuz commented Jan 20, 2023

Compiled and installed new kernel from @codepayne . Sound speaker working, internal mic not (hope soon). Headphone is working with mic. Suspend and resume with no problems at all. Driver stable and sound clear. My system is a Matebook 14 Amd 2020 KLVL-WXX9 M1010. Congratulation developers for the patches!

@doompwnz
Copy link

Compiled and installed new kernel from @codepayne . Sound speaker working, internal mic not (hope soon). Headphone is working with mic. Suspend and resume with no problems at all. Driver stable and sound clear. My system is a Matebook 14 Amd 2020 KLVL-WXX9 M1010. Congratulation developers for the patches!

Hello. Please tell me how to install this patch or kernel, I don't understand. Thanks in advance

@stafuz
Copy link

stafuz commented Jan 24, 2023 via email

@stafuz
Copy link

stafuz commented Jan 27, 2023

The kernel 6.1.3. has a lot of problems with suspend and resume on Amd systems. Can we update the kernel source from @codepayne to a newer version maybe 6.1.8. and when the internal mic will work as expected? Let me know. Thanks

@stafuz
Copy link

stafuz commented Jan 28, 2023

Compiled with the latest kernel 6.2 from gregkh. Now suspend and resume works. Sound is ok, internal mic not. Backlisting and loading drivers as described in wiki documentation by @codepayne not necessary. Good luck!

@codepayne
Copy link

@stafuz As I mentioned above lets not discuss my patches on the sof project, since there is no relation between them. Please create an issue on the linux-sound-huawei repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMD codec ES8336 codec Codec HW or driver restriction enhancement New feature or request
Projects
None yet
Development

No branches or pull requests