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 for Intel Cannon Lake PCH cAVS on Lenovo IdeaPad S740 #2748

Closed
hweom opened this issue Jul 20, 2020 · 152 comments
Closed

[BUG] No sound for Intel Cannon Lake PCH cAVS on Lenovo IdeaPad S740 #2748

hweom opened this issue Jul 20, 2020 · 152 comments
Labels
bug Something isn't working CNL Applies to Cannonlake Community end-user or distro-reported issues I2S amplifier connected to HDA codec

Comments

@hweom
Copy link

hweom commented Jul 20, 2020

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

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).

(I haven't found a way to check which topology file I'm using.)

Screenshots or console output
dmesg:
dmesg.log

$ inxi -Fxz
System:    Host: ideapad Kernel: 5.8.0-1-MANJARO x86_64 bits: 64 compiler: N/A Desktop: Gnome 3.36.4 Distro: Manjaro Linux 
Machine:   Type: Convertible System: LENOVO product: 81NW v: Lenovo IdeaPad S740-15IRH Touch serial: <filter> 
           Mobo: LENOVO model: LNVNB161216 v: SDK0R32862 WIN serial: <filter> UEFI: LENOVO v: BKCN21WW(V1.03) date: 12/18/2019 
Battery:   ID-1: BAT1 charge: 47.7 Wh condition: 70.1/69.1 Wh (101%) model: 0x53 0x4D 0x50 0x00 0x32 0x30 0x PABAS0241231 
           status: Discharging 
CPU:       Topology: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 12.0 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 62431 
           Speed: 800 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
           9: 800 10: 800 11: 800 12: 800 
Graphics:  Device-1: Intel UHD Graphics 630 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: Lenovo driver: nvidia v: 440.100 bus ID: 01:00.0 
           Display: x11 server: X.org 1.20.8 driver: intel,nvidia unloaded: modesetting,nouveau resolution: <xdpyinfo missing> 
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.1.3 direct render: Yes 
Audio:     Device-1: Intel Cannon Lake PCH cAVS vendor: Lenovo driver: sof-audio-pci bus ID: 00:1f.3 
           Sound Server: ALSA v: k5.8.0-1-MANJARO 
Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel port: 4000 bus ID: 00:14.3 
           IF: wlp0s20f3 state: up mac: <filter> 
Drives:    Local Storage: total: 715.44 GiB used: 199.33 GiB (27.9%) 
           ID-1: /dev/mmcblk0 model: GE8QT size: 238.50 GiB 
           ID-2: /dev/nvme0n1 vendor: Samsung model: MZVLB512HBJQ-000L2 size: 476.94 GiB 
