Age | Commit message (Collapse) | Author |
|
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@
|
|
with the emulated ones (otherwise the next time it's attached
conversions will not be setup).
|
|
device number of channels are not the same. The bug was hidden until
now, because mixer and demux input and outputs used to have the same
frame size.
|
|
|
|
native->any and one to decode any->native. It is simpler and
faster this way.
|
|
As a side effect, reduce CPU usage by ~10% on envy(4) devices.
|
|
channel range (based on the encoding conversion code). Will allow to
unentangle channel mapping from encoding conversion. As a side effect,
greatly reduces CPU usage for channel mapping. No functionnal change.
|
|
bits from the encoding conversion code. As a side effect this reduces
CPU usage by 30% on envy(4).
|
|
conversion bits) and use it when resampling only is required (ie for
clients using s16 encoding), this is the most common case. Reduces CPU
usage by ~50%. No functional change.
|
|
Add ``i'' to offsets in the input buffer and ``o'' to offsets
in the output buffer. This is necessary because input and output
use no more the same frame size.
|
|
inside the mixer and the demultiplexer. This way, aucat will not
trigger the heavy conversion code when only channel conversions are
required. Cuts ~50% of the CPU usage on envy(4) devices, can improve
surround 4.0, 5.1 and 7.1 capable devices. No functionnal change.
|
|
aucat should be started automatically yet at system startup
help from jmc@
|
|
umask = 0, this allows one user to start the server and another
user to use it (eg. _mpd).
ok todd, deraadt, jakemsr
|
|
|
|
uninitialized'' warnings. To be removed when the compiler bug is fixed
eventually.
|
|
requested by many, "just go for it" deraadt@
|
|
requested by jmc@
|
|
|
|
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.
|
|
ok ratchov@
|
|
triggered by POLLIN condition).
mix_pushzero() is not called from the ``xxx_in()'' chain, but calls
abuf_flush() resulting in bad initialization of the mixer, which
will lead to a deadlock at some point.
ok jakemsr
|
|
|
|
end of the buffer because periodic boundary conditions of the FIFO are
not met
ok jakemsr
|
|
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
|
|
hup() routines of the aproc strucure check that the aproc
structure has not desappeared. This never happens currently, but
will be allowed later. No behaviour change.
ok jakemsr
|
|
set, the mix aproc will exit once there are no more input
streams, similarly the sub aproc will exit once there are no
more ouput streams. If the flag is not set, the mix aproc will
generate silence, and the sub aproc will drop samples. By
default this flag is set, so no behaviour change.
ok jakemsr
|
|
bytes that entered the FIFO. The counter may overflow, so it
should be used with "modulo 2^32" arithmetic. The counter will
be used later to synchronize playback to record. No behaviour
change.
ok jakemsr
|
|
before free()ing the aproc structure, this is cleaner and will
allow to reuse wpipe_xxx() and rpipe_xxx() when defining new
aprocs. No behaviour change.
ok jakemsr
|
|
generic abuf structure, so it can reused. Required for an audio
server. No behaviour change.
ok jakemsr
|
|
abuf_rdiscard() routine. Similarly add abuf_wcommit() routine for
writing. The purpose is to stop manupulating FIFO pointers in
various places outiside abuf.c, its too error prone.
No behaviour change.
ok jakemsr
|
|
unneccessarily duplicating text;
ok ratchov jakemsr
|
|
ok jakemsr, ratchov
|
|
|
|
- simplify -io descriptions
|
|
environment variable, new -xX options
bits from eric, ok jakemsr
|
|
to continue filling the play buffer until it's full. This way, the
play buffer has fewer chances to underrun when the device is started.
ok jakemsr
|
|
(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
|
|
occur on a per-stream basis, using -Xx flags. There are 3 possible
policies:
- ignore : ignores underruns/overruns, for instance, this mode
could be used for creating simple pipes with utilities; like in
your last cdio diff.
- sync : insert/discard samples in order to keep all streams in
sync, useful for multi-tracker-like apps and/or to sync
midi/video/whatever on audio streams (this was the previous
behaviour)
- error : if overruns/underruns occur, consider it as fatal error
and kill the corresponding stream (without disturbing others).
Useful, for reliable recordings (and/or debugging aucat
itself:).
ok jakemsr
|
|
checks
suggested and ok jakemsr
|
|
check for xruns in devices.
ok jakemsr
|
|
variable. This eases turning debugging on/off when aucat is started by
another program.
"i like the idea" jakemsr
|
|
other streams. Beside making aucat usable with slow apps (eg. cdio),
this change will ease turning aucat into an audio server later
if one of the input buffers underruns, then silence is generated in
place of the missing samples. Later, as many samples are dropped in
order to maintain the stream in sync with the rest
if one of the output buffers overruns then newer samples are
discarded. Later silence is generated in order to maintain the
stream in sync with the rest.
ok jakemsr
|
|
written with help from ratchov and jakemsr;
ok ratchov
|
|
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
|
|
|
|
|
|
ok ratchov@
|
|
field of structures.
from deraadt@
|
|
|
|
- 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@
|