You are not logged in.

#1 2004-04-15 12:33:12

tmadhavan
Member
From: Wales :D
Registered: 2004-03-26
Posts: 441

Alsamixer settings restored at boot, then lost after startx!

Hi all.

Got alsa working perfectly, everything's fine. But I noticed that one of my speakers wasn't working properly. After an age of changing the balance and getting crappy sound, I realised the DAC and ADC were set to 100% for right-hand speaker, and 0% for the left hand.

So, I changed it, and did

 alsactl store 

as root. Now, when I reboot, these settings are still the same, and everything's fine. But when I run startx, the settings are lost, and return to the unbalanced values. Not critical, but very annoying.

What scripts are run with startx that could be causing it? And now I'm running a graphical login, what should I change to ensure the settings are restored???

Thanks,
Thom

Offline

#2 2004-04-15 13:22:58

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: Alsamixer settings restored at boot, then lost after startx!

what dm are you using? i had a similar problem when i was using kde. In kde i had to do a alsactl restore after i had kde running, then go into the prefrerences / sound settings and select save current mixer settings. That one the kde settings and the alsa settings were in sync.

HTH,
-wd


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#3 2004-04-15 13:32:37

shen
Member
Registered: 2003-09-05
Posts: 272
Website

Re: Alsamixer settings restored at boot, then lost after startx!

another option if alsamixer is not restoring it's settings you can add this line to your /etc/rc.local

alsactl restore

That will run the restore at boot .

Offline

#4 2004-04-15 23:52:16

srey
Member
From: San Diego
Registered: 2004-02-06
Posts: 51

Re: Alsamixer settings restored at boot, then lost after startx!

shen wrote:

another option if alsamixer is not restoring it's settings you can add this line to your /etc/rc.local

alsactl restore

That will run the restore at boot .

Yeah, I did something similar.   I could not get your way to work, something is weird with the /etc/asound.state file, it would restore the settings, but I got no sound.  I can't figure it out, maybe a permissions thing.  After spending a while playing with it, I finally deleted the /etc/asound.state file altogether and just added this to /etc/rc.local:

amixer -q set Master 100 unmute
amixer -q set PCM 100 unmute
amixer -q set CD 100 unmute

Anyway, that's what works for me.


Arch 0.6 - Kernel 2.6.5 - Fluxbox 0.9.8

Offline

#5 2004-04-16 06:44:41

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,322

Re: Alsamixer settings restored at boot, then lost after startx!

copy this script to /etc/rc.d/yourname (eg. alsamixer) and put it into rc.conf daemons list that works for me:

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
    start)
    stat_busy "Restoring Alsa mixer volumes"
    alsactl restore
    if [ $? -gt 0 ]; then
    stat_fail
    else
    add_daemon alsasound
    stat_done
    fi 
    ;;
    stop)
    stat_busy "Storing Alsa mixer volumes"
    alsactl store
    if [ $? -gt 0 ]; then
    stat_fail
    else
    add_daemon alsasound
    stat_done
    fi
    ;;
    restart)
    $0 stop
    sleep 1
    $0 start
    ;;
    *)
    echo "Usage $0 {start|stop|restart}"
    ;;
esac

Offline

#6 2004-04-17 09:26:14

tmadhavan
Member
From: Wales :D
Registered: 2004-03-26
Posts: 441

Re: Alsamixer settings restored at boot, then lost after startx!

Yeh I added the alsamixer daemon, as per the Wiki information, didn't work.

It's all fine now though, added

alsactl restore

to my /etc/rc.local and it all seems to be fine now.

I'm off to play UT2004 big_smile

Thanks,
T

Offline

#7 2004-06-25 01:02:29

luke
Member
From: US
Registered: 2004-06-22
Posts: 54

Re: Alsamixer settings restored at boot, then lost after startx!

I know this has been closed for a while, but I had the same problem but found a different solution. The recap...

I had alsa installed and configured just how I wanted it.  I would restart and the settings would be all messed up. The weird thing is that from the command line it would be fine. It was only when I started KDE (useing "startx") that it would get all messed up.  So, here's what I found.

When KDE starts it reads it own alsa settings from some file (I don't know which) and the file is different for each user.  To deal with this:
1. Configure alsa the way you want it to be useing alsactl store/restore. That should be fine for all the times you are not in X (KDE).  (see http://wiki.archlinux.org/index.php/Alsa%20setup for more info)
2. Start up KDE (the sound is now all screwed up)
3. Run "alsamixer" from the command line
4. Fix the sound settings.  Don't use "alsactl store"
5. Go to the K Menu > Settings > Control Center > Sound & Multimedia > Mixer
6. Make sure "Load volumes on login" is checked, and then press the "Save Current Volumes" button

Do this for each user.  Your done. I think.

Also, you could try fixing the volumes from the command line, before starting x and then in KDE making sure that "Load volumes on login" from step 6 is not checked, but then each user would have the same volumes.

HTH Someone

Offline

Board footer

Powered by FluxBB