LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I get ALSA mixer to remember the its settings? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-get-alsa-mixer-to-remember-the-its-settings-568429/)

halfpower 07-11-2007 09:58 AM

How do I get ALSA mixer to remember the its settings?
 
I'm pretty sure they are being reset every time I boot up. This causes a relay or something in my sound card to make a clicking noise on every boot.

EDIT: It's not when I boot up, it's when I start KDE.

BrianHenderson 07-11-2007 11:12 AM

The command "alsactl store" will tell alsa to store the settings.

GrapefruiTgirl 07-11-2007 11:15 AM

When the system boots, it should execute a file called something like /etc/rc.d/rc.alsa.
This in turn will read a file called /etc/alsa-something (I cannot recall the exact name -- my system's down right now) but it's in /etc and its called alsa-restore or alsa-settings or alsa.conf or something like this.
If that file is not there, then you ought to run (from a console as root) 'alsamixer' and this should bring up the alsa mixer control panel.
Use your arrow and space keys to configure the settings, and when done, exit (ESC I think) then type 'alsactl store' which should save the settings into the config file in /etc.
Now make sure your system is executing rc.alsa when it boots, and that the rc.alsa file IS executable.

That should do the trick.. Let us know :)

halfpower 07-19-2007 06:52 PM

Thanks.

I found a file called /etc/rc.d/rc.alsa. It is a shell script that contains the following script segment
Code:

load_alsa_mixer() {
  if [ -r /etc/asound.state ]; then
    echo "Loading ALSA mixer settings:  /usr/sbin/alsactl restore"
    /usr/sbin/alsactl restore
  else
    echo "ALSA warning:  No mixer settings found in /etc/asound.state."
    echo "  Sound may be muted.  Use 'alsamixer' to unmute your sound card,"
    echo "  and then 'alsactl store' to save the default ALSA mixer settings"
    echo "  to be loaded at boot."
  fi
}

I made the changes to alsamixer and then successfully ran the command
Code:

alsactl store
I think that did the trick, but I'll have to reboot twice to see find out if it worked.

halfpower 07-25-2007 09:04 AM

Okay. That didn't work. For some reason the configuration that is enabled by "alsactl restore" is getting reset when I start KDE. I think KDE must be activating some other configuration somehow.

pwc101 07-25-2007 09:55 AM

I had something similar with KDE when I upgraded from 11.0 to 12.0. I never found what it was, but if I created a new user, they didn't have any problems using sound in KDE. I also found that running alsactl restore as root restored the sound. It seemed as though KDE was doing something to the sound...

Thus, the 'solution' I found was to move ~/.kde to ~/.kde.old, log out, log back in again, and the sound problem was magically fixed. There was obviously something in ~/.kde that broke the sound. The only downside was I had to reconfigure KDE from scratch, but that only took a few minutes in the end. Oh, and I then deleted ~/.kde.old to save disk space :) If you found this solved the problem, you could try and see which of the files in ~/.kde was responsible for the problem, but I didn't have the patience!

GrapefruiTgirl 07-25-2007 11:11 AM

Another thought would be to make sure you are actually using the ALSA sound system, and not one of the other sound engines (whatever they're called I can't recall, but enlightenment sound daemon and 'open'/threaded sound system come to mind)..

tredegar 07-25-2007 11:20 AM

Try this:
Set your volume control as you like it.
Close all open windows.
Then System -> KDE Components -> Session Manager
Set it to "Resoore manually saved session"
Click Apply, close the window.
Then K -> Save session. This saves the (empty) session, including your volume level.
Logout, login. Better?

Cringe 08-01-2007 02:55 AM

Quote:

Originally Posted by tredegar
Try this:
Set your volume control as you like it.
Close all open windows.
Then System -> KDE Components -> Session Manager
Set it to "Resoore manually saved session"
Click Apply, close the window.
Then K -> Save session. This saves the (empty) session, including your volume level.
Logout, login. Better?

I had the same problem as Halfpower, and this didn't fix it. I did, however, find out that I had another program overwriting ALSA's levels. The culprit was KMix, you can get to it via K/Multimedia/KMix or $ kmix. Go to Settings/Configure and uncheck "Restore Volumes at Login."

You may have a different program doing it, but that's how you need to get it done.

Good luck!

tredegar 08-01-2007 03:50 AM

Cringe,
Thanks for the follow-up, and welcome to LQ!


All times are GMT -5. The time now is 02:23 AM.