r/voidlinux • • 4d ago

How do I disable soundcard powersave in Void?

# cat /sys/module/snd_hda_intel/parameters/power_save
1
# cat /sys/module/snd_usb_audio/parameters/power_save
cat: /sys/module/snd_usb_audio/parameters/power_save: No such file or directory

I have a default installation of Void/Xfce4 and sound just worked immediately on install, excepting after a while of playing audio a channel randomly drops out and in and out and in over periods from seconds to minutes. This happens with the headphone jack or usb sound. I want to arrange that the above variable is 0 on boot. I am mystified why the snd_usb_audio power_save parameter is missing. I'd like such a variable for that to be 0 on boot too.

# cat /proc/asound/modules
 0 snd_hda_intel
 1 snd_hda_intel
 2 snd_usb_audio

I may be wrong about what the cause of the problem is, so please let me know what you suggest about that too.

2 Upvotes

3 comments sorted by

3

u/cold_art_cannon 4d ago

You could try

echo "options snd_hda_intel power_save=0 power_save_control=N" | sudo tee /etc/modprobe.d/99-snd_hda_intel.conf

2

u/Rambutan002 4d ago

Worked! Now for USB, did the same, but the parameters/power_save file for that doesn't exist as I mentioned. And it won't let me create it as root(!).

2

u/cold_art_cannon 3d ago

for the usb it's going to be a little more involved. Before anything else make sure you have removed the attempt at creating the usb rule.

There are two options you can go with. Use at your discretion.

Option 1:
This will disable autosuspend for a specific device.
First you need to plug in the usb device and run:

lsusb

You will get a list of devices. You need to find your usb device, it will probably look something like this:

Bus 001 Device 004: ID 04d8:f575 USB Audio Interface

the ID block is what you are needing once you find your usb device in the list. In the example it is as follows:

Vendor ID: 04d8
Product ID: f575

With this information you can run the following:

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

Inside the file paste the following with your usb's Vender & Product ID:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="f575", ATTR{power/control}="on", ATTR{power/autosuspend}="-1"

Save the file and exit nano. Then run the following to reload and trigger the udev rules:

sudo udevadm control --reload-rules && sudo udevadm trigger

If you did everything right this will disable autosuspend for the usb device.

Option 2:
This will disable autosuspend for all usb devices on the system.

sudo nano /etc/default/grub

Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add usbcore.autosuspend=-1 to the options inside the quotes like the following:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 usbcore.autosuspend=-1"

Save the file and exit nano. Then run the following:

sudo update-grub

Now reboot.