Partition: ID-1: / size: 122.54 GiB used: 11.48 GiB (9.4%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: swap-1 size: 15.62 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p1 
Sensors:   System Temperatures: cpu: 39.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 364 Uptime: 1h 28m Memory: 15.36 GiB used: 2.37 GiB (15.4%) Init: systemd Compilers: gcc: 10.1.0 
           Shell: bash v: 5.0.18 inxi: 3.0.37

I unfortunately was not able to use sof-logger, since it kept giving me:

$ sudo ./sof-logger -l /usr/lib/firmware/intel/sof/v1.5.1/sof-icl-v1.5.1.ldc -e
error: fw version in /usr/lib/firmware/intel/sof/v1.5.1/sof-icl-v1.5.1.ldc file does not coincide with fw version in /sys/kernel/debug/sof/fw_version file.
@Enerccio
Copy link

I think it might be related to my issue #2302, I have c940

@plbossart
Copy link
Member

@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.

@hweom
Copy link
Author

hweom commented Jul 20, 2020

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.

@hweom
Copy link
Author

hweom commented Jul 21, 2020

I've downgraded alsa-lib, lib32-alsa-lib, alsa-topology-conf and alsa-ucm-conf to 1.2.1.2 and now the headphones work, but the speakers still don't.

@mengdonglin
Copy link
Collaborator

@hweom Can you pls provide output of alsa-info.sh when you're doing playback by the speaker although you cannot hear the sound?

@lgirdwood
Copy link
Member

sudo ./sof-logger -l /usr/lib/firmware/intel/sof/v1.5.1/sof-icl-v1.5.1.ldc -e
error: fw version in /usr/lib/firmware/intel/sof/v1.5.1/sof-icl-v1.5.1.ldc file does not coincide with fw version in /sys/kernel/debug/sof/fw_version file

@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.
@hweom als please check alsamixer - some speakers do have separate volume and mute controls to headphones. It's worth a quick poke around here and report any missing settings so they can be added to the UCM profile.

@hweom
Copy link
Author

hweom commented Jul 22, 2020

$ sudo alsa-info.sh
ALSA Information Script v 0.4.65
--------------------------------

This script visits the following commands/files to collect diagnostic
information about your ALSA installation and sound related hardware.

  dmesg
  lspci
  aplay
  amixer
  alsactl
  rpm, dpkg
  /proc/asound/
  /sys/class/sound/
  ~/.asoundrc (etc.)

See '/usr/bin/alsa-info.sh --help' for command line options.

cat: '/sys/module/snd_soc_skl_hda_dsp/parameters/*': No such file or directory
Automatically upload ALSA information to www.alsa-project.org? [y/N] : n

Your ALSA information is in /tmp/alsa-info.txt.f6EFAV77OE

alsa-info.txt.f6EFAV77OE

alsamixer does show a master channel that is not enabled by default:

Screenshot from 2020-07-21 17-14-41

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.

@xiulipan
Copy link

@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.

@xiulipan
Copy link

@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 amixer contents I am think about wrong codec setting.

@lgirdwood
Copy link
Member

lgirdwood commented Jul 22, 2020

@xiulipan agree it should be loading sof-cnl.ri binary IIRC and not sof-icl.ri. @hweom renaming the sof FW directory should make the kernel complain about the FW file it's trying to load cant be found. This will confirm we are using the correct version based on your PCH ID.

@plbossart
Copy link
Member

@hweom please copy the attached file as /etc/modprobe.d/sof-ddebug.conf and re-attach the dmesg log.
ddebug.txt

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.
Thanks!

@hweom
Copy link
Author

hweom commented Jul 22, 2020

@plbossart here it is. Unfortunately, the beginning of the log got truncated, so not sure if any interesting information was lost.

dmesg_sof.txt

@plbossart
Copy link
Member

@hweom yeah, all the initial stuff is lost...You seem to have a very chatty kernel configuration.
Maybe use a blacklist snd-sof-pci then after boot dmesg -C; dmesg -w > log.txt &; modprobe snd-sof-pci;
that should give you the initial log?

@hweom
Copy link
Author

hweom commented Jul 22, 2020

@plbossart done:

dmesg_sof.txt

@hweom
Copy link
Author

hweom commented Jul 22, 2020

@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 amixer contents:

numid=4,iface=MIXER,name='Master Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=3,iface=MIXER,name='Master Playback Volume'
  ; type=INTEGER,access=rw------,values=2,min=0,max=65536,step=1
  : values=65536,65536
numid=2,iface=MIXER,name='Capture Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='Capture Volume'
  ; type=INTEGER,access=rw------,values=2,min=0,max=65536,step=1
  : values=65536,65536

@xiulipan
Copy link

@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?

@plbossart
Copy link
Member

Wondering if this is the same issue as #1917, can you try the recipe that fixed it?
It seems there is a 'Master' simple control that's not set by UCM

$ amixer -Dhw:0 sset Master unmute
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 0 [0%] [-65.25dB] [on]

$ amixer -Dhw:0 sset Master 100%
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]

@hweom
Copy link
Author

hweom commented Jul 27, 2020

Thanks for the suggestions!

I can confirm that doing

$ amixer -Dhw:0 sset Master unmute
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 0 [0%] [-65.25dB] [on]

$ amixer -Dhw:0 sset Master 100%
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]

enabled the headphones output. (I believe the second command is the same as setting the Master channel via alsamixer in my screenshot here. However, it is the unmuting part that was missing in alsamixer.)

