Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Oct 2000 14:56:21 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-multimedia@FreeBSD.ORG
Subject:   Re: rc.audi
Message-ID:  <200010021256.OAA10715@monos.secnetix.net>
In-Reply-To: <Pine.BSF.4.21.0009301739130.55185-100000@pike.osd.bsdi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Christopher Shumway <cshumway@bsdi.com> wrote:
 > I've been giving some thought to a more user tuneable way of setting up the
 > audio mixer under FreeBSD at boot time.  The methiod I have come up with is
 > with an /etc/rc.audio script, attached below.  Feedback is appreciated, for
 > I am thinking of send-pr'ing it as a change request so we can see it as
 > part of the base FreeBSD system.  Here's the script:
 > [...]

I think it's not a very good idea to call the mixer binary
a dozen times.  That's very inefficient.

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


Maybe something like that should be provided as a
skeleton script somewhere under /usr/share/examples.
Different soundcards support different mixer devices
anyway, and there's no "one fits all".

Another possibility would be to have a file /etc/mixer.conf
that looks like this:

   vol     75:75
   pcm     75:75   # comment
   speaker 0:0
   ...

And then let /etc/rc read and parse it like this:

   if [ -c /dev/mixer -a -r /etc/mixer.conf ]; then
           /usr/sbin/mixer > /dev/null \
               `sed 's/#.*$//' /etc/mixer.conf`
   fi

(I have not actually tried this, but it should
basically work.  I'm willing to test this more
thoroughly and submit patches and a manpage, if
there's sufficient interest.)

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)


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?200010021256.OAA10715>