OpenBSD CVS

CVS log for src/usr.bin/aucat/Attic/dev.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.37, Wed Jan 21 08:43:55 2015 UTC (9 years, 3 months ago) by ratchov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.36: +1 -1 lines
FILE REMOVED

Simplify internals and rewrite file header parsing code:
- remove -M, -t, -w, -C, -x flags that don't make sense anymore
- make "-j off" the default (sndiod already does the job)
- don't limit the number of played/recorded files.
- add support for floating-point encoded files.
- add support for apple .aiff and sun/next .au files

Revision 1.36 / (download) - annotate - [select for diffs], Wed Apr 11 06:05:43 2012 UTC (12 years, 1 month ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.35: +36 -34 lines
Diff to previous 1.35 (colored)

Use "unsigned int" rather than "unsigned". No object change.
suggested by deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Fri Mar 23 11:59:54 2012 UTC (12 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.34: +3 -1 lines
Diff to previous 1.34 (colored)

add a MIDI-controlled master volume knob to adjust the mix of
all playback stream, discussed with armani@

Revision 1.34 / (download) - annotate - [select for diffs], Fri Dec 2 10:34:50 2011 UTC (12 years, 5 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.33: +1 -2 lines
Diff to previous 1.33 (colored)

reuse midi-control code to implement midi thru boxes and remove
the old midithru implementation; less code, less bugs. As a side
effect, midi output doesn't implement running status "compression"
any more.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Dec 2 10:29:01 2011 UTC (12 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.32: +1 -2 lines
Diff to previous 1.32 (colored)

remove unused 'reqrate' parameter

Revision 1.32 / (download) - annotate - [select for diffs], Sun Nov 20 22:54:51 2011 UTC (12 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.31: +39 -1 lines
Diff to previous 1.31 (colored)

Move mmc/mtc and volume control bits from struct aproc to struct
dev. Allows volume settings to be saved while the device is kept
closed. Besides that, no behabiour changes.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Nov 15 08:05:22 2011 UTC (12 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.30: +4 -1 lines
Diff to previous 1.30 (colored)

Add a "device number" component in sndio(7) device names, allowing a
single aucat instance to handle all audio and MIDI services. Since
this partially breaks compatibility, this is a opportunitiy to fix few
other design mistakes (eg ':' being used by inet6, type name vs api
name confusion, etc..). This leads to the following names:

        type[@hostname][,unit]/devnum[.option]

The device number is the minor device number for direct hardware
access (ie the 'N' in /dev/audioN). For aucat, this is the occurence
number of the -f (or -M) option.

There's a compatibility hook to keep old names working if only one
aucat server is running.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Oct 12 07:20:04 2011 UTC (12 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.29: +5 -6 lines
Diff to previous 1.29 (colored)

Simplify and improve the way options are parsed and remove ~300 lines
of code that becomes unused. Few command line arguments changes are
required though:

  - stream definitions (-ios) now must follow devices definitions they
    are attached to (-fMn)

  - the -n option is now a special "loopback" device and is thus used
    like -f, eg it must precede streams

  - in midicat, midi thru boxes are not created automatically anymore,
    the new "-M" option must be used for that

  - channel numbers (-Cc options) correspond always to channel numbers
    of the hardware.

  - the -u option isn't needed anymore

  - increase the log verbosity so user errors are logged
    without using -d

tested by many, help from jmc

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jun 20 20:18:44 2011 UTC (12 years, 11 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.28: +8 -3 lines
Diff to previous 1.28 (colored)

Make -aoff option apply to MIDI ports (-q) as well, ensuring the device
stays closed also if -q is used. As we're at it, add -a to midicat so
it behaves like aucat.

Revision 1.28 / (download) - annotate - [select for diffs], Thu May 26 07:18:40 2011 UTC (12 years, 11 months ago) by ratchov
Branch: MAIN
Changes since 1.27: +4 -2 lines
Diff to previous 1.27 (colored)

add a new -w flag to control whether master volume is automatically
adjusted when new streams are connected and disconnected. Disabling
automatic volume adjustment makes sense if all streams are recorded
with properly lowered volumes.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jul 6 01:12:45 2010 UTC (13 years, 10 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

Handle all streams the same way because there's no actual
difference between audio files and client connections. Clean up
the way command line options are handled and clarify this in the
manual page: stream parameters (-Ccehjmrtvx) must precede stream
definitions (-ios) and per-device parameters (-abz) and stream
definitions (-ios) must precede device definitions (-f). Since
there's no ``server'' and ``non-server'' modes anymore, make the
-l option just detach the process.

ok and help from jakemsr and jmc

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jun 25 07:32:05 2010 UTC (13 years, 10 months ago) by ratchov
Branch: MAIN
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

don't attempt to drain devices after they are destroyed, which
results in a use after free(). Catched by jakemsr@ with MALLOC_OPTIONS=J

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jun 5 16:00:52 2010 UTC (13 years, 11 months ago) by ratchov
Branch: MAIN
Changes since 1.24: +2 -4 lines
Diff to previous 1.24 (colored)

don't prime server buffers, because it's ugly and conceptually
complicated. Instead, request clients to provide enough samples
and start with buffers full.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jun 4 06:15:28 2010 UTC (13 years, 11 months ago) by ratchov
Branch: MAIN
Changes since 1.23: +51 -23 lines
Diff to previous 1.23 (colored)

Allow the audio device to be opened only while it's actually used.
This is necessary for uaudio devices, for instance to start aucat
before the device is plugged. Or to unplug a device whithout
having to restart aucat when another device is plugged.  This is
controlled with the new -a option.

Allow multiple audio devices to be used concurently, i.e.
multiple ``-f devname'' options to be used; -f options must follow
per-device options, which is what we do for other options.

Revision 1.23 / (download) - annotate - [select for diffs], Sat May 8 15:35:45 2010 UTC (14 years ago) by ratchov
Branch: MAIN
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

prime play buffers as soon as the device is opened, otherwise a
midi client could start it with empty buffers, in turn hurting
audio clients.

Revision 1.22 / (download) - annotate - [select for diffs], Sun May 2 11:54:26 2010 UTC (14 years ago) by ratchov
Branch: MAIN
Changes since 1.21: +12 -20 lines
Diff to previous 1.21 (colored)

Clean up device handling code to clarify different initialization phases
and different device states. Split initialization in two phases:
first global variables are initialized then the audio hardware is opened.
Allow devices that don't support full-duplex to work in play-only or
record-only mode, even if ``-m play'' or ``-m rec'' are not specified.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 21 06:13:07 2010 UTC (14 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored)

adds the necessary bits to join channels (ex stereo->mono) or
expand channels (ex mono->stereo).  It's switched on/off with
the ``-j'' option, (default is "on").

Revision 1.20 / (download) - annotate - [select for diffs], Tue Apr 6 20:07:01 2010 UTC (14 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.19: +15 -7 lines
Diff to previous 1.19 (colored)

aucat (server):

  - make the ``-m mode'' option per subdevice, allowing
    subdevices to be play-only or rec-only even if the
    server is full-duplex

  - add ``monitoring'' mode (with ``-m mon''). This is a
    record-only stream from which played streams can be
    recorded (kind of ``record what you hear'').

  - allow MIDI devices to be subscribed to the controlling
    MIDI port of the server, ie what midicat does (with -f
    option), but using the -q option.

  - add flow control to the protocol, and serialize clock
    ticks (sio_onmove() calls) and data chunks.  This should
    fix certain full-duplex programs, broken with ``magic''
    block/buffer size combinations.

  - enable 3 block latency which is the minimum theoretical.
    Make -z and -b options correspond to device parameters.

  - make sio_getcap(3) the same for aucat and sun backends,
    ie return whatever is supported (``everything'' in the
    aucat case, since everything is actulally supported).

aucat (player):

  - enable ``-m mode'' option  to select between monitoring
    and recording when ``-o file'' is used.

  - plug MIDI code to non-server codepath. The MIDI control
    device is specified with the ``-q device'' option, as in
    server mode.

  - impliment lseek()'ing within files (controlled
    through MIDI). Necessary to use aucat with a MIDI
    sequencer.

midicat (thrubox):

  - rename ``-f'' flag to ``-q'', so it has the
    same name as in aucat (-f is still working)

ok jakemsr@, tweaks from jmc@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Apr 3 17:59:17 2010 UTC (14 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.18: +6 -14 lines
Diff to previous 1.18 (colored)

backout last change, committed by mistake, sorry...

Revision 1.18 / (download) - annotate - [select for diffs], Sat Apr 3 17:40:33 2010 UTC (14 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.17: +15 -7 lines
Diff to previous 1.17 (colored)

doc fixes from jmc

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jan 11 13:06:32 2010 UTC (14 years, 4 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

When resuming from suspend, prime play buffers with silence,
otherwise the client would underrun by more than its own buffer
size, which currently is not allowed (causes the client to
deadlock).

Set the minimum client buffer size to two blocks. Single block
buffers don't work properly yet.

with help from jakemsr

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jan 5 10:18:12 2010 UTC (14 years, 4 months ago) by ratchov
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored)

Make the way .wav files are handled closer to the way sockets are
handled, which is conceptually simpler. No behaviour changes.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Nov 3 21:31:37 2009 UTC (14 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.14: +3 -2 lines
Diff to previous 1.14 (colored)

Allow any program using aucat to act as MMC slave and MTC master
transparently.  Multiple audio applications can be started
synchronously from external software/hardware supporting the
standard Start/Stop/Relocate messages. The server clock is exposed
through MTC, allowing non-audio software/hardware to be
synchronized to audio applications.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Oct 10 13:55:37 2009 UTC (14 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.13: +2 -4 lines
Diff to previous 1.13 (colored)

don't use a references to the device file to check the current mode

Revision 1.13 / (download) - annotate - [select for diffs], Fri Oct 9 16:49:48 2009 UTC (14 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.12: +1 -4 lines
Diff to previous 1.12 (colored)

Make abuf structure smaller:
 - put aproc-specific parameters into unions since they are never
   used together
 - remove constant ``data'' pointer always pointing the end of the
   abuf structure

Revision 1.12 / (download) - annotate - [select for diffs], Wed Aug 19 05:54:15 2009 UTC (14 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.11: +5 -2 lines
Diff to previous 1.11 (colored)

organize midi code like audio code, no functional change

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jul 25 10:52:19 2009 UTC (14 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.10: +1 -2 lines
Diff to previous 1.10 (colored)

fix comments, remove no longer needed declaration, reorder includes
from Thomas Pfaff

Revision 1.10 / (download) - annotate - [select for diffs], Fri Feb 6 08:26:34 2009 UTC (15 years, 3 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

move error messages reported to user into main()

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jan 10 20:02:28 2009 UTC (15 years, 4 months ago) by ratchov
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

add "loopback" mode in which input is connected to the output.
This is useful to mix, demultiplex, resample or reencode audio
files off-line.
tweak + ok jakemsr

Revision 1.8 / (download) - annotate - [select for diffs], Sun Dec 7 17:10:41 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

When resampling, don't require the sample frequency to be an integer.
This removes the arithmetic constraint between the sample frequency
and the block size and all the associated code. Now aucat can work
in server mode with any block size.
ok jakemsr

Revision 1.7 / (download) - annotate - [select for diffs], Sun Nov 16 16:30:22 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

Make clients inherit the volume parameter when the -v option is used in
server mode. It gives the maximum volume a client may have. This wastes
dynamic range, but allows volume to stay constant when other clients
connect or disconnect.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Nov 10 23:25:37 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored)

add a per-stream ``soft volume'' knob and the corresponding -v option.
The code will be useful later for the volume knob in the sndio API.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Nov 9 16:26:07 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

make aucat(1) stop automatically the audio(1) device if it's idle. This
way, when in server mode, it consumes no CPU if there are no clients.
Later, this will allow to start aucat(1) at session or system startup.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Nov 7 21:01:15 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Oct 26 08:49:43 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.2: +7 -22 lines
Diff to previous 1.2 (colored)

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.2 / (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.1: +35 -12 lines
Diff to previous 1.1 (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.1 / (download) - annotate - [select for diffs], Fri May 23 07:15:46 2008 UTC (16 years ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4

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.