However, the speakers are still not working.

Here is the output of amixer -Dhw:0 scontents:

$ amixer -Dhw:0 scontents
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [off]
  Front Right: Playback 87 [100%] [0.00dB] [off]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 0 [0%] [-17.25dB] [off]
  Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Dmic0',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 70
  Front Left: Capture 50 [71%] [0.00dB] [on]
  Front Right: Capture 50 [71%] [0.00dB] [on]
Simple mixer control 'Dmic1 2nd',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 70
  Front Left: Capture 50 [71%] [0.00dB]
  Front Right: Capture 50 [71%] [0.00dB]
Simple mixer control 'PGA1.0 1 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA2.0 2 Master',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 50 [62%] [0.00dB]
  Front Right: Capture 50 [62%] [0.00dB]
Simple mixer control 'PGA3.0 3 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA4.0 4 Master',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 80
  Front Left: Capture 50 [62%] [0.00dB]
  Front Right: Capture 50 [62%] [0.00dB]
Simple mixer control 'PGA7.0 7 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA8.0 8 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]
Simple mixer control 'PGA9.0 9 Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 32
  Mono:
  Front Left: Playback 32 [100%] [0.00dB]
  Front Right: Playback 32 [100%] [0.00dB]

@plbossart
Copy link
Member

@hweom maybe try playing with what's disabled (AutoMuteMode) and what's on (SPDIF) to see if this changes anything.
I really don't get what UCM is doing here....

@hweom
Copy link
Author

hweom commented Jul 28, 2020

$ amixer -Dhw:0 sset 'Auto-Mute Mode' Enabled
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'

Yields no effect.

Changing SPDIFs to off didn't really change anything either (although I didn't try all the permutations):

[mikhail@ideapad ~]$ amixer -Dhw:0 sset 'IEC958',0 off
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
[mikhail@ideapad ~]$ amixer -Dhw:0 sset 'IEC958',1 off
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
[mikhail@ideapad ~]$ amixer -Dhw:0 sset 'IEC958',2 off
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]

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.

@plbossart
Copy link
Member

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.

@hweom
Copy link
Author

hweom commented Jul 28, 2020

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.

@hweom
Copy link
Author

hweom commented Jul 28, 2020

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.

@plbossart
Copy link
Member

@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?
There are known issues with a series of Lenovo C930/C940 devices, wondering if they are related to your config:

https://bugzilla.kernel.org/show_bug.cgi?id=203409
https://bugzilla.kernel.org/show_bug.cgi?id=205755

@hweom
Copy link
Author

hweom commented Jul 28, 2020

Thanks @plbossart , I'll look at those bugs for potential insights.

To clarify, in my case, none of the internal laptop speakers work.

@hweom
Copy link
Author

hweom commented Jul 28, 2020

Looks like this kernel bug is exact match for my situation:

https://bugzilla.kernel.org/show_bug.cgi?id=207019

@RanderWang
Copy link

@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?

ALC285 ? I have no idea about it.

@RanderWang
Copy link

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),

@hweom
Copy link
Author

hweom commented Aug 8, 2020

I've updated to 5.8.0-1 and just saw this in dmesg:

