Unable to automatically set snd_hda_intel power_save to 0

There has been a popping sound every time I start playing audio which seems to be caused by snd_hda_intel power_save being enabled.


cat /sys/module/snd_hda_intel/parameters/power_save

By default this returns 10. If I set it to 0 manually using something like


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

the popping sound stops. Obviously I want this set to 0 automatically though. However making a .conf file in /etc/modprobe.d with

options snd_hda_intel power_save=0

inside it, running dracut -f and rebooting doesn’t actually seem do anything since power_save is still set to the default value of 10. I’ve also tried doing


sudo grubby --update-kernel='ALL' --args='snd_hda_intel.power_save=0'

according to Speakers popping, how to make power save options permanent? - #3 by Espionage724 however that hasn’t worked either.

I just tried this and it worked for me. You mean you made a file with a name that ends in .conf right? (I named mine my-sound.conf.) Also, I didn’t need to run dracut. I did reboot though.

Yeah, I created a file that ends in .conf
I only tried using dracut after rebooting didn’t seem to work

Does your added kernel parameter show in the output of cat /proc/cmdline? That really should have worked as well.

Otherwise I guess something is resetting it back to 10. Maybe sudo dmesg | grep snd_hda_intel would provide some hints?

you may also want to take a look at
grep -r snd_hda /etc/modprobe.d/

1 Like

It does show that it’s been added to the kernel parameters
output of sudo dmesg | grep snd_hda_intel

[ 0.000000] Command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-6.12.7-200.fc41.x86_64 root=UUID=d7806234-07d7-4f4e-befe-76f9368ccbf9 ro rootflags=subvol=root rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau snd_hda_intel.power_save=0
[ 0.031337] Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-6.12.7-200.fc41.x86_64 root=UUID=d7806234-07d7-4f4e-befe-76f9368ccbf9 ro rootflags=subvol=root rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau snd_hda_intel.power_save=0
[ 4.966927] snd_hda_intel 0000:00:1f.3: enabling device (0000 → 0002)
[ 4.972510] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 4.973156] snd_hda_intel 0000:01:00.1: enabling device (0000 → 0002)
[ 4.973263] snd_hda_intel 0000:01:00.1: Disabling MSI
[ 4.973272] snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client

output of grep -r snd_hda /etc/modprobe.d/

disable-audio-powersave.conf:options snd_hda_intel power_save=0

I only have it set once here

1 Like

It looks like it’s interacting with the i915 driver and that has its own power save settings:

$ modinfo -p i915 | grep power
enable_dc:Enable power-saving display C-states. (-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6; 3=up to DC5 with DC3CO; 4=up to DC6 with DC3CO) (int)
disable_power_well:Disable display power wells when possible (-1=auto [default], 0=power wells always on, 1=power wells disabled when possible) (int)
edp_vswing:Ignore/Override vswing pre-emph table selection from VBT (0=use value from vbt [default], 1=low power swing(200mV),2=default swing(400mV)) (int)
enable_fbc:Enable frame buffer compression for power savings (default: -1 (use per-chip default)) (int)

Maybe you also need to disable power saving on your video driver? I don’t know. There are also power save settings for the whole PCI controller (pcie_aspm=off). That might work as a sort of “big hammer” approach.

Setting enable_dc to 0 didn’t do anything either

Are you using tuned and/or using the power profiles?

If so does changing the profile to performance help?

Double checking this on my laptop, and assuming it’s the same problem.

After installing tuned-ppd:
The power save and balanced profile set the power_save value to 10.
The performance profile uses what ever the kernel setting is.

If you want to utilize the kernel settings and leave tuned installed:
copy the profiles over to /etc/tuned/profiles

sudo cp -p -R /usr/lib/tuned/profiles/{balanced,powersave} /etc/tuned/profiles/

using your editor of choice with admin privileges modify:

/etc/tuned/profiles/balanced/tuned.conf
/etc/tuned/profiles/powersave/tuned.conf

remove:

[audio]
timeout=10

If you want to use the tuned profile settings.
copy the profiles over to /etc/tuned/profiles

sudo cp -p -R /usr/lib/tuned/profiles/{balanced,powersave,throughput-performance} /etc/tuned/profiles/

using your editor of choice with admin privileges modify:

/etc/tuned/profiles/balanced/tuned.conf
/etc/tuned/profiles/powersave/tuned.conf

Change 10 to 0

[audio]
timeout=0

/etc/tuned/profiles/throughput-performance/tuned.conf

Add

[audio]
timeout=0

I added it above the [video] section.

You could also uninstall tuned and tuned-ppd

4 Likes

Yep setting it to performance worked, thanks!

There is also a gui to modify things if you install tuned-gtk

edit: From my perspective this was easier to modify via the command line.

Especially with a such a nice list of commands to cut n paste :bluethumb:

Thank you! this has been driving me crazy for the past couple of hours. None of the other solutions on my search worked.

After asking on the mailing list and found out there’s an easier way to do this.

You can make whatever directory name you’d like to use for your profile to override the defaults. I used the below.

sudo mkdir /etc/tuned/profiles/overrides

Create a new file tuned.conf in the overrides directory with the following contents.
[audio]
timeout=0

Edit /etc/tuned/post_loaded_profile and add the directory name that was created earlier.

systemctl restart tuned

1 Like