OpenBSD CVS

CVS log for src/usr.bin/aucat/Attic/dev_sun.c


[BACK] Up to [local] / src / usr.bin / aucat

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.6, Sun Oct 26 08:49:43 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED

add minimal server capability to aucat(1). When started in server
mode, it listens on an unix socket and mixes/demultiplexes any number
of full-duplex streams, doing necessary format conversions and
resampling on the fly.

programs can use the new libsa(3) library to play and record audio.
The library provides a very simple API to connect to the audio server;
if aucat(1) isn't running, it uses the audio(4) driver transparently
instead.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Aug 14 09:58:55 2008 UTC (15 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.4: +46 -28 lines
Diff to previous 1.4 (colored)

move all device related stuff from aucat.c to a new dev.c file.
The new dev_xxx() routines expose a "high level" self-contained
interface to the device. At initialization, the device is opened
and two chains of aproc structures are created:

 * a playback chain that exposes a (initially) empty mix
   aproc to which the rest of the code can attach new
   streams to be played

 * record chain that exposes a (initially) empty sub aproc
   to which the rest of the code can attach new stream to
   to record

The rest of the code, has just to use dev_attach() routine to
attach streams. While we're at it, add a ``devops'' structure
containing pointers to the device-specific routines. This will
allow later to add support for other type of device than the
Sun API.

Also, write the .wav headers in file_del(), so put all header
related data in the file strucuture. This allows to close() the
file, as soon as wpipe_xxx() aproc terminates. This will be
useful for the server, because it will need to close() descripts
of closed connections immediately.

add mix_pushzero() routine to fill the mixer with silence. It
will be used to avoid the mixer to underrun when there are no
input streams. Since we always have at least one input stream
there's no behaviour change.

ok jakemsr

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jun 3 14:36:20 2008 UTC (15 years, 11 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.3: +10 -2 lines
Diff to previous 1.3 (colored)

Allow aucat to play/record from input-only or output-only devices.
ok jakemsr, ratchov

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 2 17:08:11 2008 UTC (15 years, 11 months ago) by ratchov
Branch: MAIN
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

if aucat is suspended, then the kernel continues running the device
(produces silence) and later, once aucat is resumed the kernel starts
dropping samples, it will try to drop as many samples as silence was
produced. So suspending breaks the aucat process permanently.

workaround this by blocking the signals ie disabling suspending of aucat
from the tty. The long term solution would be to catch SIGCONT and to stop
the device, resync/refill buffers and restart the device. That's really a
lot of work...

ok jakemsr

Revision 1.2 / (download) - annotate - [select for diffs], Wed May 28 07:36:23 2008 UTC (15 years, 11 months ago) by ratchov
Branch: MAIN
Changes since 1.1: +12 -21 lines
Diff to previous 1.1 (colored)

if aucat is resumed (after suspend), kernel buffers are empty, thus write()
syscall succedes and consumes aucat buffers until kernel buffers are full.
If aucat buffers are smaller than kernel ones, they will underrun, and aucat
will terminate, since underruns are not handled yet.

This changes is an improvement until SIGCONT handler is implemented. The
correct approach is to add a handler for SIGCONT to: call dev_stop(), reset
all buffers, bring play and record in sync, fill play buffers and call
dev_start().

ok jakemsr

Revision 1.1 / (download) - annotate - [select for diffs], Fri May 23 07:15:46 2008 UTC (16 years ago) by ratchov
Branch: MAIN

add support for:
 - recording, full-duplex operation
 - format conversions and resampling on the fly
 - mixing on the fly of multiple inputs of different formats
 - up to 16 channels, simplistic "routing" of channel ranges
 - more linear encodings (in raw and wav files)
the old behaviour is fully preserved if none of the new -i and -o
options are used.

code and fixes from jakemsr@ and eric@, suggestions by others.
ok "go ahead" deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.