[    4.628502] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.677898] ------------[ cut here ]------------
[    4.677904] WARNING: CPU: 0 PID: 433 at kernel/kmod.c:137 __request_module+0x29e/0x41b
[    4.677905] Modules linked in: acpi_cpufreq(-) snd_soc_dmic snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc snd_sof_intel_hda_common snd_soc_hdac_hda x86_pkg_temp_thermal snd_sof_xtensa_dsp intel_powerclamp snd_sof_intel_hda coretemp joydev mousedev snd_sof ledtrig_audio kvm_intel snd_soc_skl hid_multitouch snd_soc_sst_ipc iTCO_wdt thunderbolt hid_generic snd_soc_sst_dsp intel_pmc_bxt ee1004 mei_hdcp kvm iTCO_vendor_support snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core intel_rapl_msr snd_compress ac97_bus snd_pcm_dmaengine wmi_bmof intel_wmi_thunderbolt irqbypass snd_hda_intel mmc_block snd_intel_dspcfg iwlmvm snd_hda_codec nls_iso8859_1 nls_cp437 crct10dif_pclmul snd_hda_core vfat crc32_pclmul ghash_clmulni_intel snd_hwdep fat mac80211 i915 snd_pcm aesni_intel libarc4 crypto_simd cryptd glue_helper rapl intel_cstate ofpart cmdlinepart snd_timer intel_spi_pci iwlwifi intel_uncore intel_spi snd spi_nor ucsi_acpi mei_me i2c_i801 pcspkr intel_lpss_pci typec_ucsi
[    4.677937]  input_leds mtd i2c_smbus soundcore processor_thermal_device i2c_hid i2c_algo_bit intel_lpss cfg80211 mei idma64 intel_rapl_common ideapad_laptop intel_gtt intel_pch_thermal hid intel_soc_dts_iosf typec rfkill tpm_crb int3403_thermal int340x_thermal_zone battery ac tpm_tis wmi tpm_tis_core tpm rng_core int3400_thermal acpi_thermal_rel intel_hid evdev mac_hid sparse_keymap uinput nvidia_drm(POE) nvidia_modeset(POE) drm_kms_helper cec rc_core drm agpgart syscopyarea sysfillrect sysimgblt fb_sys_fops nvidia(POE) ipmi_devintf ipmi_msghandler crypto_user ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 serio_raw atkbd libps2 sdhci_pci cqhci sdhci xhci_pci crc32c_intel xhci_pci_renesas mmc_core xhci_hcd i8042 serio
[    4.677968] CPU: 0 PID: 433 Comm: kworker/u24:4 Tainted: P           OE     5.8.0-1-MANJARO thesofproject/sof#1
[    4.677970] Hardware name: LENOVO 81NW/LNVNB161216, BIOS BKCN21WW(V1.03) 12/18/2019
[    4.677973] Workqueue: events_unbound async_run_entry_fn
[    4.677976] RIP: 0010:__request_module+0x29e/0x41b
[    4.677978] Code: 00 48 85 c0 75 e1 65 ff 0d 3f 78 f5 6e 0f 85 b1 fe ff ff e8 43 47 f4 ff e9 a7 fe ff ff e8 4a eb ff ff 84 c0 0f 84 1a fe ff ff <0f> 0b e9 13 fe ff ff 48 c7 c6 50 11 01 92 48 c7 c7 80 db 64 92 e8
[    4.677979] RSP: 0018:ffffae2bc0b3f978 EFLAGS: 00010202
[    4.677981] RAX: ffff9cf35bb72801 RBX: 0000000000000001 RCX: 0000000000000000
[    4.677982] RDX: ffffffffc172ee96 RSI: ffffffffc1714ec7 RDI: ffff9cf34d5f5d00
[    4.677983] RBP: ffffae2bc0b3fa58 R08: ffff9cf35284f75b R09: 0000000000000000
[    4.677984] R10: ffffae2bc0b3fa68 R11: ffff9cf35284f75b R12: ffffae2bc0b3f9b8
[    4.677986] R13: ffffffffc1714ec7 R14: ffffae2bc0b3fa68 R15: ffff9cf35dce3658
[    4.677987] FS:  0000000000000000(0000) GS:ffff9cf360400000(0000) knlGS:0000000000000000
[    4.677989] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    4.677990] CR2: 00007f3458039020 CR3: 00000003aea0a001 CR4: 00000000003606f0
[    4.677991] Call Trace:
[    4.677999]  ? kobject_set_name_vargs+0x6f/0x90
[    4.678006]  rc_map_get+0x7a/0xe0 [rc_core]
[    4.678011]  rc_register_device+0x120/0x540 [rc_core]
[    4.678016]  cec_register_adapter+0x5c/0x280 [cec]
[    4.678029]  drm_dp_cec_set_edid+0x163/0x1d9 [drm_kms_helper]
[    4.678107]  intel_dp_set_edid+0x8d/0xc0 [i915]
[    4.678175]  intel_dp_detect+0x19d/0x5f0 [i915]
[    4.678188]  drm_helper_probe_single_connector_modes+0xe5/0x6f0 [drm_kms_helper]
[    4.678213]  drm_client_modeset_probe+0x29d/0x13e0 [drm]
[    4.678220]  ? sched_clock+0x5/0x10
[    4.678230]  __drm_fb_helper_initial_config_and_unlock+0x45/0x4b0 [drm_kms_helper]
[    4.678235]  ? _raw_spin_unlock_irq+0x1d/0x30
[    4.678238]  ? finish_task_switch+0x80/0x270
[    4.678240]  ? __switch_to_asm+0x36/0x70
[    4.678302]  intel_fbdev_initial_config+0x14/0x30 [i915]
[    4.678305]  async_run_entry_fn+0x37/0x140
[    4.678308]  process_one_work+0x1da/0x3d0
[    4.678311]  worker_thread+0x4d/0x3d0
[    4.678313]  ? rescuer_thread+0x410/0x410
[    4.678316]  kthread+0x142/0x160
[    4.678318]  ? __kthread_bind_mask+0x60/0x60
[    4.678321]  ret_from_fork+0x22/0x30
[    4.678325] ---[ end trace 1b47830c33d524cd ]---
[    4.685321] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    4.709246] Registered IR keymap rc-cec
[    4.709284] rc rc0: DP-1 as /devices/pci0000:00/0000:00:02.0/rc/rc0
[    4.709306] input: DP-1 as /devices/pci0000:00/0000:00:02.0/rc/rc0/input16
[    4.764672] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[    4.764673] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.764676] sof-audio-pci 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    4.775648] fbcon: i915drmfb (fb0) is primary device
[    4.775649] fbcon: Deferring console take-over
[    4.775651] i915 0000:00:02.0: fb0: i915drmfb frame buffer device

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.)

