LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-28-2003, 03:19 PM   #1
LinFreak!
Member
 
Registered: Jul 2003
Location: England
Distribution: slack9.1
Posts: 209

Rep: Reputation: 30
setting up alsa defaults


Hi all,

Does anyone know how to setup default volume levels and unmute line in for alsa? I presume you put something in the /usr/share/alsa/alsa.conf but I can find no mention of it in the readme's, howto's or on lq.
On my system I have made ~./.asoundrc and inserted:

pcm.cmipci {
type hw
card 0
}

ctl.cmipci {
type hw
card 0
}

Sound works fine but I have to umute things and adjust volumes at startup

Any help would be appreciated.

ps. perhaps this should be in the howto?
 
Old 09-28-2003, 03:29 PM   #2
Nechos
Member
 
Registered: Sep 2003
Location: Italy
Distribution: Ubuntu 13.10
Posts: 304

Rep: Reputation: 30
how about alsamixer?
 
Old 09-28-2003, 04:42 PM   #3
LinFreak!
Member
 
Registered: Jul 2003
Location: England
Distribution: slack9.1
Posts: 209

Original Poster
Rep: Reputation: 30
No, you misunderstand, I can use that to set up volumes but I want to save those settings (alsamixer exits without saving its settings).
edit: no mention of it in alsamixer man page

Last edited by LinFreak!; 09-28-2003 at 04:45 PM.
 
Old 09-28-2003, 05:39 PM   #4
breakerfall
Member
 
Registered: Jun 2003
Location: Manchester, UK
Distribution: Gentoo
Posts: 306

Rep: Reputation: 30
I had this problem originally.

When I came to re-installing ALSA, I added it to the startup.

Try rc-update add alsasound boot and reboot and then check the levels in the alsa mixer. I knew that they weren't by default with me. But after adding this line so that it would start at boot time, when checking, the mixer already had the levels set and I didn't need to do it manually [whereas I did previously after every time I started the computer]

Anyway, give it a try and tell us what happens.

[EDIT] changed line!!!

rc-update add alsasound boot is correct

Last edited by breakerfall; 09-28-2003 at 05:43 PM.
 
Old 09-28-2003, 05:59 PM   #5
LinFreak!
Member
 
Registered: Jul 2003
Location: England
Distribution: slack9.1
Posts: 209

Original Poster
Rep: Reputation: 30
Hmm. Do you mean for me to type "rc-update add alsa boot" as root? If so, the command rc-update doesn't exist on my system . I haven't missed something obvious have I?

edit: same applies with alsasound.....

Last edited by LinFreak!; 09-28-2003 at 06:02 PM.
 
Old 09-29-2003, 08:42 AM   #6
breakerfall
Member
 
Registered: Jun 2003
Location: Manchester, UK
Distribution: Gentoo
Posts: 306

Rep: Reputation: 30
hmmm.. I'm not sure about slack then... but try starting alsa whilst you're in the system. There should be a way that you can get ALSA to auto load. When you do this, it should have the channels unmuted.

Am I correct in thinking that at the moment you have to load up ALSA mixer to un-mute after every bootup?

I'm just checking some info and I've come across some that I didn't need to do. You might need to do this.

Quote:
Running and unmuting

Since we're Linux users, we don't want to reboot. So we'll start the alsasound script manually.

Code listing 3.2

# /etc/init.d/alsasound start

ALSA is running now. If everything is ok, you should be able to see the ALSA modules loaded when running lsmod. However, sound won't work yet, because the channels are still muted. We need amixer for this.

Code listing 3.3: Running amixer

# amixer

Warning: You shouldn't get this, but if you get an error about "amixer: Mixer attach default error: No such file or directory", you should manually modprobe snd-mixer-oss and snd-pcm-oss once. After that run amixer again.

Code listing 3.4: only if you get an error when running amixer

# modprobe snd-mixer-oss
# modprobe snd-pcm-oss
# amixer

