Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Oct 2000 22:59:08 +0900
From:      Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
To:        freebsd-multimedia@FreeBSD.ORG
Subject:   Re: rc.audi
Message-ID:  <rtgk8br2vkj.wl@maestro.eterno.giganet.net>
In-Reply-To: In your message of "Mon, 2 Oct 2000 14:56:21 %2B0200 (CEST)" <200010021256.OAA10715@monos.secnetix.net>
References:  <Pine.BSF.4.21.0009301739130.55185-100000@pike.osd.bsdi.com> <200010021256.OAA10715@monos.secnetix.net>

next in thread | previous in thread | raw e-mail | index | archive | help
At Mon, 2 Oct 2000 14:56:21 +0200 (CEST),
Oliver Fromme <olli@secnetix.de> wrote:
> 
> Personally I'm used to have a file /usr/local/etc/rc.d/mixer.sh
> with the following contents:
> 
> 
>    #!/bin/sh -
>    
>    test -c /dev/mixer || exit
>    
>    case $1 in
>    [Ss][Tt][Aa][Rr][Tt]|"")
>            /usr/sbin/mixer > /dev/null     \
>                    vol     75:75   \
>                    pcm     75:75   \
>                    speaker 0:0     \
>                    line    0:0     \
>                    mic     0:0     \
>                    cd      75:75   \
>                    rec     0:0     \
>                    line1   0:0     \
>                    video   0:0
>            ;;
>    [Ss][Tt][Oo][Pp])
>            ;;
>    *)
>            echo "Usage:  ${0} start|stop" >&2
>            exit 1
>            ;;
>    esac

How about saving mixer state to /var/db/mixerX ?
# Note that this code isn't fully tested. Use at your own :)

#! /bin/sh -

save_mixer()
{
  mixer -f /dev/$1 | awk '{ print $2 $7 }' > /var/db/$1.saves
}

restore_mixer()
{
  [ -r /var/db/$1.saves ] && mixer -f /dev/$1 `cat /var/db/$1.saves`
  #rm -f /var/db/$1.saves	# If needed...
}

case $1 in
 [Ss][Tt][Aa][Rr][Tt]|"")
  operation=save_mixer
  echo -n "Saving mixer settings:"
  ;;
 [Ss][Tt][Oo][Pp])
  operation=restore_mixer
  echo -n "Restoring mixer settings:"
  ;;
 *)
  echo "Usage: $0 start|stop" >&2
  exit 2
esac

for i in /dev/mixer*
do
  devname=`basename $i`
  [ -c $i ] && $operation $devname && echo -n " $devname"
done

echo .
# EOT

-- 
YAMAMOTO, Taku <taku@cent.saitama-u.ac.jp>
Member of Advanced Computer and Communication Studies Society
(ACCESS for short), Information Processing Center, Saitama Univ.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?rtgk8br2vkj.wl>