LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-16-2004, 11:53 AM   #1
SnowSurfAir
Member
 
Registered: Mar 2003
Distribution: Redhat 9
Posts: 459

Rep: Reputation: 30
Alsamixer settings wont stick


I have finally gotten alsa to work on my RH 9 comp. There is only one problem I would like to fix. I run alsamixer to unmute all the channels, then alsactl store to save it but when I reboot it doesn't stay. All of the setting are muted and are at zero. Is there any way to fix this? Many thanks in advance.
 
Old 07-16-2004, 11:57 AM   #2
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
you will need to get the startup scripts to do
alsactl restore

to restore the settings; usually alsactl is in either /usr/sbin or /usr/local/sbin

look for an rc.local script and put that command in there
 
Old 07-16-2004, 11:58 AM   #3
SnowSurfAir
Member
 
Registered: Mar 2003
Distribution: Redhat 9
Posts: 459

Original Poster
Rep: Reputation: 30
what will that do restore it to my settings or to muted?
 
Old 07-16-2004, 01:55 PM   #4
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
that command will restore your saved settings, which usually get stored in /etc/asound.state

if you don't have that command, you may not have all the alsa packages; typically, you need the driver, the oss compatibility, libs, and utils
 
Old 07-16-2004, 04:04 PM   #5
SnowSurfAir
Member
 
Registered: Mar 2003
Distribution: Redhat 9
Posts: 459

Original Poster
Rep: Reputation: 30
well is there any way to make it so that it runs at start-up? so I dont have to run it everytime
 
Old 07-16-2004, 04:57 PM   #6
Russb
Member
 
Registered: Jul 2004
Location: Sembach AB, Germany
Distribution: Gentoo Linux
Posts: 65

Rep: Reputation: 15
Quote:
Originally posted by TheOneAndOnlySM
you will need to get the startup scripts to do
alsactl restore

to restore the settings; usually alsactl is in either /usr/sbin or /usr/local/sbin

look for an rc.local script and put that command in there
I believe he said how to get it to stick. It should restore, on boot up, your previous settings.
 
Old 07-16-2004, 05:24 PM   #7
SnowSurfAir
Member
 
Registered: Mar 2003
Distribution: Redhat 9
Posts: 459

Original Poster
Rep: Reputation: 30
ya but it doesn't it goes back to muted and all the channels are at 0
 
Old 07-16-2004, 05:24 PM   #8
Russb
Member
 
Registered: Jul 2004
Location: Sembach AB, Germany
Distribution: Gentoo Linux
Posts: 65

Rep: Reputation: 15
Ok, well... The aslactl restore works fine when I reboot, but I have to go superuser and do it maunally because it is not executing frfrom my script. Here it is:


Code:
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local setup commands in here:
/usr/sbin/alsactl restore
Is that not right??

Oh, I have also tried:

Code:
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local setup commands in here:
alsactl restore
Both to no avail...

Last edited by Russb; 07-16-2004 at 05:26 PM.
 
Old 07-16-2004, 05:53 PM   #9
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
do you alsactl installed?

in a terminal, become root and do
alsactl restore

if you get "command not found" then it isn't installed; if it is installed and the command isn't working at startup, it is probably because you need to have the alsa modules loaded before the alsactl restore does anything

so, you can put in your rc.local script
modprobe snd_module
alsactl restore

as for slackware, you don't need to use rc.local; there should be an rc.alsa script in /etc/rc.d; just make sure it is executable with
chmod +x /etc/rc.d/rc.alsa
 
Old 07-16-2004, 06:19 PM   #10
Russb
Member
 
Registered: Jul 2004
Location: Sembach AB, Germany
Distribution: Gentoo Linux
Posts: 65

Rep: Reputation: 15
When you say make sure it is executable with that chmod you mean put it in the rc.alsa script? Here is my stock script:

Code:
#!/bin/sh
# Load the mixer settings and OSS compatibility for ALSA.
# (the Advanced Linux Sound Architecture)

# A function to load the ALSA mixer settings:
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 ca
rd,"
    echo "  and then 'alsactl store' to save the default ALSA mixer sett
ings"
    echo "  to be loaded at boot."
  fi
}
# A function to load the ALSA OSS compat modules:
load_alsa_oss_modules() {
  if ! cat /proc/modules | grep -w snd-pcm-oss 1> /dev/null 2> /dev/null
 ; then
    echo "Loading OSS compatibility modules for ALSA."
    modprobe snd-pcm-oss
    modprobe snd-mixer-oss
  fi
}

# If hotplug or something else has loaded the ALSA modules, then
# simply load the mixer settings and make sure the OSS compat
# modules are loaded:
if [ -d /proc/asound ]; then
  load_alsa_mixer
  load_alsa_oss_modules
else
  # If there are ALSA modules defined in /etc/modules.conf, but
 # ALSA is not yet loaded, then load the modules now:
  DRIVERS=`modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card
-[[:digit:]]" | awk '{ print $3 }'`
  if [ ! "$DRIVERS" = "" ]; then
    echo "Loading ALSA kernel modules."
    for module in $DRIVERS; do
      modprobe $module
    done
  fi
  # If ALSA is now up, then load the mixer settings and OSS modules:
  if [ -d /proc/asound ]; then
    load_alsa_mixer
    load_alsa_oss_modules
  fi
fi
And yes, all the alsa commands work.
 
Old 07-16-2004, 07:38 PM   #11
SnowSurfAir
Member
 
Registered: Mar 2003
Distribution: Redhat 9
Posts: 459

Original Poster
Rep: Reputation: 30
well I have it installed and it works. I just want to know if there was any way to make it work when the system was starting up
 
Old 07-16-2004, 07:41 PM   #12
Russb
Member
 
Registered: Jul 2004
Location: Sembach AB, Germany
Distribution: Gentoo Linux
Posts: 65

Rep: Reputation: 15
That is what I am trying to figure out too!
 
Old 07-16-2004, 09:23 PM   #13
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
for slackware, you need to make the script executable because it will allow the script to be executed at bootup

you simply need to run this command: chmod +x /etc/rc.d/rc.alsa (as root)
make sure that you have run alsaconf to generate the proper modules.conf files and set some sane sound states; run alsamixer to unmute the channels and hit escape; they should be saved


snowsurfair: i am not familiar with redhat's startup scripts; you need to find something like an empty rc.local script in your init scripts directory; just put the line alsactl restore in that file
 
Old 07-16-2004, 11:19 PM   #14
SnowSurfAir
Member
 
Registered: Mar 2003
Distribution: Redhat 9
Posts: 459

Original Poster
Rep: Reputation: 30
Now do I place the whole file or just the command, not current ly on that comp
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
alsamixer does not save my settings brandonloserkid Slackware 15 09-09-2007 05:27 PM
alsamixer settings won't stick, "alsactl restore" as root after song change apax Linux - Software 0 01-01-2005 10:07 AM
alsamixer settings not restored in FC3 makuz Fedora 6 12-25-2004 03:57 PM
Losing my alsamixer settings after a reboot moger Slackware 4 07-05-2004 10:17 PM
ALSAmixer does not remember settings? Pwcca Linux - Software 3 08-05-2003 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration