Bug 216311

Summary: Add HP Envy x360 15 (Model: 15-ey0xxx, 8A31) to ALC245 codec fixes (snd_hda_id_realtek)
Product: Drivers Reporter: jmgroom
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: normal CC: aj.muller, andreas27x, azizmogb, dimz, drummer7, isolite, kernbug, lucas, tilrnz, tiwai, tsengalb99, xing
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.18.10 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg and lspci output for realtek devices
alsa-info output
Collected information by alsa-info.sh from my machine
attachment-8608-0.html

Description jmgroom 2022-07-29 22:52:35 UTC
Created attachment 301516 [details]
dmesg and lspci output for realtek devices

2022 HP Envy x360 15" laptop has Bang & Olufsen speakers with CS35L41 amp and uses ALC245 codec. No sound working or mute LED or mic LED on keyboard. Model HP laptop is 15-ey0013dx and motherboard model 8A31.
Comment 1 jmgroom 2022-07-29 23:02:31 UTC
Mic jack and bluetooth audio works fine, just internal speakers not working.
Comment 2 jmgroom 2022-08-09 19:04:51 UTC
Created attachment 301542 [details]
alsa-info output

output for alsa-info
Comment 3 Andreas Strahm 2022-08-27 08:53:49 UTC
I have the same issue. It is noteworthy, that the 3.5mm headphone output is working fine.

I found related information / activity on:
https://www.spinics.net/lists/alsa-devel/msg146434.html
https://bugzilla.kernel.org/show_bug.cgi?id=216194

It might be fixed in the Kernel 5.19.4 already.
Comment 4 Andreas Strahm 2022-08-27 08:55:32 UTC
Created attachment 301679 [details]
Collected information by alsa-info.sh from my machine
Comment 5 Andreas Strahm 2022-08-27 09:01:14 UTC
(In reply to Andreas Strahm from comment #3)
> It might be fixed in the Kernel 5.19.4 already.
Unfortunately that's not the case. There will be an experimental path only.
Comment 6 Andreas Strahm 2022-08-27 09:05:31 UTC
I've found another reference in a patch:
https://lore.kernel.org/lkml/20220811053950.11810-1-faenkhauser@gmail.com/
Comment 7 Xing Li 2022-08-31 11:56:03 UTC
I am on HP EliteBook 865 16 inch G9 (2022 amd 6850h) with exact same audio specs, according to HP and my issue is extreme low volume and base, about 1/4 value as compared to windows11. 

Running Kernel 6.0rc3 on Fedora 37 (rawhide)

My hw/alsa debug info:

http://alsa-project.org/db/?f=6a7039fe66fc4310f82de9f4a933268ba34d9382

Also got the following from dmesg:

[  407.695559] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: Failed to read 4 bytes from 28007e8: -121
Comment 8 azizmogb 2022-11-16 10:45:38 UTC
Any updates on this? having the same problems with the same device (HP ENVY x360 2-in-1 Laptop 15-ey0xxx).
Comment 9 jmgroom 2022-11-18 06:14:54 UTC
(In reply to azizmogb from comment #8)
> Any updates on this? having the same problems with the same device (HP ENVY
> x360 2-in-1 Laptop 15-ey0xxx).

No update. I’m on 6.0.7 and problem still exists. I use headphones as a workaround.
Comment 10 Takashi Iwai 2022-11-18 11:18:28 UTC
The fix requires a few different things:
- Your BIOS needs to behave correctly to report the _DSD information in ACPI for the Cirrus device.

Check whether you get errors from i2c-CSC3551* or spi*-CSC3551* in the kernel messages.

- Once when BIOS is proper, HD-audio Realtek codec needs the binding with Cirrus sub-codec driver.  It needs the quirk entry.

If the same quirk is applicable, you may try to pass the model option with the existing PCI SSID as alias.  See Documentation/sound/hda/notes.rst.
Note that, on AMD platforms, the Realtek codec appears at the secondary instance, hence you'd need to pass to the second argument of model option, e.g.
  model=,103c:8975

Also, it depends on HDA-Intel or SOF driver where to pass the model option.  And SOF driver didn't receive the model option in the earlier kernels.  In doubt, switch to HDA-Intel by snd_intel_dspcfg.dsp_driver=1 option, and pass the model option snd-hda-intel.  You'll lose the built-in mic, but other features should remain.
Comment 11 tsengalb99 2023-01-30 05:18:36 UTC
(In reply to Xing Li from comment #7)
> I am on HP EliteBook 865 16 inch G9 (2022 amd 6850h) with exact same audio
> specs, according to HP and my issue is extreme low volume and base, about
> 1/4 value as compared to windows11. 
> 
> Running Kernel 6.0rc3 on Fedora 37 (rawhide)
> 
> My hw/alsa debug info:
> 
> http://alsa-project.org/db/?f=6a7039fe66fc4310f82de9f4a933268ba34d9382
> 
> Also got the following from dmesg:
> 
> [  407.695559] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: Failed to
> read 4 bytes from 28007e8: -121

Did you ever find a fix for this? I also have a HP 865 G9 but with a different audio issue. In 5.19 my internal speakers work fine, but in 6.1.8 my audio is distorted. The "s" sound is soft and it sounds like the audio is muffled.

dmesg in 6.1.8 has this error

[   84.054774] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: Failed to read 256 bytes from 2800608: -121

that dmesg in 5.19 does not have, so it seems like I am also having issues with CSC3551. I am not sure how to fix this based on the above discussion.
Comment 12 Jaroslav Kysela 2023-01-30 17:29:04 UTC
Could you test latest 6.2 code ?
Comment 13 dimz 2023-02-14 23:37:33 UTC
I also don't have sound from my internal speakers on HP Envy x360 15-ew0023dx, but I can play audio from headphone jack, HDMI, or bluetooth. No keyboard LEDs for mic or volume mute. 

I've tried Ubuntu 22.04 and 22.10, linux kernel 5.15, 5.19.17, and 6.1.11, none fixed it. I also tried this patch which didn't fix it, although I can't be sure I did it right as it was my first time applying a patch. https://lore.kernel.org/lkml/20220811053950.11810-1-faenkhauser@gmail.com/
Comment 14 jmgroom 2023-03-08 18:20:37 UTC
(In reply to Jaroslav Kysela from comment #12)
> Could you test latest 6.2 code ?

Tried 6.2.0, no sound still. 

dmesg errors below

user@laptop:~/Desktop$ uname -r
6.2.0-76060200-generic
user@laptop:~/Desktop$ sudo dmesg | grep -i cs35l41-hda
[   15.810935] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Error: ACPI _DSD Properties are missing for HID CSC3551.
[   15.810941] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: error -EINVAL: Platform not supported
[   15.810990] cs35l41-hda: probe of i2c-CSC3551:00-cs35l41-hda.0 failed with error -22
[   15.814631] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Error: ACPI _DSD Properties are missing for HID CSC3551.
[   15.814640] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: error -EINVAL: Platform not supported
[   15.814707] cs35l41-hda: probe of i2c-CSC3551:00-cs35l41-hda.1 failed with error -22
Comment 15 drummer7 2023-03-09 22:03:29 UTC
(In reply to Jaroslav Kysela from comment #12)
> Could you test latest 6.2 code ?

Using an HP x360 Envy 15-ey0013dx
OS: Arch (Manjaro)
Kernels tried: 6.1.12-1, 6.2.0rc8-1

Same basic situation as others are seeing.  Sound via HDMI works.  Headphones work, and internal Mic works.  Searching for a way to get those external speakers (ALC-245) working.

Glad to help in any way.  But to reiterate 6.2.0rc8-1 does not work.
Comment 16 jmgroom 2023-03-22 00:11:06 UTC
I just upgraded to 6.2.6 and still no sound from speakers.
Comment 17 drummer7 2023-03-27 15:13:16 UTC
Can confirm that compiling the latest code with the patch outlines in Comment 6 works and seems to be very stable.
Comment 18 Lucas Jackson 2023-04-16 16:15:25 UTC
What did you do to install the patch?  And, how do we get this in the upstream, so we don't need to worry about patching systems in the future?
Comment 19 drummer7 2023-04-16 16:29:41 UTC
(In reply to Lucas Jackson from comment #18)
> What did you do to install the patch?  And, how do we get this in the
> upstream, so we don't need to worry about patching systems in the future?

Well.  I am using Arch Linux so I followed the general guidelines for creating a custom package and compiling the kernel for my distro which was actually trickier than just the kernel part.  For the patch I just hand edited the two files to add the details outlined in the patch I referenced and compiled it.  It has now been working perfectly for some weeks.

But to your other question, I do not know how to get this into the upstream.  PR?  I really do not know.  I am a novice when it comes to that part of the process.  I had hoped my confirmation that the patch works might help someone smarter than me in this regard to pull it off. ;)  Because for now I either have to recompile the new kernel for each update, or just live with a slightly older one.
Comment 20 Lucas Jackson 2023-04-16 16:40:15 UTC
Thank you for your reply.  I’m completely new at patching the kernel… never had to do it before now.  I’m on Ubuntu and installed the source, but I keep getting an error telling me it can find the files after running the patch command.   

> On Apr 16, 2023, at 12:29 PM, bugzilla-daemon@kernel.org wrote:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=216311
> 
> --- Comment #19 from drummer7@yahoo.com ---
> (In reply to Lucas Jackson from comment #18)
>> What did you do to install the patch?  And, how do we get this in the
>> upstream, so we don't need to worry about patching systems in the future?
> 
> Well.  I am using Arch Linux so I followed the general guidelines for
> creating
> a custom package and compiling the kernel for my distro which was actually
> trickier than just the kernel part.  For the patch I just hand edited the two
> files to add the details outlined in the patch I referenced and compiled it. 
> It has now been working perfectly for some weeks.
> 
> But to your other question, I do not know how to get this into the upstream. 
> PR?  I really do not know.  I am a novice when it comes to that part of the
> process.  I had hoped my confirmation that the patch works might help someone
> smarter than me in this regard to pull it off. ;)  Because for now I either
> have to recompile the new kernel for each update, or just live with a
> slightly
> older one.
> 
> -- 
> You may reply to this email to add a comment.
> 
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 21 jmgroom 2023-04-22 20:13:26 UTC
There is a fix posted in 6.2.8. Anyone want to test?

https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.2.8
Comment 22 jmgroom 2023-04-22 20:15:19 UTC
(In reply to jmgroom from comment #21)
> There is a fix posted in 6.2.8. Anyone want to test?
> 
> https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.2.8

commit 76f05ad3625cc03bbd44bd47c28fa276ae4f72b1
Author: Jeremy Szu <jeremy.szu@canonical.com>
Date:   Tue Mar 7 21:53:16 2023 +0800

    ALSA: hda/realtek: fix speaker, mute/micmute LEDs not work on a HP platform
    
    commit 7bb62340951a9af20235a3bde8c98e2e292915df upstream.
    
    There is a HP platform needs ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED quirk to
    make mic-mute/audio-mute/speaker working.
    
    Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
    Cc: <stable@vger.kernel.org>
    Link: https://lore.kernel.org/r/20230307135317.37621-1-jeremy.szu@canonical.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Comment 23 Lucas Jackson 2023-04-22 22:31:36 UTC
I’m running 6.2.10 via mainline on Ubuntu 23.04 and it’s not working.  

Sent from my iPhone

> On Apr 22, 2023, at 4:13 PM, bugzilla-daemon@kernel.org wrote:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=216311
> 
> --- Comment #21 from jmgroom@protonmail.com ---
> There is a fix posted in 6.2.8. Anyone want to test?
> 
> https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.2.8
> 
> -- 
> You may reply to this email to add a comment.
> 
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 24 jmgroom 2023-04-29 04:41:33 UTC
(In reply to Lucas Jackson from comment #23)
> I’m running 6.2.10 via mainline on Ubuntu 23.04 and it’s not working.  
> 
> Sent from my iPhone
> 
> > On Apr 22, 2023, at 4:13 PM, bugzilla-daemon@kernel.org wrote:
> > 
> > https://bugzilla.kernel.org/show_bug.cgi?id=216311
> > 
> > --- Comment #21 from jmgroom@protonmail.com ---
> > There is a fix posted in 6.2.8. Anyone want to test?
> > 
> > https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.2.8
> > 
> > -- 
> > You may reply to this email to add a comment.
> > 
> > You are receiving this mail because:
> > You are on the CC list for the bug.

How do we get 8a31 into stable or mainline? Supposedly fixed in 6.2.8 however quirk wasn't enabled for this model. I don't know how to patch even though I've tried a few times..

SND_PCI_QUIRK(0x103c, 0x8a31, "HP ENVY x360 2-in-1 Laptop 15-ey0xxx", ALC287_FIXUP_CS35L41_I2C_2),
Comment 25 tsengalb99 2023-04-29 05:51:24 UTC
Created attachment 304196 [details]
attachment-8608-0.html

unsubscribe

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: bugzilla-daemon@kernel.org <bugzilla-daemon@kernel.org>
Sent: Saturday, April 29, 2023 12:41:33 AM
To: tsengalb99@gmail.com <tsengalb99@gmail.com>
Subject: [Bug 216311] Add HP Envy x360 15 (Model: 15-ey0xxx, 8A31) to ALC245 codec fixes (snd_hda_id_realtek)

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

--- Comment #24 from jmgroom@protonmail.com ---
(In reply to Lucas Jackson from comment #23)
> I’m running 6.2.10 via mainline on Ubuntu 23.04 and it’s not working.
>
> Sent from my iPhone
>
> > On Apr 22, 2023, at 4:13 PM, bugzilla-daemon@kernel.org wrote:
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=216311
> >
> > --- Comment #21 from jmgroom@protonmail.com ---
> > There is a fix posted in 6.2.8. Anyone want to test?
> >
> > https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.2.8
> >
> > --
> > You may reply to this email to add a comment.
> >
> > You are receiving this mail because:
> > You are on the CC list for the bug.

How do we get 8a31 into stable or mainline? Supposedly fixed in 6.2.8 however
quirk wasn't enabled for this model. I don't know how to patch even though I've
tried a few times..

SND_PCI_QUIRK(0x103c, 0x8a31, "HP ENVY x360 2-in-1 Laptop 15-ey0xxx",
ALC287_FIXUP_CS35L41_I2C_2),

--
You may reply to this email to add a comment.

You are receiving this mail because:
You are on the CC list for the bug.
Comment 26 Takashi Iwai 2023-04-29 06:19:21 UTC
There is no code change for 103c:8a31, as no one confirmed working nor submitting the fix patch to the upstream yet.

Suppose the alsa-info.sh in comment 2 is correct, you may try to pass
  model=,103c:8b42
to snd-hda-intel module.  The comma before after 'model=' is no typo; it means to pass to the second instance (your machine has two HD-audio controllers).
The above example means to use the same quirk for 103c:8b42 to the second HD-audio chip, and it's ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED.

Take a look at alc269_fixup_tbl[] in patch_realtek.c and find out the right one.
Comment 27 drummer7 2023-06-23 17:33:42 UTC
I continue to compile the latest kernels which need the simple patch to two files as described in comment #6 here.

I will offer this patch to Arch Linux users as a custom kernel soon, as this process has forced me to learn how to patch the kernel for Arch (the right way).

What do we need to do to get this pulled into the repo?  It is a very simple fix.  Only 3 lines changed.
Comment 28 Tino Lorenz 2023-08-14 00:25:50 UTC
> What do we need to do to get this pulled into the repo?

If I understand this correctly, the Realtek Quirk shouldn't be a problem, but we'd need to modify the lines that supply the missing DSD values, ie.
```
-	if (strncmp(hid, "CLSA0100", 8) == 0) {
+	if ((strncmp(hid, "CLSA0100", 8) == 0) ||
+	    (strncmp(hid, "CSC3551", 7) == 0)) {
```
, so that they only apply for this laptop model rather than for all devices with this audio amp.
Right, @Takashi?
Comment 29 Takashi Iwai 2023-08-14 06:16:42 UTC
The lack of _DSD is clearly a bug of BIOS / ACPI, not a Realtek codec problem, indeed.  But it can't be covered only by the HID matching as you stated because it would hit way too many other devices falsely; it leads to the wrong amp parameter set up that may burn speakers immediately.
Comment 30 Andreas 2023-12-29 16:14:01 UTC
Sadly this bug is still open (6.7-rc6) i.e. sound over internal speakers is still not working.


As mentioned in a response to faenkhausers patch that patch will not make it upstream
(https://lore.kernel.org/lkml/c671ad96-e1aa-4cda-eef1-fd8fe906ec36@opensource.cirrus.com/) or to be more precise there is no need to wait for new kernel versions as the problem is in the bios so cirrus and/or hp should address this.


Is this correct?
Anybody seen any news on that front?
Comment 31 Lucas Jackson 2023-12-29 18:03:42 UTC
I gave up on this.  I bought a ThinkPad and gave the x360 to my sister-in-law.  

Sent from my iPhone

> On Dec 29, 2023, at 10:14 AM, bugzilla-daemon@kernel.org wrote:
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=216311
> 
> Andreas (aj.muller@gmx.net) changed:
> 
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                 CC|                            |aj.muller@gmx.net
> 
> --- Comment #30 from Andreas (aj.muller@gmx.net) ---
> Sadly this bug is still open (6.7-rc6) i.e. sound over internal speakers is
> still not working.
> 
> 
> As mentioned in a response to faenkhausers patch that patch will not make it
> upstream
>
> (https://lore.kernel.org/lkml/c671ad96-e1aa-4cda-eef1-fd8fe906ec36@opensource.cirrus.com/)
> or to be more precise there is no need to wait for new kernel versions as the
> problem is in the bios so cirrus and/or hp should address this.
> 
> 
> Is this correct?
> Anybody seen any news on that front?
> 
> --
> You may reply to this email to add a comment.
> 
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 32 Matthew E 2024-03-13 18:24:57 UTC
The next branch has the fixes for this, now that 6.8.0 is out. It will be in mainline when 6.9.0 releases. 

The commit that fixes it: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?id=7d65d70161ef75a3991480c91668ac11acedf211

Related: 
https://bbs.archlinux.org/viewtopic.php?pid=2146860#p2146860
https://bugzilla.redhat.com/show_bug.cgi?id=2107845