Hp Spectre 2020 - Speakers not working, the headphones do

OH MY GOD I GOT IT WORKING!!!

Turns out the GPIO pin setting from before does work, it just takes an unknown number of tries. I had run it a couple times and restarted pulseaudio but got nothing. HOWEVER! I had downloaded a random mp3 and had it looping in VLC. While hunting google for more solutions I kept seeing that command mentioned over and over again, so I ran it one more time and lo and behold it worked. Granted, it’s only the bottom two speakers, and from what I’ve read, you need to do it each time you boot, however sound was coming out so I see this as an absolute victory. I’ll have to do more digging into making the other speakers work and getting it to automatically run at boot.


For others with this issue scouring the net:
Install alsa-tools (pacman -Syu alsa-tools)
Run the commands from pobrn’s reply (you can just copy the whole block into your terminal and it’ll work)

sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x01
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x01
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x01
sudo hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x00

Restart pulseaudio, either with pulseaudio -k or with systemctl --user restart pulseaudio.service (I had done both at different times)
Just keep running the hda-verb command chunk until it works. It’s easiest to have something looping in the background so you can immediately hear when it starts. I didn’t have to restart pulseaudio when the sound finally started working so it may not even be necessary after the first time. You may just have to experiment, but if you’re persistent it should eventually work.


Edit: This fix stops working upon waking the PC from sleep, where you then need to run the commands again. It’s not ideal, but still better than nothing.

Edit 2: It also stops working if there is no audio playing for a few seconds. On windows I had an issue with there being a couple second pause when starting to play audio after a period of silence. I’m assuming its a similar situation here where the audio drivers go to sleep. Perhaps there’s a way to permanently set the pins with hdajackretask, but I’m not sure how I’d go about that. I’ve also found that upon running the command audio immediately starts being played, without having to restart pulseaudio.