@hweom
Copy link
Author

hweom commented Aug 8, 2020

I found a fix related to this

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:

--- a/src/linux-5.8/sound/pci/hda/patch_realtek.c
+++ b/src/linux-5.8/sound/pci/hda/patch_realtek.c
@@ -5981,6 +5981,8 @@ static void  alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
        if (action != HDA_FIXUP_ACT_INIT)
                return;
 
+       printk("Fixup entered");
+
        msleep(100);
        alc_write_coef_idx(codec, 0x65, 0x0);
 }
@@ -7669,6 +7671,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
        SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
        SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
+       // !!! 
+       SND_PCI_QUIRK(0x17aa, 0x3827, "Lenovo", ALC285_FIXUP_HP_GPIO_AMP_INIT),
+       SND_PCI_QUIRK(0x8086, 0xa348, "Lenovo", ALC285_FIXUP_HP_GPIO_AMP_INIT),
+       // !!!
        SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
        SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
        SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),

(I wasn't sure which PCI device IDs are used from this:

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Cannon Lake PCH cAVS [8086:a348] (rev 10)
	Subsystem: Lenovo Device [17aa:3827]

so I added both.)

dmesg has:

[    5.017550] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[    5.041100] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC285: line_outs=1 (0x17/0x0/0x0/0x0/0x0) type:speaker
[    5.041102] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.041102] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    5.041103] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[    5.041103] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[    5.041104] snd_hda_codec_realtek ehdaudio0D0:      Mic=0x19
[    5.087015] Fixup entered

So I know the code works.

The change seems to have some effect though: I now have a new scontents entry:

