Click to See Complete Forum and Search --> : Got alsa working, just one minor complaint...


psych-major
01-21-2005, 01:12 PM
alsa is working totally fine on Slackware 10, kernel 2.4.26, with my AC'97 P.O.S. onbourd sound card.

My problem is that every time I reboot, the volume levels reset themselves such that PCM is cranked all the way on the left channel and the right channel is silent. Also seems to toggle the pre/post 3d setting. Is there an easy way to make sure my volume settings get saved? Works fine once I adjust the levels, but the cute KDE login sounds sounds pretty scary as it's blowing out my left speaker when I forget to turn it down on the speaker itself.

Incidentally, this is a recent occurance, settings remained constant when I did my install, but I ran swaret, blew up alsa, fixed it, etc, etc, etc. Now this is the only remaing issue.

gehidore
01-21-2005, 01:15 PM
Set them in alsamixer? use esc to quit and save.(if you're using something like kde or gnome you need to find the mixer for the sound servers they use, they set their own volumes on startup.

psych-major
01-21-2005, 01:29 PM
That's actually how I'm doing it: setting in alsamixer from the konsole.

Could I have a permissions issue writing to a config file somewhere?

JoeyJoeJo
01-21-2005, 04:07 PM
I know that in Gentoo there is a script in /etc/init.d that saves settings. I think it's called alsactl. alsactl might also be a regular command, I'm not sure. Look and see if your distro has something similar to that.

psych-major
01-21-2005, 05:07 PM
Thanks joey,etc.
Here's what I found:
alsactl is a stand-alone command
enter
alsactl store
to save sound settings to /etc/asound.state

enter
alsactl restore
to load saved settings from the same file.

/etc/rc.d/rc.alsa is the alsa boot-time config file, and it correctly references /etc/asound.state, and does not seem to be throwing any errors.

So just for fun, I checked my permissions on rc.alsa and asound.state; OK there. Here's where it gets weird... My cute KDE login sound is now normal, but when the gui is fully loaded, the volume is whacked, as previously described???? If I enter alsactl restore at this point, it is restored to my previously saved settings. Apparently I'll need to put the alsactl command in a startup script, as it doesn't seem to be handled correctly by rc.alsa.

I'm still poking at it, but getting close to being stumped!

If anyone else has seen this, HELP!!!

psych-major
01-21-2005, 05:33 PM
KDE appears to be the culprit:
>changed my default runlevel back to 3
>Logged in as root - ran alsamixer - settings are normal
>ran startx (as root) KDE came up, checked alsamixer again, still normal.
>stopped x, logged off as root, logged on as user,
alsamixer settings still normal.
>startx as user, kde came up, logon sound normal.
>once KDE fully up, alsamixer settings are wrong, <alsactl restore> puts them back to normal.
WTF???

gehidore
01-21-2005, 07:28 PM
Originally posted by psych-major
KDE appears to be the culprit:
>changed my default runlevel back to 3
>Logged in as root - ran alsamixer - settings are normal
>ran startx (as root) KDE came up, checked alsamixer again, still normal.
>stopped x, logged off as root, logged on as user,
alsamixer settings still normal.
>startx as user, kde came up, logon sound normal.
>once KDE fully up, alsamixer settings are wrong, <alsactl restore> puts them back to normal.
WTF???

Set the sound up with "kmix"

psych-major
01-21-2005, 07:49 PM
Thanks anyway.

bwkaz
01-21-2005, 08:01 PM
I think one of the programs in your user's ~/.kde/Autostart directory (at least, I think that's the name of the directory in question -- I know it's under ~/.kde, and I know it's named either Autostart or AutoStart) is resetting the mixer settings.

Check out what's running from there, and try temporarily disabling some things until you find out which one is doing it. It may even be obvious which one is the culprit from the names of the files.

psych-major
01-21-2005, 11:58 PM
I had the same basic theory, bwkaz, and went poking around in ~/.kde. Autostart is there, but it is empty. Here's the weird thing, if I start X as root, it behaves normally, so it's almost like it's a permissions thing on something alsa needs to reload settings, but it's also kde specific, because, as I mentioned, if I log into the CLI as a user, sound is configured correctly unstil I start KDE. I haven't tried logging into gnome yet, but that's probably my next move.

The pc in question is at the office so I will be trying not to think about it this weekend!

Thanks all for the help, and I'm still working on it. There's got to be an answer other than putting 'alsactl restore' in a shell script!

have a great weekend...