You are not logged in.

#26 2023-01-14 09:07:43

whyaname
Member
From: Netherlands
Registered: 2013-08-09
Posts: 25

Re: Enabling Mute Fn Key LED on HP Laptop

I have no models enabled for snd_hda_intel in modprobe.d. I am not completely sure if the Mic Mute (as the name implies) is for the mic status but the LED is supposed to show the audio output mute status. There are no other LEDs (except caps lock). Maybe the LED is being registered as a mic status LED and then muting the system does not toggle it? (but then again muting the digital microphone also doesn´t toggle it)

Also found this link that maybe is specific to Ubuntu but deals with the same codec: https://bugs.launchpad.net/ubuntu/+sour … ug/1884251

Last edited by whyaname (2023-01-14 09:10:00)

Offline

#27 2023-01-15 14:16:20

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Alright, I've come up with a (frankly not very elegant) brute-force solution:

#!/bin/bash

read -p "What's your sound card? Form /dev/snd/hwCxDx": card

echo "Testing GPIO pins, polarity 0"
for i in 0x01 0x02 0x04 0x08 0x10 0x20 0x40;
do
  sudo hda-verb $card 0x01 0x716 $i
  sudo hda-verb $card 0x01 0x717 $i
  sudo hda-verb $card 0x01 0x715 $i
  sleep 0.2
done
echo "Testing GPIO pins, polarity 1"
for i in 0x01 0x02 0x04 0x08 0x10 0x20 0x40;
do
  sudo hda-verb $card 0x01 0x716 $i 
  sudo hda-verb $card 0x01 0x717 $i
  sudo hda-verb $card 0x01 0x715 0x00
  sleep 0.2
done
echo "Testing COEF and INDEX"
start=0x1
end=0xff
for (( i=$start; i <=$end; ++i)); 
do
  for j in 0x1 0x2 0x4 0x8 0x10 0x20 0x40 0x80 0x100 0x200 0x400 0x800 0x1000 0x2000 0x4000 0x8000;
  do
    sudo hda-verb $card 0x20 0x500 $i
    sudo hda-verb $card 0x20 0x400 $j
    sleep 0.2
  done
done

This bash script will test all possible inputs (at least all the ones I think are possible).
You can basically put this in a bash file and run it.
While the script is running, you have to be ready to stop it the moment your LED turns on. So you start the script and wait with your fingers over Ctrl-C.
Each combination will be tested for 0.2 seconds, so you have to be quick about it. There are a lot of possible combinations.
14 GPIO and 4096 COEF commands to be exact. Depending in your case, it could take up to 14 minutes.
If you want, you can change the sleep value to decrease the time, but it will make reacting harder.

Then, when you found the combination that works to turn on your LED we can determine the one which turns it back off.

One important thing: This script will temporarily change basically your entire soundcard configuration. There will be crackling and plopping sounds coming from your speakers. But don't worry, after a system restart everything should go back to normal.

If you are unsure what command turned your LED on, post the console output generated when your LED turned on.

Last edited by Sir_Potato (2023-01-15 14:19:00)

Offline

#28 2023-01-16 18:08:14

andy0
Member
Registered: 2023-01-16
Posts: 1

Re: Enabling Mute Fn Key LED on HP Laptop

Offline

#29 2023-01-17 06:56:09

whyaname
Member
From: Netherlands
Registered: 2013-08-09
Posts: 25

Re: Enabling Mute Fn Key LED on HP Laptop

