-
Notifications
You must be signed in to change notification settings - Fork 128
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 for Intel Cannon Lake PCH cAVS on Lenovo IdeaPad S740 #2748
Comments
I think it might be related to my issue #2302, I have c940 |
@hweom if you can compile 5.8-rc5, can you try with the SOF development kernel? https://github.com/thesofproject/linux.git branch topic/sof-dev I don't see a smoking gun here. |
I'll try it, although I don't have experience building a custom kernel on Manjaro (5.8-rc5 is in Manjaro's testing branch repos), so it'll probably take some time. |
I've downgraded |
@hweom Can you pls provide output of alsa-info.sh when you're doing playback by the speaker although you cannot hear the sound? |
@xiulipan - do we have the wrong LDC file for the ICL 1.5.1 binary ? maybe the sof-bin makefile should validate this as a rule. |
alsamixer does show a master channel that is not enabled by default: However even I if max it out, there is still no sound. (Also there is nothing more on the right.) All the information above is for alsa 1.2.3.2-1. |
@lgirdwood Not sure yet. I did not do any test, I will try to do some check for the binary on 1.5.1 release. |
@hweom @lgirdwood I am a little confusing here, so what FW should be used on S740 if it is Cannon Lake PCH? @hweom Could you try to use sof-cnl.ldc instead? and dump the log from |
@hweom please copy the attached file as /etc/modprobe.d/sof-ddebug.conf and re-attach the dmesg log. I don't get why we are talking about icl firmware, and the logs with dynamic debug will tell us exactly what the SOF driver does. |
@plbossart here it is. Unfortunately, the beginning of the log got truncated, so not sure if any interesting information was lost. |
@hweom yeah, all the initial stuff is lost...You seem to have a very chatty kernel configuration. |
@plbossart done: |
@xiulipan I think the last log confirms that we're indeed using sof-cfl.ri. I actually don't remember where I got the LDC file in my original file -- but sorry for the confusion! Also, here is output from
|
@hweom It seems nothing wrong with dmesg and logger logs. Can you try to play with the alsamixer setting to check if any codec setting may benefit for your case. @RanderWang have we do any test with the ALC285 codec? |
Wondering if this is the same issue as #1917, can you try the recipe that fixed it?
|
Thanks for the suggestions! I can confirm that doing
enabled the headphones output. (I believe the second command is the same as setting the Master channel via However, the speakers are still not working. Here is the output of
|
@hweom maybe try playing with what's disabled (AutoMuteMode) and what's on (SPDIF) to see if this changes anything. |
Yields no effect. Changing SPDIFs to off didn't really change anything either (although I didn't try all the permutations):
As an interesting datapoint, I just tried Ubuntu 20.04 live image and it had headphones working out of the box, but not speakers. I can't try Windows, since my laptop is not dual-booting and there is no way to boot windows live, at least not that I know of. |
Can you dump the mixer contents with the live image and compare with what you have here? It's clearly a configuration issue. |
Yes, here is the diff: http://www.mergely.com/pCTbN8wW/ Ubuntu 20.04 is on the right, my system is on the left. Master is on by default in Ubuntu, but off by default for me. This explains why headphones work in Ubuntu out of the box. Again, speakers don't work in both systems. |
I just checked it on a live WinPE image, and speakers work in Windows. So at least we know for sure this is not a broken device. |
@hweom when you say 'speakers don't work w/ Linux', is this some of the speakers don't work or none of the speakers work? https://bugzilla.kernel.org/show_bug.cgi?id=203409 |
Thanks @plbossart , I'll look at those bugs for potential insights. To clarify, in my case, none of the internal laptop speakers work. |
Looks like this kernel bug is exact match for my situation: |
ALC285 ? I have no idea about it. |
I found a fix related to this From d5d720ae68d713f78afc4f8bf0e0897bb2ccf33c Mon Sep 17 00:00:00 2001
From: Kailang Yang <kailang@realtek.com>
Date: Wed, 29 Jul 2020 15:09:27 +0800
Subject: [PATCH] ALSA: hda/realtek - Fixed HP right speaker no sound
HP NB right speaker had no sound output.
This platform was connected to I2S Amp for speaker out.(None Realtek I2S Amp IC)
EC need to check codec GPIO1 pin to initial I2S Amp.
Signed-off-by: Kailang Yang <kailang@realtek.com>
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e95fea8430b0..8afd7e07129c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5963,6 +5963,16 @@ static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
}
+static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ if (action != HDA_FIXUP_ACT_INIT)
+ return;
+
+ msleep(100);
+ alc_write_coef_idx(codec, 0x65, 0x0);
+}
+
/* for hda_fixup_thinkpad_acpi() */
#include "thinkpad_helper.c"
@@ -6143,6 +6153,7 @@ enum {
ALC289_FIXUP_ASUS_GA401,
ALC289_FIXUP_ASUS_GA502,
ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
+ ALC285_FIXUP_HP_GPIO_AMP_INIT,
};
static const struct hda_fixup alc269_fixups[] = {
@@ -7375,6 +7386,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
},
+ [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc285_fixup_hp_gpio_amp_init,
+ .chained = true,
+ .chain_id = ALC285_FIXUP_HP_GPIO_LED
+ },
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7525,7 +7542,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
- SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
+ SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
I've updated to 5.8.0-1 and just saw this in
Not sure if it's relevant and whether this error was also in the previous kernel. (And audio situation is still the same with new kernel.) |
I've tried applying this fix to my system (with relevant changes) and confirmed that it's applied, but the speaker sound is still muted:
(I wasn't sure which PCI device IDs are used from this:
so I added both.)
So I know the code works. The change seems to have some effect though: I now have a new scontents entry:
I've tried setting it to all possible values without any noticeable difference. Any clues on how to debug this further? I can do some experiments, but I have no idea how the sound works in Linux/SOF. Tried to read up some docs, but quickly got overwhelmed :( |
From the postings above I created a shell script that simply throws the relevant verbs to the kernel. It works on my LENOVO Yoga S740 15IRH. But it is only a patch that has be re-runned whenever you restart the computer. Maybe this is a little help for other users. My setup is a Ubuntu Mate 20.4 with kernel 5.4.0-72-generic.
|
This is what I did. My first time rebuilding a patch for a kernel module. Was actually relatively easy and so far as worked flawlessly. Now I only need to do something (rebuild) when my system's kernel gets updated. I'm running Manjaro. |
Ok, I don't know if this is the place but I'm looking to finally end my troubles with audio on this particular computer and I would like to patch my kernel. I've done kernel upgrades (currently on 5.9.16 on Ubuntu 18.04) but no kernel patching. I'm really sorry if this is not the place for this kind of questions. Really grateful for your time and work. |
@AndreM-rbtcs you may want to take a look at the Ubuntu wiki https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel Once you've managed to install the kernel yourself, then you can patch it using either Hope this helps! |
Another option if you don't want to mess with patching the kernel (and re-patching for every new kernel update), is to make a service file that follows: #2748 (comment) |
Thank you, both @plbossart and @H-Park. I'll try the script to see if it actually works in my case and then decide between the service and the kernel patch. You've been very helpful. Edit: Not even the script worked for me, so probably not my issue and the kernel patch won't be a solution for me. Still get a dummy output and no input. Only fix I have found is disabling the mic with "options snd-hda-intel dmic_detect=0" so that speakers work. |
I don't believe the script will work if your OS is not reporting a sound card. What are all your kernel parameters? @tiwai Given 5.13 won't be out for about another month, and then longer still depending on what distribution people run, do you have any recommendations for what to do in the mean time? A github wiki guide? Have someone make a post on the official lenovo forum? Lenovo discontinued the laptop line in the issue title, but I'm sure the Intel Cannon Lake PCH cAVS is in other laptop lines currently on the market. |
Hallelujah. Finally, I have sound from the speakers in Ubuntu on my Ideapad s740. And I did it with minimal funny business and without having to compile or patch the kernel - see below. I extend my thanks and gratitude to all who helped to make this happen, especially @ryanprescott and @tiwai but also anyone and everyone who did their part. Ubuntu kernel package v5.13-rc1 was released two days ago (2021-05-09), and the fix is in there! YMMV, but in my case the machine is not my daily driver and I am comfortable trying such a build. I hit a snag with installing the kernel - the headers package had a dependency on libc6 2.33, and my build was Ubuntu 20.10 which has libc6 2.32. My solution was to upgrade to 21.4 Hirsute Hippo which comes with libc6 2.33. I also had to disable secure boot in my BIOS to boot the unsigned kernel. I believe another way around this is to self-sign the kernel which is something I have successfully done in the past, and which I would do again if I cared enough about secure boot which I currently do not (see above - this is not my main machine). I plan to reenable it when the signed version of the 5.13 package is released. Hopefully this package is stable enough to use until the full release. In the meantime I can always boot the earlier kernel which shipped with Hirsute Hippo. Hopefully Hirsute Hippo is stable as well...at least I have sound! |
[ Upstream commit 26928ca ] Lenovo Ideapad S740 requires quite a few COEF setups to make its speakers working. The verb table was provided from Ryan Prescott as the result of investigation via qemu: https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver BugLink: thesofproject/linux#2748 Tested-by: Ryan Prescott <ryan@cousinscomputers.net> Link: https://lore.kernel.org/r/20210416081211.20059-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 26928ca ] Lenovo Ideapad S740 requires quite a few COEF setups to make its speakers working. The verb table was provided from Ryan Prescott as the result of investigation via qemu: https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver BugLink: thesofproject/linux#2748 Tested-by: Ryan Prescott <ryan@cousinscomputers.net> Link: https://lore.kernel.org/r/20210416081211.20059-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 26928ca ] Lenovo Ideapad S740 requires quite a few COEF setups to make its speakers working. The verb table was provided from Ryan Prescott as the result of investigation via qemu: https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver BugLink: thesofproject/linux#2748 Tested-by: Ryan Prescott <ryan@cousinscomputers.net> Link: https://lore.kernel.org/r/20210416081211.20059-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Closing this issue since the fix is upstream. Again thanks @ryanprescott for your work! |
Hey guys, I was able to identify and remove the unnecessary coefs, and I'm left with the following:
I can confirm that both speakers are working perfectly on my Hackintosh. These should also work on Linux but someone should test it to verify. Thanks to @ryanprescott for the initial coefs. |
No way! What's the process you used to identify the necessary coefficients,
if you don't mind sharing?
Thanks,
Ryan
…On Mon, Jun 21, 2021 at 8:14 AM elmkzgirxp ***@***.***> wrote:
Hey guys, I was able to identify and remove the unnecessary coefs, and I'm
left with the following:
# Left speaker
0x20 0x500 0x24
0x20 0x400 0x41
0x20 0x500 0x26
0x20 0x400 0x2
0x20 0x400 0x0
0x20 0x400 0x0
0x20 0x4b0 0x20
# Right speaker
0x20 0x500 0x24
0x20 0x400 0x42
0x20 0x500 0x26
0x20 0x400 0x2
0x20 0x400 0x0
0x20 0x400 0x0
0x20 0x4b0 0x20
I can confirm that both speakers are working perfectly on my Hackintosh.
These should also work on Linux but someone should test it to verify.
Thanks to @ryanprescott <https://github.com/ryanprescott> for the initial
coefs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2748 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOWASRYPU3URJWTANG5WBBDTT4UJ3ANCNFSM4XLNKYYQ>
.
|
A lot of trial and error. I mainly had help from the HDA specification to better understand the commands being applied. First, I removed some duplicates and commands that are useless without a second additional command, i.e. a 0x5 verb is always followed by a 0x4 verb. Then I noticed
After reducing the commands, my speakers now activate instantly and at the same time, whereas before, it takes a while for the right speaker to activate after the left speaker is activated. |
475 verbs down to 14.... Impressive simplification @elmkzgirxp ! |
I still need to test it first on Linux in my free time. But if someone can test it for me, that would be great. |
stable inclusion from stable-5.10.38 commit e3a2982bf63fc00e42d46a6f8cd4e964cf11d438 bugzilla: 51875 CVE: NA -------------------------------- [ Upstream commit 26928ca ] Lenovo Ideapad S740 requires quite a few COEF setups to make its speakers working. The verb table was provided from Ryan Prescott as the result of investigation via qemu: https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver BugLink: thesofproject/linux#2748 Tested-by: Ryan Prescott <ryan@cousinscomputers.net> Link: https://lore.kernel.org/r/20210416081211.20059-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Chen Jun <chenjun102@huawei.com> Acked-by: Weilong Chen <chenweilong@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
BugLink: https://bugs.launchpad.net/bugs/1931637 [ Upstream commit 26928ca ] Lenovo Ideapad S740 requires quite a few COEF setups to make its speakers working. The verb table was provided from Ryan Prescott as the result of investigation via qemu: https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver BugLink: thesofproject/linux#2748 Tested-by: Ryan Prescott <ryan@cousinscomputers.net> Link: https://lore.kernel.org/r/20210416081211.20059-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
I've been getting a strange issue. From a fresh restart, the sound works just fine in whatever application I use. However, when I open a new application, the sound dies. For example (this happened today), I am running Spotify and the sounds works perfectly well but as soon as I open chrome, the sounds dies. Nothing particularly changes about the system, the output device remains the same. The sound comes back after a bit as well. Console output:
|
That looks like a completely different issue, @ameenshake please open a new issue. This is likely to be a userspace problem since there is a single output exposed by SOF. |
I have similar behaviour than @ameenshakesudo |
How to use in Hackintosh, did you build AppleALC by yourself? Can you find the use? |
|
@elmkzgirxp How to use it in Hackintosh? |
Describe the bug
No sound via speakers or headphones. Both speakers and headphones are detected correctly, I can control volume in
pavucontrol
and I can actually see how the sound bar is moving if a sound is played, but no sound comes out.To Reproduce
No special steps to reproduce (the issue is always there right after boot).
Reproduction Rate
100%
Expected behavior
Audible sound.
Impact
Showstopper.
Environment
(I haven't found a way to check which topology file I'm using.)
Screenshots or console output
dmesg:
dmesg.log
I unfortunately was not able to use sof-logger, since it kept giving me:
The text was updated successfully, but these errors were encountered: