Hey, Did You Hear That?
I didn't either. Somewhere along the path of switching yum repos and upgrading various X11, KDE and Gnome rpms, I lost my sound configuration. Every time I rebooted, which is quite often on my laptop, I had to reset all the Alsa Mixer volume controls. This grew to be rather tiresome since this includes 6 different sliders. Even one slider is too many though. It would be cool if the computer could simply remember.
Luckily there is a solution, xinit.
Scripts placed in the /etc/X11/xinit/xinitrc.d directory are executed automatically whenever the X server is started. (Caveat: xinitrc-common actually only executes scripts that end in '.sh'.) I added the following script:
BEGIN /etc/X11/xinit/xinitrc.d/soundcard.sh
#!/bin/bash
/usr/sbin/alsactl restore
END /etc/X11/xinit/xinitrc.d/soundcard.sh
This restores the previously saved Alsa Mixer settings. Those settings are persisted by the following command:
/usr/sbin/alsactl store
That command must be run as root because the settings are saved to /etc/asound.state. You could instead use the '-f' parameter to specify an alternate file if you feel the need to have per user settings.
I happened upon this information by digging through /etc/modprobe.conf. My colleague had noticed the playing the test sound under "Soundcard Detection" triggered the restoration of sound. I figured it was simply a module loading problem. However, I already had the proper pieces in place in modprobe.conf:
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0
This seems to indicate that the Alsa Mixer settings should be automatically saved at shutdown and restored at bootup. I even tried adding an initialization script to /etc/init.d to perform these functions explicitly. This did not work for me. There must be some sort of reset to the sound card settings each time X starts that overwrites anything that happened at boot time.
I noticed that if I ran '/usr/sbin/alsactl restore' from a terminal window after X had started that sound was correctly restored. I am not sure why, but I had to run '/usr/bin/alsactl store' by hand as root before my soundcard.sh script would function properly. In any event, this fairly simple change saves a little frustration on each reboot.
Luckily there is a solution, xinit.
Scripts placed in the /etc/X11/xinit/xinitrc.d directory are executed automatically whenever the X server is started. (Caveat: xinitrc-common actually only executes scripts that end in '.sh'.) I added the following script:
BEGIN /etc/X11/xinit/xinitrc.d/soundcard.sh
#!/bin/bash
/usr/sbin/alsactl restore
END /etc/X11/xinit/xinitrc.d/soundcard.sh
This restores the previously saved Alsa Mixer settings. Those settings are persisted by the following command:
/usr/sbin/alsactl store
That command must be run as root because the settings are saved to /etc/asound.state. You could instead use the '-f' parameter to specify an alternate file if you feel the need to have per user settings.
I happened upon this information by digging through /etc/modprobe.conf. My colleague had noticed the playing the test sound under "Soundcard Detection" triggered the restoration of sound. I figured it was simply a module loading problem. However, I already had the proper pieces in place in modprobe.conf:
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0
This seems to indicate that the Alsa Mixer settings should be automatically saved at shutdown and restored at bootup. I even tried adding an initialization script to /etc/init.d to perform these functions explicitly. This did not work for me. There must be some sort of reset to the sound card settings each time X starts that overwrites anything that happened at boot time.
I noticed that if I ran '/usr/sbin/alsactl restore' from a terminal window after X had started that sound was correctly restored. I am not sure why, but I had to run '/usr/bin/alsactl store' by hand as root before my soundcard.sh script would function properly. In any event, this fairly simple change saves a little frustration on each reboot.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home