The script also did not turn the LED on (as far as I saw). I also found this ArchWiki article that says the Mute LED is just broken on these systems ( https://wiki.archlinux.org/title/Laptop/HP -> HP 15s-eq1124nw). Mine is the eq2xxx but I imagine its similar. Thanks for all the help so far.

Last edited by whyaname (2023-01-17 06:56:34)

Offline

#30 2023-06-05 08:20:31

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

I found a command to turn on the indicator

#!/bin/bash
card=/dev/snd/hwC1D0
sudo hda-verb $card 0x20 0x500 0x7
sudo hda-verb $card 0x20 0x400 0x1

Last edited by omnibox (2023-06-05 08:33:40)

Offline

#31 2023-06-22 16:39:03

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

omnibox wrote:

I found a command to turn on the indicator

Hey there,
I just stumbled upon this thread again and saw your post.
We can try and turn your findings into a Kernel Patch to make your indicators work out of the box.
I assume you have a speaker mute indicator.

Does running

sudo hda-verb $card 0x20 0x400 0x0

turn the indicator off again?

If so, we need to know your laptop indentifier, sound codec and it's product name.
To determine the identifier and codec run

sudo alsa-info.sh

when prompted to upload the information, do it and paste the link in this thread. From there I should be able to determine the Ids and Codec.

Last edited by Sir_Potato (2023-06-22 16:42:46)

Offline

#32 2023-06-23 09:48:27

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

Offline

#33 2023-06-23 16:27:33

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

#!/bin/bash
card=/dev/snd/hwC1D0
sudo hda-verb $card 0x20 0x500 0x7
sudo hda-verb $card 0x20 0x400 0x0

turns off the LED

Offline

#34 2023-06-24 10:21:38

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Perfect. I have created a patch file, so we can test whether it works or not.

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 308ec7034cc9..e8a836596bfb 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4623,6 +4623,21 @@ static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
 	}
 }
 
+static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
+					  const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+		spec->mute_led_polarity = 0;
+		spec->mute_led_coef.idx = 0x07;
+		spec->mute_led_coef.mask = 1;
+		spec->mute_led_coef.on = 1;
+		spec->mute_led_coef.off = 0;
+		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
+	}
+}
+
 /* turn on/off mic-mute LED per capture hook by coef bit */
 static int coef_micmute_led_set(struct led_classdev *led_cdev,
 				enum led_brightness brightness)
@@ -7133,6 +7148,7 @@ enum {
 	ALC285_FIXUP_HP_GPIO_LED,
 	ALC285_FIXUP_HP_MUTE_LED,
 	ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
+	ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
 	ALC236_FIXUP_HP_GPIO_LED,
 	ALC236_FIXUP_HP_MUTE_LED,
 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
@@ -8556,6 +8572,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc285_fixup_hp_spectre_x360_mute_led,
 	},
+	[ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
+	    .type = HDA_FIXUP_FUNC,
+	    .v.func = alc236_fixup_hp_mute_led_coefbit2,
+	},
 	[ALC236_FIXUP_HP_GPIO_LED] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc236_fixup_hp_gpio_led,
@@ -9440,6 +9460,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
 	SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
 	SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
+	SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
 	SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
-- 
2.41.0

To test this you will have to compile a custom kernel for your system and boot using it. If I'm not mistaken you run Fedora 38.
https://docs.fedoraproject.org/en-US/qu … om-kernel/

The Fedora Docs provide you with the necessary info to compile the kernel.
Don't forget to apply my patch file prior to compiling the kernel, otherwise the changes won't be made.

Offline

#35 2023-06-25 19:08:49

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

Most likely my mistake, but the indicator did not work

Offline

#36 2023-06-26 11:40:33

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

I have compiled the necessary packages on my own machine and double checked that the patch was applied. Although you should never trust a random guy on an internet forum you can download the .rpm files using this Google Drive link. (Of course install them on your own risk, I only have my "trust-me-bro" guarantee).

https://drive.google.com/drive/folders/ … sp=sharing

Install all .rpm files in that folder:

