summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/abuf.c
AgeCommit message (Collapse)Author
2010-06-04Allow the audio device to be opened only while it's actually used.Alexandre Ratchov
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.
2010-04-06aucat (server):Alexandre Ratchov
- 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@
2010-04-03backout last change, committed by mistake, sorry...Alexandre Ratchov
2010-04-03doc fixes from jmcAlexandre Ratchov
2010-01-11When resuming from suspend, prime play buffers with silence,Alexandre Ratchov
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
2010-01-10Add traces to help tracking subtle timing bugs often causingAlexandre Ratchov
underuns and overruns; such bugs are hard to debug with ktrace or a debugger. They are also handy to debug or monitor code using aucat. To enable traces, compile aucat with ``make DEBUG=-DDEBUG'' and use the -d option multiple times. ok jakemsr
2009-10-09Make abuf structure smaller:Alexandre Ratchov
- put aproc-specific parameters into unions since they are never used together - remove constant ``data'' pointer always pointing the end of the abuf structure
2009-09-27remove all debug tracesAlexandre Ratchov
2009-08-21make aucat(1) expose a MIDI device to control server behaviour inAlexandre Ratchov
realtime. For now only the playback volume of individual streams can be changed/monitored. To each stream is assigned a MIDI channel; the volume is changed/monitored using the standard controller number 7.
2009-07-25fix comments, remove no longer needed declaration, reorder includesAlexandre Ratchov
from Thomas Pfaff
2009-07-19missing va_end in abuf_dprn. ok ratchov@Martynas Venckus
2009-02-13style and typos fixes from Thomas PfaffAlexandre Ratchov
2009-01-23spacing + typo fix from Matt Jibson <matt.jibson(at)gmail.com>Alexandre Ratchov
2008-11-09make aucat(1) stop automatically the audio(1) device if it's idle. ThisAlexandre Ratchov
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.
2008-11-03A small optimization: handle most N-channel <-> M-channel conversionsAlexandre Ratchov
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.
2008-10-26add minimal server capability to aucat(1). When started in serverAlexandre Ratchov
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.
2008-08-14in abuf_rgetblk() the ``start'' pointer may take a value beyond theAlexandre Ratchov
end of the buffer because periodic boundary conditions of the FIFO are not met ok jakemsr
2008-08-14add a bytes counter to abuf structures to count the number ofAlexandre Ratchov
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
2008-08-14move mix/sub underrun/overrun handling code and data in theAlexandre Ratchov
generic abuf structure, so it can reused. Required for an audio server. No behaviour change. ok jakemsr
2008-08-14factor code that discards data from abuf strucure into a singleAlexandre Ratchov
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
2008-05-25give argument to LIST_END(), don't use variable lenght arrays as lastAlexandre Ratchov
field of structures. from deraadt@
2008-05-23add support for:Alexandre Ratchov
- 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@