On the one hand, we expect audio to work by default. On the other hand
format conversions, channel mapping, resampling and alike belong to
the audio sub-system; until 2009, this used to be the audio(4) driver
itself. But later, instead of extending the audio(4) driver, we put
new audio code in aucat(1), which amongs others, has the advantage of
running as unprivileged user rather than in supervisor mode. From this
standpoint, there should be an instance of aucat(1) running by default
for each instance of audio(4), ie for each sound card; but audio is
simpler:

Here's what I believe we actually need for audio to work by default:

(1) only one device needs to play/record at a time in almost all cases
    because we have only two ears (well, except armani@ who has ears
    everywhere)

(2) multiple devices (think uaudio) must be usable, so there should be
    a way to switch between devices. Roughly, switching is done by
    setting four symlinks: /dev/{audio,sound,mixer,audioctl}, which
    requires root privilieges.

So I propose the following default setup:

(1) start aucat from /etc/rc for the first device only:

        aucat -l -fsun:0

(2) We'd change $aucat_flags and restart aucat whenever we want to
    switch to another device. Symliks in /dev won't be used anymore.

    Users that, for any reason, need more than one device to run
    concurrently can simply append more -f and -s options

There are other, more sophisticated approaches, for instance using
aucat multi-device support (ie -a off and multiple -fs options) to
handle all devices in one deamon (including hotpluggable ones), but
afaics we gain much more in keeping things very simple, don't we?

Comments? Objections?

If none, I'd like we start using aucat and run our favourite audio
applications. I'm interested mostly in regressions, ie ports working
worse (or not at all) when aucat is running.

-- Alexandre

Index: rc.conf
===================================================================
RCS file: /cvs/src/etc/rc.conf,v
retrieving revision 1.160
diff -u -p -r1.160 rc.conf
--- rc.conf     24 Jul 2011 15:33:41 -0000      1.160
+++ rc.conf     6 Oct 2011 17:39:48 -0000
@@ -44,7 +44,7 @@ ifstated_flags=NO     # for normal use: ""
 relayd_flags=NO                # for normal use: ""
 snmpd_flags=NO         # for normal use: ""
 smtpd_flags=NO         # for normal use: ""
-aucat_flags=NO         # for normal use: ""
+aucat_flags="-fsun:0"  # use another device, e.g. "-fsun:1"
 ldapd_flags=NO         # for normal use: ""
 inetd_flags=""         # for normal use: ""
 rwhod_flags=NO         # for normal use: ""

Reply via email to