If you got this far, now unmute Master and PCM channels. Some hardware even requires you to unmute the center channel or even the surround channel.

Code listing 3.5: Unmuting channels

# amixer set Master 100 unmute
# amixer set PCM 100 unmute
Only if the above doesn't succeed on its own:
# amixer set Center 100 unmute
# amixer set Surround 100 unmute
Test the sound:
# aplay $KDEDIR/share/sounds/pop.wav // (pop.wav is part of KDE)

We check to see if sound is working by using the aplay (alsa play) command. If you hear a pop, then sound is indeed working. Then, adjust the volume settings to your liking; the ncurses-based alsamixer is a great way to get them "just so".

You may want to emerge alsa-xmms as that will provide ALSA support for XMMS.
When you reboot your system, the alsasound init script will properly save and restore your volume settings.
 
Old 09-29-2003, 11:59 AM   #7
LinFreak!
Member
 
Registered: Jul 2003
Location: England
Distribution: slack9.1
Posts: 209

Original Poster
Rep: Reputation: 30
Thanks very much for all the info and for finding that piece of text. I'll give it a try as soon as I have some time and let you know how it goes
 
Old 09-29-2003, 01:58 PM   #8
LinFreak!
Member
 
Registered: Jul 2003
Location: England
Distribution: slack9.1
Posts: 209

Original Poster
Rep: Reputation: 30
I don't have init.d type system, instead I have /etc/rc.d/*.rc which handle runlevels, modules, internet etc....
I do however have the alsa sources and in the "driver" source package is the script "alsasound" in which can be found the lines:

function stop() {
#
# store driver settings
#
if [ -x $alsactl ]; then
$alsactl -f $asoundcfg store
else
echo -n -e "${rc_warning}!!!alsactl not found!!!${rc_reset} "
fi

so, in a rood console, I typed "alsactl -f asoundcfg store" and hey presto!

Thanks again for info breakerfall
 
Old 09-30-2003, 04:12 PM   #9
breakerfall
Member
 
Registered: Jun 2003
Location: Manchester, UK
Distribution: Gentoo
Posts: 306

Rep: Reputation: 30
Glad you got it working in the end
 
Old 09-30-2003, 07:32 PM   #10
petarsabev
LQ Newbie
 
Registered: Sep 2003
Posts: 27

Rep: Reputation: 15
I do this by modules.conf file.
Put this :
post-install snd-xxx-xxx /usr/sbin/alsactl restore
pre-remove snd-xxx-xxx /usr/sbin/alsactl store
After this you can make your changes in alsamixer and do alsactl store .
Reboot.
There must be sound now .
Here is my modules.conf:

alias char-major-116 snd
alias snd-card-0 snd-intel8x0
alias char-major-14 soundcore
post-install snd-intel8x0 /usr/sbin/alsactl restore
pre-remove snd-intel8x0 /usr/sbin/alsactl store
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
options snd major=116 cards_limit=1 device_mode=0666
options snd-intel8x0 index=0
 
Old 10-01-2003, 12:13 PM   #11
LinFreak!
Member
 
Registered: Jul 2003
Location: England
Distribution: slack9.1
Posts: 209

Original Poster
Rep: Reputation: 30
Glad you posted that petatsabev as my previous post doesn't seem to do the trick, it said it saved the settings but when I rebooted I found that the line input was still muted!

I'll wade through what you posted and see what happens.

ps. I'll reboot and test it this time - before I post "It works!!!"
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo not setting defaults brainlesspinkey Linux - Security 4 09-11-2005 11:34 AM
defaults sarge alsa modules messed up PunkPT Debian 2 01-05-2005 05:20 PM
Setting default browser (and other defaults?) ToothlessRebel Linux - Newbie 2 07-22-2004 06:20 PM
Restoring ALSA mixer defaults in Gentoo? Seph64 Linux - Distributions 2 01-22-2004 12:01 PM
ALSA always defaults to mute strophy Linux - Software 1 09-01-2003 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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