alsa-utils-0.9.2

Introduction to alsa-utils

Download location (HTTP):       http://www.alsa-project.org/alsa/ftp/utils/alsa-utils-0.9.2.tar.bz2
Download location (FTP):        ftp://ftp.alsa-project.org/pub/utils/alsa-utils-0.9.2.tar.bz2
Version used:                   0.9.2
Package size:                   106 KB
Estimated Disk space required:  1.8 MB

The alsa-utils package contains various utilities which are useful for controlling your sound card.

alsa-utils depends on: 
alsa-lib-0.9.2

Installation of alsa-utils

Install alsa-utils by running the following commands:

./configure &&
make &&
make install

Configuring alsa-utils

Config files

/etc/asound.state

Configuration Information

Probably the easiest way to store mixer levels is to set and retrieve them using a bootscript. It is possible to do this with a post-install line in /etc/modules.conf but this is left as an exercise for those readers who wish to do this.

The alsa-drivers package installs a script as /etc/rc.d/init.d/alsasound. While it is possible to use this script, it contains a lot of extraneous detail which isn't needed on an LFS system and so we create our own script /etc/rc.d/init.d/alsa.

To create the alsa script, do the following:

cat > /etc/rc.d/init.d/alsa << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/alsa

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
# Stores mixer settings in the default location: /etc/asound.state

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
    start)
        echo "Starting alsa...    Restoring volumes..."
        loadproc /usr/sbin/alsactl restore
        #echo "                    Loading MIDI font..."
        #loadproc sfxload /path/to/soundfont
        ;;

    stop)
        echo "Stopping alsa...    Saving volumes......"
        loadproc /usr/sbin/alsactl store
        #echo "            Removing MIDI font.........."
        #loadproc sfxload -i
        ;;

    restart)
        $0 stop
        /usr/bin/sleep 1
        $0 start
        ;;

    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;

esac

# End $rc_base/init.d/alsa
EOF
chmod 755 /etc/rc.d/init.d/alsa

You can then create the appropriate symlinks:
cd /etc/rc.d/init.d &&
ln -sf ../init.d/alsa ../rc0.d/K35alsa &&
ln -sf ../init.d/alsa ../rc1.d/K35alsa &&
ln -sf ../init.d/alsa ../rc2.d/S40alsa &&
ln -sf ../init.d/alsa ../rc3.d/S40alsa &&
ln -sf ../init.d/alsa ../rc4.d/S40alsa &&
ln -sf ../init.d/alsa ../rc5.d/S40alsa &&
ln -sf ../init.d/alsa ../rc6.d/K35alsa

Note that all channels of your soundcard are muted by default. You can use the alsamixer program from alsa-utils (or any other OSS mixer) to change this.

Also, the first time the above script is run, it will complain that there is no state in /etc/asound.state. You can prevent this by running the following commands after installing alsa-utils:
touch /etc/asound.state &&
alsactl store

A final note is that the lines loading sfxload are commented out. They are there as an example of other things you may wish to do in the startup script. sfxload is a separate package of interest to SoundBlaster AWE and Live! users. It is designed for loading "sound-fonts" (which are used for MIDI output). You may wish to delete these lines and add your own or, if you have the relevant soundcard, install sfxload and uncomment them.

Contents

The alsa-utils package contains aconnect, alsactl, alsamixer, amixer, aplay, arecord and aseqnet.

Description

aconnect

aconnect is a utility for connecting and disconnecting two existing ports in the ALSA sequencer system.

alsactl

alsactl is used to control advanced settings for the ALSA soundcard drivers.

alsamixer

alsamixer is an ncurses-based mixer program for use with the ALSA soundcard drivers.

amixer

amixer allows command-line control of the mixers for the ALSA soundcard drivers.

aplay

aplay is a command-line soundfile player for the ALSA soundcard drivers.

arecord

arecord is a command-line soundfile recorder for the ALSA soundcard drivers.

aseqnet

aseqnet is an ALSA sequencer client which sends and receives event packets over a network.