sudo dnf install ./*.rpm

After rebooting you should see the test keyword when checking the running kernel:

$ uname -a
Linux fedora 6.3.9-200.test.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 26 12:03:
10 CEST 2023 x86_64 GNU/Linux

If you see test in the kernel version it is running and the indicator should be working.
In case it reboots into the wrong kernel, you can make the GRUB Menu visible by pressing F8 at startup and choose the test kernel manually.

Of course uninstall all these packages after testing.

Offline

#37 2023-06-27 20:23:11

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Also, check if you have any model enabled for snd_hda_Intel in your /etc/modprobe.d

This would override any changes we are trying to achieve using the kernel patch.

Offline

#38 2023-07-09 17:10:07

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

Sorry for not answering. I'll check tomorrow

Offline

#39 2023-07-18 15:44:03

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

It's working(yay)

Offline

#40 2023-07-18 15:57:41

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Very nice.
I will finish up the patch and send it to the kernel maintainers. It will probably take some time for them to integrate it into the kernel code.
When the respective kernel update hits the repositories you will have full functionality. Until then, you will have to stay a little longer without an indicator light.
Do not continue to use the patched kernel as it is already outdated and out of sync with the Fedora repos.

Offline

#41 2023-07-18 16:09:09

omnibox
Member
Registered: 2023-06-05
Posts: 7

Re: Enabling Mute Fn Key LED on HP Laptop

Thank you for the patch, now one less problem.

Offline

#42 2023-07-18 16:20:13

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

I have committed the patch.

https://lore.kernel.org/alsa-devel/2023 … eb.de/T/#u

Edit: It has been accepted.

Last edited by Sir_Potato (2023-07-19 10:02:57)

Offline

#43 2023-07-24 18:45:57

YesNoMaybe
Member
Registered: 2023-07-24
Posts: 2

Re: Enabling Mute Fn Key LED on HP Laptop

Hi there!

I have a different HP laptop model having the same Mute-LED issue. Thanks to Sir_Potato`s script I was able to figure out the parameters for the led_on / led_off commands - and it turned out, they are the same as in this example (only the card-number is different). Since the codec used is the ALC236 as well, I considered the patch to be appliable to my machine as well - only having to add another entry for the proper mapping to the notebook model.

Since there was also a hint to this issue in another post within this thread, the output taken from alsa-info.sh gave the right information for the notebook's name and its board number.

Basically applying the patch and then adding the single line of code related to my notebook model made the whole thing work like a charm! So thanks to your efforts in solving the problem in this thread.

My question is now: what is the best way to get this support for my notebook model incorporated into the official kernel? Maybe Sir_Potato can add this 'on top' of the patch?

Offline

#44 2023-07-24 19:36:43

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Hello there,
glad to see our efforts help even more people.
We can add your laptop to the official kernel, that's not a problem.
Just give me the line you added and i will send a correctly formatted patch to the kernel maintainers.

Offline

#45 2023-07-25 10:40:00

YesNoMaybe
Member
Registered: 2023-07-24
Posts: 2

Re: Enabling Mute Fn Key LED on HP Laptop

Perfect!

It's simply a one-liner:

SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),

The exact model information (taken from the bottom of the laptop) is:

HP 250 G8 and Product ID 5B6H7ES#ABD

Perhaps this helps other people who have similar devices to figure out whether this solution does apply to them as well.

Thanks!

Offline

#46 2023-07-25 11:21:36

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Thank you very much, it has been committed:

https://lore.kernel.org/alsa-devel/2023 … eb.de/T/#u

Edit: It  has been accepted

Last edited by Sir_Potato (2023-07-25 12:41:48)

Offline

#47 2023-11-10 17:03:35

eymenyg
Member
Registered: 2023-11-10
Posts: 2

Re: Enabling Mute Fn Key LED on HP Laptop

Sir_Potato wrote:

Thank you very much, it has been committed:

https://lore.kernel.org/alsa-devel/2023 … eb.de/T/#u

Edit: It  has been accepted

Hi, thanks for your efforts! Based on your work, I've made the necessary changes for the HP 255 G8 and sent the commit (as my first contribution to Linux) and it has just been applied. I also Cc'd you on the patch email but I couldn't find the link, I apologize if I made any mistakes.

Info:
Product Name: HP 255 G8
SKU: 7N4W6AA
Vendor: 0x103c
Device: 0x890e

Offline

#48 2023-11-10 17:49:33

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Hey there,
yes, I've received the e-mail. Really cool to see how many people find use in this thread.
Congrats on your first (and hopefully not last ;-) ) contribution to Linux!

Offline

#49 2023-11-10 18:16:47

eymenyg
Member
Registered: 2023-11-10
Posts: 2

Re: Enabling Mute Fn Key LED on HP Laptop

Thank you smile I've been trying to get it to work on Windows (oddly enough it worked until I had to reinstall it) for a few days now but it was considerably easier on Arch/Linux.

Offline

#50 2023-11-10 18:58:48

Sir_Potato
Member
Registered: 2023-01-12
Posts: 30

Re: Enabling Mute Fn Key LED on HP Laptop

Even though this is not a Windows forum. The Problem is most likely with the driver. Install the audio driver form the HP Website. That one should be able to control the LED.

Offline

Board footer

Powered by FluxBB