Simple mixer control 'Mic Mute-LED Mode',0
  Capabilities: enum
  Items: 'On' 'Off' 'Follow Capture' 'Follow Mute'
  Item0: 'Follow Mute'

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 :(

@realfossy
Copy link

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.

  1. start a player like VLC, Rhythmbox or whatever
  2. download attached shell script
  3. rename it with mv ./alc285.txt ./alc285.sh
  4. make it executable with sudo chmod +x ./alc285.sh
  5. run shell script with sudo ./alc285.sh
    If it doesn't work on the first run try it again. If you can hear music from your speakers you're the luky one. All other have to try other solutions or wait for an implementation in the kernel that works.

alc285.txt

@patbakdev
Copy link

For a more permanent solution you should get @tiwai's patch above and rebuild your kernel. Your mileage may vary depending on distro. I have sound working on my S740 using his kernel patch on Pop_OS!, kernel version 5.11.0-7612-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.

@ghost
Copy link

ghost commented May 5, 2021

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 have a couple questions. What is the file/repository link that I should be looking for this patch? Are those the 2 .c files on tiwai's commit link or a different type of file? What are the commands/utils that I should use.

I'm really sorry if this is not the place for this kind of questions. Really grateful for your time and work.

@plbossart
Copy link
Member

@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
'patch -p1 < 0001-ALSA-hda-realtek-Add-quirk-for-Lenovo-Ideapad-S740.patch.txt' or 'git am 0001-ALSA-hda-realtek-Add-quirk-for-Lenovo-Ideapad-S740.patch.txt'
and reinstall again.

Hope this helps!

@H-Park
Copy link

H-Park commented May 5, 2021

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)

@ghost
Copy link

ghost commented May 5, 2021

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.

@H-Park
Copy link

H-Park commented May 9, 2021

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.

@miltonhowe
Copy link

miltonhowe commented May 12, 2021

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!

