From owner-freebsd-multimedia Mon Oct 2 5:56:27 2000 Delivered-To: freebsd-multimedia@freebsd.org Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by hub.freebsd.org (Postfix) with ESMTP id 6CB2137B502 for ; Mon, 2 Oct 2000 05:56:23 -0700 (PDT) Received: from monos.secnetix.net (monos.secnetix.net [172.20.20.5]) by lurza.secnetix.de (8.9.3/8.9.3) with ESMTP id OAA64241 for ; Mon, 2 Oct 2000 14:56:21 +0200 (CEST) (envelope-from olli@secnetix.de) Received: (from olli@localhost) by monos.secnetix.net (8.9.3/8.9.3) id OAA10715; Mon, 2 Oct 2000 14:56:21 +0200 (CEST) (envelope-from olli@secnetix.de) Date: Mon, 2 Oct 2000 14:56:21 +0200 (CEST) Message-Id: <200010021256.OAA10715@monos.secnetix.net> From: Oliver Fromme To: freebsd-multimedia@FreeBSD.ORG Reply-To: freebsd-multimedia@FreeBSD.ORG Subject: Re: rc.audi In-Reply-To: X-Newsgroups: list.freebsd-multimedia User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.1-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Christopher Shumway 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