[RESOLVED] Framework 13 AMD headphone jack buzz when not playing audio

I’m on Arch Linux. The solution works, but only temporarily - when I restart OR if i plug out or plug in the charger after running that command - the setting resets and I get the buzzing. Anyone know a permanent solution to the problem? I even agree to a hacky solution like a service that runs this command each time on restart and on change of power source.

The awful idea I had was just write a while loop to check the file to see if it ever changes from 0, then run the command to set it to 0 again. Maybe put a sleep in there so you aren’t just doing that all the time. Create a systemd unit file to run that script and enable it. Not trying to promote my silly wiki doc, but something like the following: Power Management - taim/my-setup - Codeberg.org. I’m not seeing that problem, so I can’t test it.

With the help of ChatGPT I (or chatgpt) came up with a somewhat more elegant solution (still hacky):
Create service

sudo nano /etc/systemd/system/set-snd_hda_intel-power_save.service

with the following content

[Unit]
Description=Set snd_hda_intel power_save parameter to 0
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 0 > /sys/module/snd_hda_intel/parameters/power_save'

[Install]
WantedBy=multi-user.target

enable and start service

sudo systemctl enable set-snd_hda_intel-power_save.service
sudo systemctl start set-snd_hda_intel-power_save.service

Create udev rule

sudo nano /etc/udev/rules.d/99-power.rules

and paste following

SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/usr/bin/systemctl start set-snd_hda_intel-power_save.service"
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/usr/bin/systemctl start set-snd_hda_intel-power_save.service"

Reload and test rules

sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=power_supply

P.S.
Actual conversation with the almighty intelligence https://chatgpt.com/share/f2594693-1e2e-4f86-9e08-b3d76908da69. There is a suggestion for a script that sets everything up, I haven’t tried it though.

1 Like

You need to set is as kerner parameter. Preferably during the boot.
It wasn’t easy for me to find but in dracut there was a file that updates the kermer parameters with kernel updates. For vanilla system-d boot or for grub you have to find different methods. In systemd-boot there is a file in /efi(or boot) /loader/entries/
There you pick the file and edit it for the parameters. For me it was that amd gpu fix and this audio fix

The simplest way to make the workaround permanent is:

echo "options snd_hda_intel power_save=0" \
 | sudo tee /etc/modprobe.d/audio_disable_powersave.conf

No systemd service or udevadm necessary. This loads after reboot, for the first time you may make:

echo 0 | sudo tee /sys/module/snd_hda_intel/parameters/power_save

(I had the same problem, fresh Fedora 40, Framework 13 AMD; the audio cable looks well-seated, I did not try to re-seat it).