yangxiaohua2009/custom-kernel

Sound stops working after waking up from suspend

Opened this issue · 21 comments

Thank you for creating this custom kernel, it fixed the no-sound issue on my Ubuntu 22.04 laptop (Geobook 240, Gemini lake). However, the sound stops working after the laptop wakes up from suspend until it is rebooted. It is frustrating as I need the laptop to frequently go in and out of suspend. Any ideas how this can be debugged?

You can try the new kernel here

Or alternatively, you may build your own kernel following the guid here pulse the 8316.c 8316_fix_5.19.zip under the folder sound/soc/codecs

This is a fix that won't be upstreamed.

I have tried the new kernel you shared (thank you!), but it didn't fix the issue: the sound still doesn't work after waking up from suspend. The only thing I can hear is some white noise from the speakers.

Please try the new kernel here.
If there is still no sound, attach your registers (sudo cat /sys/kernel/debug/regmap/i2c-ESSX8336\ :00/registers)

This fix works. I will have to build my own kernel as the wifi doesn't work with the fix. What do I need to change? Many thanks!

Please replace sound/soc/codecs/es8316.c with the file.
8316.zip

You need to use kernel version 5.18 or above for your own kernel.

Thank you! The newly built 5.19 kernel worked nicely. There is still one more small issue that the volume is very small after reboot. I have to use alsamixer to turn it up but it resets after each reboot. Is there a way to keep the volume settings to persist cross reboots?
Screenshot at 2022-08-12 20-19-38

You may use the command
echo '(sleep 16; amixer sset Headphone 3,3) &' >> ~/.profile
to write (sleep 16; amixer sset Headphone 3,3) & into your ~/.profile

Alternatively, you may edit /usr/share/alsa/ucm2/sof-essx8336/HiFi.conf
or /usr/share/alsa/ucm2/sof-essx8336/conf.d/HiFi.conf
add cset "name='Headphone Mixer Volume' 999,999"
into EnableSequence
sof-essx8336.zip

The first solution works great. The second one doesn't seem to apply to my case as the statement is already in the file. Thanks!

@yangxiaohua2009 I added your es8316.c to my kernel and it works! I am so happy haha. Is it possible to make a DKMS module for this?

@yangxiaohua2009 why not contributing the es8316.c changes upstream instead of maintaining your own kernel? That will save you time in the end....

@yangxiaohua2009 hi guyz i appriciate your great job
I have huawei matebook 15d model BOHB_WAX9 intel cometlake i5-10210u sound essx8336
When i add quirk 0x30 into /etc/modeprob.d/alsabase.conf then only working headphone is not working speaker when i use quirk 0x20 the speaker is working
No headphone i don't know what issue i have
please help me
It is my alsa-info
alsa-info.txt

@ameenjuz Please use kernel version 5.19 or above. Then remove the quirk and write down the default quirk, say 0x02.
Then set the quirk to be 0x02 | 0x80, i.e. 0x82.
Then qurik BIT(7) need to be turned on to enable both headphone and speaker

@yangxiaohua2009 thanks for quik reply
I didn't understand where i can put default quirk and how to turn on quirk bit 7
for to enable headphone and speaker which one portion i found line 33 do i remove # hash tag only from line 33 ? which is definde bit 7
Yes i m running kernel 5.19 and 5.19.4 which i compiled
I attached screen shot
Please tell me clearly and thick the mark where need to be change
Screenshot from 2022-08-30 06-29-30
Screenshot from 2022-08-30 06-37-31
I attached also sof_es8336.c file from kernel 5.19.4
sof_es8336.zip
Please tell me how to edit line 33 88 112 302 from sof_es8336.c

A simple modify is enough.

dmi_check_system(sof_es8336_quirk_table);
quirk |= SOF_ES8336_HEADPHONE_GPIO;
if (!mach->mach_params.i2s_link_mask) {
sof_es8336.zip

@ameenjuz

@yangxiaohua2009 thanks
Did you modified above attached file?
Can i replace this into /sound/soc/intel/boards/sof_es8336.c
Please edit for me then i replace and rebuild the kernel again

Recompiled 5.19.0 after downloading your 8316_fix_5.19.zip, replacing the driver, and sound after suspend works. Many, many thanks for your hard, successful work.

Is there a reason you don't enable 32-bit in your .config? I couldn't figure out why my Wine wouldn't work until I tracked it down to that.

Again, thank you for solving this difficult problem.

Hi, on my gentoo installation it used to works only once. These are my alsamixer's screen and sof-dynamicbug's dmesg

Screenshot_20221122_114800

sof.log

Any idea? I've followed step-by-step your guide on README except for kernel as it used to works on 6.0.9

The log looks ok. Please use ucm or shell script to update the alsamixer controls. Basically the volume is too low.
ucm.zip
4.zip

The log looks ok. Please use ucm or shell script to update the alsamixer controls. Basically the volume is too low. ucm.zip 4.zip

Running 4.sh

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

amixer: Cannot find the given element from control default

You may want to add -c 0 behind the amixer
amixer -c 0 ... or amixer -c 1 ...

Now it works again 😄

EDIT: It works but it is very quiet
EDIT 2: I have to manually change the volume in headphone in alsamixer to make it working