How to load ALSA sound module at startup?

How to load ALSA sound module at startup?

Post by Roy Ta » Sun, 31 Dec 1899 09:00:00



Another newbies question...

I am using SuSE 6.2 and have got ALSA 0.4.1h installed. At the moment, I have
to run the following command to activate the sound:

/sbin/modprobe snd-card-cs4232 snd_port=0x534 snd_cport=0x90 snd_mpu_port=0x330
snd_fm_port=0x388 snd_irq=5 snd_dma1=0 snd_dma1_size=8 snd_dma2=1
snd_dma2_size=8

I would like to have this automated at startup. I have been playing with the
post-install at /etc/.conf.modules file but could not get it working anyhow.
Can somebody help?

Here is a portion from the /etc/conf.modules file:

alias char-major-116 snd
options snd snd_major=116 snd_cards_limit=1
alias snd-card-0 snd-card-cs4232
options snd-card-cs4232 snd_index=1 snd_id="cs4232"
alias char-major-14 cs4232
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-pcm1-oss
alias sound-service-0-12 snd-pcm1-oss
options cs4232 io=0x534 irq=5 dma=1 dma2=0 mpuio=0x330 mpuirq=9
options opl3 io=0x388
post-install snd-card-cs4232 modprobe "-k" opl3

Many thanks.
Roy

 
 
 

How to load ALSA sound module at startup?

Post by jw » Sun, 31 Dec 1899 09:00:00


On Fri, 7 Jan 2000 18:29:10 +0800, Roy Tan

>Another newbies question...

>I am using SuSE 6.2 and have got ALSA 0.4.1h installed. At the moment, I have
>to run the following command to activate the sound:

>/sbin/modprobe snd-card-cs4232 snd_port=0x534 snd_cport=0x90 snd_mpu_port=0x330
>snd_fm_port=0x388 snd_irq=5 snd_dma1=0 snd_dma1_size=8 snd_dma2=1
>snd_dma2_size=8

>I would like to have this automated at startup. I have been playing with the
>post-install at /etc/.conf.modules file but could not get it working anyhow.
>Can somebody help?

>Here is a portion from the /etc/conf.modules file:

>alias char-major-116 snd
>options snd snd_major=116 snd_cards_limit=1
>alias snd-card-0 snd-card-cs4232
>options snd-card-cs4232 snd_index=1 snd_id="cs4232"
>alias char-major-14 cs4232
>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-pcm1-oss
>alias sound-service-0-12 snd-pcm1-oss
>options cs4232 io=0x534 irq=5 dma=1 dma2=0 mpuio=0x330 mpuirq=9
>options opl3 io=0x388
>post-install snd-card-cs4232 modprobe "-k" opl3

>Many thanks.
>Roy

Perhaps this adapted copy of /etc/rc.d/sendmail (called /etc/rc.d/sound)
is something for you:

note that it loads a different driver. Also note that you should link
this like the other files in /etc/rc.d/rc2.d, /etc/rc.d/rc3.d
(do a ls -l there sometimes and see what it's like)

#! /bin/sh
# Copyright (c) 1996 S.u.S.E. Gmbh Fuerth, Germany.  All rights reserved.
#


#

. /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && SMTP=yes
test "$SMTP" = yes || exit 0

if test -z "$SENDMAIL_ARGS" ; then
        SENDMAIL_ARGS="-bd -q30m -om"
fi

# The echo return value for success (defined in /etc/rc.config).
return=$rc_done
case "$1" in
    start)
        echo -n "Starting sound system: "
        /sbin/modprobe snd-card-ens1370
        if [ `/sbin/lsmod | grep -c "snd\-card\-ens1370"` -lt 1 ]
        then
           echo -n "retrying sound system: "
           /sbin/modprobe snd-card-ens1370 || return=$rc_failed
        fi
        alsactl restore 0
        echo -e "$return"
        ;;
    stop)
        echo -n "Stopping sound system: "
        /sbin/modprobe -r snd-card-ens1370 || return=$rc_failed
        echo -e "$return"
        ;;
    restart)
        $0 stop  &&  $0 start  ||  return=$rc_failed
        ;;
    reload)
        echo -n "Reload service sound - not supported"
        echo -e "$rc_failed"
        ;;
    status)
        echo -n "Checking for service sound: "
        test -f /proc/asound/cards && cat /proc/asound/cards || return=$rc_failed
        ;;
    *)
        echo "Usage: $0 {start|stop|status|restart|reload}"
        exit 1
esac

# Inform the caller not only verbosely and set an exit status.
test "$return" = "$rc_done" || exit 1
exit 0

--
Whenever you find yourself on the side of the majority, it is time to
reform.
        Mark Twain

 
 
 

How to load ALSA sound module at startup?

Post by Achim Lind » Sun, 31 Dec 1899 09:00:00



>I am using SuSE 6.2 and have got ALSA 0.4.1h installed. At the moment, I have
>to run the following command to activate the sound:

>/sbin/modprobe snd-card-cs4232 snd_port=0x534 snd_cport=0x90 snd_mpu_port=0x330
>snd_fm_port=0x388 snd_irq=5 snd_dma1=0 snd_dma1_size=8 snd_dma2=1
>snd_dma2_size=8

>I would like to have this automated at startup.

You may put the command into /sbin/init.d/boot.local

An update to
ftp.gwdg.de/linux/suse/6.2_update/a1/modules-2.2.2-44.i386.rpm
is also recommended.

Achim

 
 
 

1. How to load ALSA sound module at startup?

If you have the module working with modprobe, just add the
modprobe line to the very end of /etc/rc.d/rc.local
That will get the modules loaded at startup.
You can make an rc script to load the modules for each runlevel
that you go into, but that takes a degree of bash programming.
Look at /etc/rc.d/skeleton to get a bare-bones example of an rc
script.
After you have made the script, make a symbolic link from
/etc/rc.d/rcx.d to the script, where x is the number of
runlevel that you want sound to be in.  Each link will have
either an S or K for start or kill, and a number for what order
to run the script in.
It's quite complicated, but works well.

--
  This answer is courtesy of QuestionExchange.com
  http://www.questionexchange.com/servlet3/qx.usenetGuest.showUsenetGue...

2. Dead penguin

3. loading the ALSA sound module

4. using nt loader to launch linux

5. editing modules.conf to load sound driver modules

6. asynchronous IO

7. modules not automatically loaded + only have sound for WAV file (sound problem)

8. plip timeout

9. Does playing sound from CDROM supposed to load sound module?

10. Sound modules get loaded, but no sound card in the system

11. ALSA: help loading emu10k1 module

12. ALSA drivers and loading modules

13. intermittent alsa module loading problem