woodsts pushed a commit to woodsts/linux-stable that referenced this issue May 19, 2021
[ 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>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 19, 2021
[ 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>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue May 19, 2021
[ 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>
@plbossart plbossart added the Community end-user or distro-reported issues label Jun 10, 2021
@plbossart
Copy link
Member

Closing this issue since the fix is upstream. Again thanks @ryanprescott for your work!

@elmkzgirxp
Copy link

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 for the initial coefs.

@ryanprescott
Copy link

ryanprescott commented Jun 21, 2021 via email

@elmkzgirxp
Copy link

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 0x20 0x400 0x41 and 0x20 0x400 0x42 were unique so I figured these are used to tell which speaker to apply the coefs to. I also noticed a repeating pattern like below and tested each one until I arrived with the final coefs:

0x20 0x500 0x26
0x20 0x400 0x2
0x20 0x400 0x0
0x20 0x400 0x0
0x20 0x4b0 0x20

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.

@plbossart
Copy link
Member

475 verbs down to 14.... Impressive simplification @elmkzgirxp !
Do you or @ryanprescott want to provide an update to @tiwai as a fix to commit 26928ca

@elmkzgirxp
Copy link

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.

it-is-a-robot pushed a commit to openeuler-mirror/kernel that referenced this issue Jun 28, 2021
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>
vinzv pushed a commit to tuxedocomputers/linux that referenced this issue Jul 2, 2021
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>
@ameenshake
Copy link

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:

$ inxi -Fxz
System:
  Kernel: 5.13.4-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 
  Desktop: GNOME 40.3 Distro: Manjaro Linux base: Arch Linux 
Machine:
  Type: Laptop System: LENOVO product: 81NW 
  v: Lenovo IdeaPad S740-15IRH Touch serial: <filter> 
  Mobo: LENOVO model: LNVNB161216 v: SDK0R32862 WIN serial: <filter> 
  UEFI: LENOVO v: BKCN23WW(V1.05) date: 03/16/2021 
Battery:
  ID-1: BAT1 charge: 62.2 Wh (100.0%) condition: 62.2/69.0 Wh (90.2%) 
  volts: 17.4 min: 15.4 
  model: 0x53 0x75 0x6E 0x77 0x6F 0x64 0x PABAS0241231 status: Charging 
CPU:
  Info: 8-Core model: Intel Core i9-9880H bits: 64 type: MT MCP 
  arch: Kaby Lake note: check rev: D cache: L2: 16 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 73625 
  Speed: 4281 MHz min/max: 800/4800 MHz Core speeds (MHz): 1: 4281 2: 4137 
  3: 4293 4: 4514 5: 4400 6: 4011 7: 3975 8: 4380 9: 4116 10: 4338 11: 4385 
  12: 4127 13: 4108 14: 4413 15: 4256 16: 4240 
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Lenovo 
  driver: i915 v: kernel bus-ID: 00:02.0 
  Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: Lenovo 
  driver: nvidia v: 470.57.02 bus-ID: 01:00.0 
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo bus-ID: 1-4:3 
  Display: wayland server: X.Org 1.21.1.2 compositor: gnome-shell driver: 
  loaded: modesetting unloaded: intel,nouveau,nvidia 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 21.1.5 
  direct render: Yes 
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Lenovo 
  driver: sof-audio-pci-intel-cnl bus-ID: 00:1f.3 
  Sound Server-1: ALSA v: k5.13.4-1-MANJARO running: yes 
  Sound Server-2: JACK v: 0.125.0 running: no 
  Sound Server-3: PulseAudio v: 14.2 running: yes 
  Sound Server-4: PipeWire v: 0.3.32 running: yes 
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel 
  port: 4000 bus-ID: 00:14.3 
  IF: wlp0s20f3 state: up mac: <filter> 
  IF-ID-1: br-1078d7ec1ae3 state: down mac: <filter> 
  IF-ID-2: br-27fa24aa74bf state: down mac: <filter> 
  IF-ID-3: br-6d7557087430 state: down mac: <filter> 
  IF-ID-4: br-782ff033cf93 state: down mac: <filter> 
  IF-ID-5: br-7ac608535c17 state: down mac: <filter> 
  IF-ID-6: br-8c93f4c6b11f state: down mac: <filter> 
  IF-ID-7: docker0 state: down mac: <filter> 
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB 
  driver: btusb v: 0.8 bus-ID: 1-14:5 
  Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends 
Drives:
  Local Storage: total: 953.87 GiB used: 204.64 GiB (21.5%) 
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB1T0HBLR-000L2 
  size: 953.87 GiB 
Partition:
  ID-1: / size: 342.99 GiB used: 204.61 GiB (59.7%) fs: ext4 
  dev: /dev/nvme0n1p5 
  ID-2: /boot/efi size: 256 MiB used: 28.9 MiB (11.3%) fs: vfat 
  dev: /dev/nvme0n1p1 
Swap:
  Alert: No swap data was found. 
Sensors:
  System Temperatures: cpu: 62.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 428 Uptime: 3m Memory: 15.35 GiB used: 6.44 GiB (41.9%) 
  Init: systemd Compilers: gcc: 11.1.0 clang: 12.0.1 Packages: 1637 
  Shell: Zsh v: 5.8 inxi: 3.3.05 

@plbossart
Copy link
Member

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.

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.

@paapu88
Copy link

paapu88 commented Jul 21, 2021

I have similar behaviour than @ameenshakesudo python3 applyverbs.py alc285.txt works only for some time and has to be repeated. Though, that's totally fine for me.

@Sulisong
Copy link

Sulisong commented Nov 5, 2021

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 for the initial coefs.

How to use in Hackintosh, did you build AppleALC by yourself? Can you find the use?

@Sulisong
Copy link

Sulisong commented Nov 6, 2021

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 for the initial coefs.

How to use in Hackintosh, did you build AppleALC by yourself? Can you find the use?

@elmkzgirxp

@Sulisong
Copy link

Sulisong commented Nov 6, 2021

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 0x20 0x400 0x41 and 0x20 0x400 0x42 were unique so I figured these are used to tell which speaker to apply the coefs to. I also noticed a repeating pattern like below and tested each one until I arrived with the final coefs:

0x20 0x500 0x26
0x20 0x400 0x2
0x20 0x400 0x0
0x20 0x400 0x0
0x20 0x4b0 0x20

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.

@elmkzgirxp How to use it in Hackintosh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CNL Applies to Cannonlake Community end-user or distro-reported issues I2S amplifier connected to HDA codec
Projects
None yet
Development

No branches or pull requests