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 02-23-2011, 11:27 AM   #1
rayandrews
Member
 
Registered: Sep 2010
Posts: 78

Rep: Reputation: 2
alsactl store won't stick


Hi,

Running Slack 12.2. I'm getting all sorts of nasty noises out of my speakers. When I fire up alsamixer I see that 'mic' and 'mic boost' are both unmuted.
I mute them and all is well, then 'alsactl store' to save it. But on restart the 'mic' is back to unmuted. What do I need to do to get the change to stick?
BTW, I've tried the changes to alsamixer and alsactl as root, as user, from Konsole, from command line before startx, after shutting down X -- every combination and nothing works.
 
Old 02-23-2011, 12:14 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
CD into your /etc/init.d directory and look to see if you have a file called alsasound. If you do, look over it and see if any default values are in there.

Also, I know KMix can restore values on boot. Not sure if you have it or not installed... If you do, I advise to see if the "Restore volumes on login" option is unchecked. Let me know if this helps, thanks!
 
Old 02-23-2011, 01:33 PM   #3
rayandrews
Member
 
Registered: Sep 2010
Posts: 78

Original Poster
Rep: Reputation: 2
Hi corp769,

Quote:
Originally Posted by corp769 View Post
CD into your /etc/init.d directory and look to see if you have a file called alsasound. If you do, look over it and see if any default values are in there.

Also, I know KMix can restore values on boot. Not sure if you have it or not installed... If you do, I advise to see if the "Restore volumes on login" option is unchecked. Let me know if this helps, thanks!
Nope, no such file, but I did find /etc/rc.d/rc.alsa, and when I clicked on it, the problem vanished. It looks like the right sort of file, and is says the right sort of things. Perhaps if I could get it to execute on startup?
 
Old 02-23-2011, 01:41 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
What do you mean when you clicked on it?

---------- Post added 02-23-11 at 08:42 PM ----------

And post the contents of that file if you could....
 
Old 02-23-2011, 06:19 PM   #5
rayandrews
Member
 
Registered: Sep 2010
Posts: 78

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by corp769 View Post
What do you mean when you clicked on it?

---------- Post added 02-23-11 at 08:42 PM ----------

And post the contents of that file if you could....
Well, it's a script file, so a double click executes it, correct? I have thunar set to 'single click executes' but I think I should have said 'double click' just to be clear.
 
Old 02-23-2011, 07:43 PM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Oh ok, I see. Could you post the contents of /etc/rc.d/rc.alsa?
 
Old 02-24-2011, 04:38 PM   #7
rayandrews
Member
 
Registered: Sep 2010
Posts: 78

Original Poster
Rep: Reputation: 2
Ok, here it is:


#!/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
# It's possible a user might not want to set a default sound state.
# In that case, do this: touch /etc/no.asound.state
if [ ! -r /etc/no.asound.state ]; then
echo "Setting default ALSA mixer settings."
# set default mixer volumes for ALSA
# Taken from the alsaconfig script.
amixer -s -q <<EOF
set Master 75% unmute
set Master -12dB
set 'Master Mono' 75% unmute
set 'Master Mono' -12dB
set Front 75% unmute
set Front -12dB
set PCM 90% unmute
set PCM 0dB
mixer Synth 90% unmute
mixer Synth 0dB
mixer CD 90% unmute
mixer CD 0dB
# mute mic
set Mic 0% mute
# ESS 1969 chipset has 2 PCM channels
set PCM,1 90% unmute
set PCM,1 0dB
# Trident/YMFPCI/emu10k1
set Wave 100% unmute
set Music 100% unmute
set AC97 100% unmute
# CS4237B chipset:
set 'Master Digital' 75% unmute
# Envy24 chips with analog outs
set DAC 90% unmute
set DAC -12dB
set DAC,0 90% unmute
set DAC,0 -12dB
set DAC,1 90% unmute
set DAC,1 -12dB
# some notebooks use headphone instead of master
set Headphone 75% unmute
set Headphone -12dB
set Playback 100% unmute
# turn off digital switches
set "SB Live Analog/Digital Output Jack" off
set "Audigy Analog/Digital Output Jack" off
EOF
echo "Storing default ALSA mixer settings: /usr/sbin/alsactl store"
/usr/sbin/alsactl store
fi
fi
}

# A function to load the ALSA OSS compat modules:
load_alsa_oss_modules() {
if ! cat /proc/modules | tr _ - | grep -wq snd-pcm-oss ; then
echo "Loading OSS compatibility modules for ALSA."
modprobe snd-pcm-oss
modprobe snd-seq-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_oss_modules
load_alsa_mixer
else
# If there are ALSA modules defined in /etc/modprobe.conf, but
# ALSA is not yet loaded, then load the modules now:
DRIVERS=$(modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | tr -s "[[:blank:]]" " " | cut -d " " -f 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_oss_modules
load_alsa_mixer
fi
fi
 
Old 02-24-2011, 05:06 PM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Tell me if either of these exists:

/etc/asound.state
/etc/no.asound.state
 
Old 03-25-2011, 03:45 PM   #9
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

Rep: Reputation: 41
Same problem here

I've got the same problem with alsactl store 0 not causing the settings to be preserved after reboot. Before I started working on this, neither of the state files existed. I did a touch /etc/no.asound.state as suggested in rc.alsa, but it didn't help. I also note that the file /var/lib/alsa/asound.state, mentioned in the alsactl manpage, was modified during the shutdown.
 
Old 03-25-2011, 06:26 PM   #10
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
I think you should run alsactl store as root.
 
Old 03-25-2011, 07:04 PM   #11
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

Rep: Reputation: 41
alsactl must run as root

If you try to run alsactl not as root, permission will be denied. So running it as root is the only way to run it at all.
 
Old 03-25-2011, 09:57 PM   #12
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

Rep: Reputation: 41
No /etc/rc.d/rc.alsa

Interesting -- in my system, the file /etc/rc.d/rc.alsa doesn't exist at all. In fact,/etc/rc.d doesn't exist -- all the agents are in directories /etc/rc.?.I've been trying to figure out the logic of the shutdown processing for alsa, but so far haven't been able to decode it. I haven't found any calls in those directories for alsa stuff. I did discover that there are indirect calls on alsa-utils stop, which doesn't change the alsamixer settings. I'm running Kubuntu 10.10 Maverick with KDE 4.6.1 and kernel 2.6.35-28.
 
  


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
alsactl store settings gone after reboot or X restart mlangdn Slackware 2 07-10-2009 07:49 AM
Alsactl store doesn't work jens1245 Linux - Newbie 5 05-16-2009 09:17 AM
alsactl store not saving settings JosephS Linux - Software 2 12-14-2008 08:14 AM
alsactl store doralsoral Linux - Software 2 05-20-2004 09:14 PM
alsactl store promblem doralsoral Linux - Software 0 05-17-2004 10:38 PM

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

All times are GMT -5. The time now is 05:41 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