Set module parameter at stratup

Hi!
I need to modify a module’s parameter at startup (I want to set power_save=20 for snd_hda_intel).
I have tried to add snd_hda_intel.power_save=20 in grub from YaST> System> Boot Loader> Boot Loader Options and also tried to add

echo 20 > /sys/module/snd_hda_intel/parameters/power_save

to /etc/init.d/boot.local but with no success, because if I type

cat /sys/module/snd_hda_intel/parameters/power_save

I still get a 0.

If I try the echo command during a session it works, but I’d like to have it loaded automatically, what am I doing wrong?
Thanks in advance.

Hi
You would add to /etc/modprobe.d/50-sound.conf is probably the best
place;


options power_save=20


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 1 day 7:45, 3 users, load average: 0.88, 0.99, 1.03
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

On 10/14/2012 07:30 AM, malcolmlewis wrote:
>

> Hi
> You would add to /etc/modprobe.d/50-sound.conf is probably the best
> place;
>


> options power_save=20
> 

>

Any options line needed to specify the module. I think that new line needs to be
‘options snd_hda_intel power_save=20’.

So to condense the suggestions here. You should edit the file: /etc/modprobe.d/50-sound.conf, as root and add a line that says:

options snd_hda_intel power_save=20

I have a bash script you can use to make such edits as root here: SYSEdit - System File Editor - Version 1.00 - Blogs - openSUSE Forums

Thank You,

Thank you all for the help.
First, here is my /etc/modprobe.d/50-sound.conf:

options snd slots=snd-hda-intel
# u1Nb.Kd3VUUVAEMF:82801G (ICH7 Family) High Definition Audio Controller
alias snd-card-0 snd-hda-intel



I added the following line

options snd_hda_intel power_save=20

but didn’t work, then I thought I should use “-” instead of “_”, as it appears in the file itself a couple of times, but even this doesn’t change anything. I also tried power-save instead of power_save but with no success. (Anyway I see now in online documentation that the two characters are considered the same, but I tried anyway)
Considering the alias I also tried to use snd-card-0 instead of snd-hda-intel, same old.

Is it possible that something sets that default value after this step at boot time? If so, is it possible to run a script at the very last step of the start up process? Or is it something that need to take place in early steps during boot time to take effect?

You certainly could try adding your line that works:

echo 20 > /sys/module/snd_hda_intel/parameters/power_save

To the file /etc/init.d/boot.local as root (SYSEdit) or look at my blog on getting the /etc/init.d/after.local file working under systemd and lets us know if that worked for you.

systemd and using the after.local script in openSUSE 12.1/12.2 - Blogs - openSUSE Forums

Thank You,

At lease pm-utils script (pm-powersave) does tweak this parameter and as far as I can tell it is called by default by upowerd. You could try disable RunPowersaveCommand in /etc/UPower/UPower.conf and test if it changes anything. If it helps, more granular solution would be disable or tweak pm-utils power.d script intel-audio-powersave.

Hi
There is not that parameter for the module… only;


parm: power_save:Automatic power-saving timeout (in second, 0 = disable). (int)
parm: power_save_controller:Reset controller in power save mode. (bool)


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 1 day 13:44, 3 users, load average: 0.04, 0.75, 1.19
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

You made me understand the reason why it was not working. It was laptop-mode that was overwriting any change to the configuration, removing it’s control over the audio device by editing /etc/laptop-mode/conf.d/intel-hda-powersave.conf solved the issue. Now the “options snd_hda_intel power_save=20” makes the job.

Thank you all for the help :wink:

"

So can you check the output off;


cat /sys/module/snd_hda_intel/parameters/power_save_controller

Mine is set to Y but power_save is 0


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 1 day 13:58, 3 users, load average: 0.17, 0.10, 0.50
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

Mine was N, I forced it to Y with the same trick.

Little offtopic: do you think I should remove laptop-mode-tools? At this point I’m not sure it gives some more battery life…

Ok, never mind. I found many options in laptop-mode config files, it is not so useless :wink: