You are not logged in.

#1 2003-02-26 08:16:35

Nickm
Member
From: Netherlands
Registered: 2003-02-25
Posts: 106

alsa startup and shutdown scripts

shouldn't alsa have a startup and shutdown script ??
I currently use

#!/bin/bash
#  file  /etc/rc.d/alsa
. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Restoring Alsa state"
    alsactl restore      
      stat_done
    ;;
  stop)
    stat_busy "Saving Alsa state"
    alsactl store      
      stat_done
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac

it saves the alsa state at shutdown and restores it on a boot

Offline

#2 2003-02-26 15:13:03

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: alsa startup and shutdown scripts

well not having used one yet here i would have to say i dunno. my sound goes down on the rare occassions i reboot and comes back up on boot. i never have had to reset anything alsa wise since installing it.


AKA uknowme

I am not your friend

Offline

#3 2003-02-26 17:36:57

Nickm
Member
From: Netherlands
Registered: 2003-02-25
Posts: 106

Re: alsa startup and shutdown scripts

The channels on my card are always being reset on a reboot

So i have no sound if i don't use it when i reboot
this script saves the current status, the volumes of all channels and stuff, on a shutdown and restores that state on a reboot

What soundcard do you have?? i am using a sblive 5.1

Offline

#4 2003-02-26 17:56:45

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: alsa startup and shutdown scripts

well on one computer i have a cmipci and the other is a via8233. perhaps onboard chips just get treated differently.


AKA uknowme

I am not your friend

Offline

#5 2003-02-26 20:36:35

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: alsa startup and shutdown scripts

It's a common problem for sound cards to loose settings when the system restarts. Most OS's get around this by having the system mixer save the sound settings. For Linux, there are multiple methods for this as there are for many things. Which you use depend on you preferences as well as the sound system you choose.

Your setup offers a useful option which works similarly to the OSS version as explained in the sound setup. IE when running aumix with a saved settings file to init the sound system channels. You could probably have done the same with ALSA if you knew the module name. Still, I think it would be a useful addition for the ALSA info in the Arch doc's.


BluPhoenyx

Offline

#6 2003-02-27 00:53:19

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: alsa startup and shutdown scripts

I use alsa with an SBLive....

I have my alsa modules load in the MODULES=() array in rc.conf, then my rc.local calls 'aumix -L' on bootup.

Offline

#7 2003-02-27 06:26:11

Nickm
Member
From: Netherlands
Registered: 2003-02-25
Posts: 106

Re: alsa startup and shutdown scripts

Hmm never tried that... what mixer are you using to enable your surround and 5.1 functions ?? I am using gnome-alsa-mixer, but it's quite complicated sad

Offline

#8 2003-12-04 10:14:08

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 787

Re: alsa startup and shutdown scripts

apeiro wrote:

I use alsa with an SBLive....

I have my alsa modules load in the MODULES=() array in rc.conf, then my rc.local calls 'aumix -L' on bootup.

I tried this and I still have to manually do an aumix -L once I'm logged in - pretty irritating

Offline

#9 2004-01-12 19:00:39

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: alsa startup and shutdown scripts

One thing I did is in devsd.conf, you can add actions to perform on module load and unload (I can't remember syntax).

I added "alsactl restore" on module load (snd-emu10k1) and "alsactl store" on module unload.  However I had one minor problem with this on the first module load, due to the fact that there was no info to restore.  This was easilly fixed by doing an "alsactl store" once manually as root.

Using this approach, the settings are saved and restored whenever the alsa modules are loaded/unloaded.  Works very nice.

Offline

Board footer

Powered by FluxBB