Realtek audio doesn't work

I made script that makes f6 key led light on (hp 15s-eq1xxx laptop) but output device changed to headphones. Then I found out I got no audio on Manjaro and Windows. Looked for a solution on forums but it didn’t give me any results.

After reboot neither sound nor script doesn’t work.

inxi -Fza output:

Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 04:00.1 chip-ID: 1002:15de class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard
    driver: snd_pci_acp3x v: kernel alternate: snd_rn_pci_acp3x, snd_pci_acp5x,
    snd_pci_acp6x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
    snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh pcie:
    gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 04:00.5 chip-ID: 1022:15e2
    class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 04:00.6 chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.6.32-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl

aplay -l command output:

**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: ALC236 Analog [ALC236 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Script:

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

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

Well the script turns it on and immediately turns it off. So yeah it will be off when you run it.

I would do it like that:

#!/usr/bin/env bash

card=/dev/snd/hwC1D0

# Assuming it is on at boot time
if [ ! -f "/tmp/toggle_state" ]; then
  # Put in here the action
  echo "off" > "/tmp/toggle_state"
  notify-send -u normal "Switch OFF"
  exit
fi

STATE=$(cat /tmp/toggle_state)
case $STATE in
    off) echo "Switch ON"
        # Put in here the action
        echo "on" > "/tmp/toggle_state"
        notify-send -u normal "Switch ON"
        exit
    ;;
    on) echo "Switch OFF"
        # Put in here the action
        echo "off" > "/tmp/toggle_state"
        notify-send -u normal "Switch OFF"
        exit
    ;;
esac

However… see no realtek device on your system info and I have no idea what your hda-verb parameters actually patch.

Hm, maybe the solution to the sound problem was to shut down the pc? Turned it on this morning and soundcard is perfectly working both in Windows and Manjaro or it could be result of one of the solutions that I searched on the forum. I haven’t tried to replicate this problem, though the script doesn’t work now, but it’s not a big problem.

Using hda-verb and for-loop cycle I found the values of GPIO that turns on and off the led light on keyboard’s sound mute button. Hence, I created the script mentioned in the topic.

Also, thanks for the reply with an example. I’m new to bash scripting, so I have to work on it.

Archwiki page for HP laptops suggests that the F6 Mute LED on keyboard does not work on a number of different HP systems, including:

Laptop/HP - ArchWiki

Laptop 15s-eq1124nw - Mute LED on F6: broken, stays off.

There are currently 25 open bug reports at kernel.buzilla.org for HP Mute LED
If you want to seek help to get keyboard LED working I suggest create a new bug report and attach diagnostic data
If the hda-verbs are working on your system, this should be reported to kernel.bugzilla.org so future kernels can be patched for other Linux users

Does F6 work to mute/unmute audio playback in ALSA (XF86AudioMute keymap)?