summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
AgeCommit message (Collapse)Author
2010-11-20clean up cases of ;;Theo de Raadt
2010-11-14Terminate midi thru boxes trying to drain but that have noAlexandre Ratchov
outputs anymore, otherwise they can't be cleaned up by dev_close()
2010-11-05Add experimental support for 24-bit arithmetic, meaning that fullAlexandre Ratchov
dynamic range of 24-bit hardware can be used. Offline processing like mixing and channel mapping is done with 24-bit precision too. Since most hardware and audio programs use 16-bit precision, 24-bit processing is a small waste of CPU time in many cases, so 24-bit processing is not desirable and this is disabled by default. Furthermore it's available on i386, amd64 and sparc64 only. To experiment with it: make COPTS="-DADATA_BITS=24"
2010-11-05unbreak compilation without DEBUG definedAlexandre Ratchov
2010-11-05Convert ulaw/alaw to native format (ie using ADATA_XXX defines) ratherAlexandre Ratchov
than s16 (using hardcoded constants). Currently s16 is the native format, so no behavior change.
2010-11-04Replace ``short'' by a new ``adata_t'' typedef corresponding toAlexandre Ratchov
audio samples and cleanup ADATA_XXX macros. This allows easilly switching to 24 bit fixed point arithmetic by simply redefining the adata_t typedef to int and updating ADATA_XXX macros. No object change.
2010-11-04legacy.c is not used any longerAlexandre Ratchov
2010-10-21When the end of a stream is reached (ie mix_eof() called) otherAlexandre Ratchov
possibly blocked streams are processed. If during this phase the end of another stream is reached then stop the processing because the job will be already finished by the second stream. Otherwise we may end up running a destroyed stream. help from Edward Wandasiewicz <w13ntd at googlemail.com>, thanks
2010-10-21fix style and typos in messages and commentsAlexandre Ratchov
2010-10-21use MODE_xxx and XRUN_xxx macros everywhere, and zap correspondingAlexandre Ratchov
AMSG_xxx macros, which in turns simplifies the code
2010-09-18add forgotten ``return NULL'' when a .wav file fails to get theAlexandre Ratchov
device with the required mode
2010-09-08aucat: getpwnam: No such file or directoryTheo de Raadt
is not a proper error message.
2010-08-20polish the code: remove few unused #includes, add missing ones,Alexandre Ratchov
fix NULL vs 0, etc. No behaviour change.
2010-08-19fix NULL pointer deref in midicat option parsing when ``-'' isAlexandre Ratchov
used as filename
2010-07-31remove 2 years old compatibility modeAlexandre Ratchov
2010-07-31remove forgotten debug messageAlexandre Ratchov
2010-07-10When a file is created, initialize its ``busy cycles'' counter to zero.Alexandre Ratchov
2010-07-10In midi server mode, don't terminate the midi thru box if there areAlexandre Ratchov
no connections anymore.
2010-07-10fix parameter handling: don't try to open a ``default'' midi portAlexandre Ratchov
if no files are given on the command line
2010-07-06Try to detect busy loops caused by misbehaving audio driversAlexandre Ratchov
or hardware. If a busy loop is found, then close the device that caused the loop.
2010-07-06various tweaks to previous; ok ratchovJason McIntyre
2010-07-06Handle all streams the same way because there's no actualAlexandre Ratchov
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
2010-06-29explicitely initialize members of struct dev in dev_open()Jacob Meuser
fixes crash found by nicm ok ratchov
2010-06-29If the device isn't opened yet (as can be the case with '-a off'),Jacob Meuser
don't check if the midi control interface is idle from ratchov
2010-06-25don't attempt to drain devices after they are destroyed, whichAlexandre Ratchov
results in a use after free(). Catched by jakemsr@ with MALLOC_OPTIONS=J
2010-06-20fix midicat(1) device mode when only -i or only -o is used (ieAlexandre Ratchov
open the device input-only if -o is used, and output-only if -i is used).
2010-06-05Take into account wav ``riff'' header when calculating the offsetAlexandre Ratchov
of the data chuck returned in ``startpos''. Fixes MMC relocate being off by few samples.
2010-06-05when parsing wav headers, check that a data chuck actually existsAlexandre Ratchov
2010-06-05in dev_close(), first terminate streams recording from the hardware,Alexandre Ratchov
then terminate streams recording from the monitor (if any). Otherwise, dev_close() would try to check if a stream is recording from the hardware or the monitor, and, if there's no monitor, would dereference a NULL pointer.
2010-06-05When closing the device, request clients using a midi control slotAlexandre Ratchov
to quit. Otherwise streams that are not attached to the device are not closed.
2010-06-05don't prime server buffers, because it's ugly and conceptuallyAlexandre Ratchov
complicated. Instead, request clients to provide enough samples and start with buffers full.
2010-06-05Don't send the initial position as a clock tick with a negative delta.Alexandre Ratchov
Add a new ``initial position'' message which is simpler. No bahaviour change, except effects of the protocol version crank.
2010-06-04when attaching files to play or record to the device, check thatAlexandre Ratchov
the device supports play or record modes respectively. spotted by jakemsr
2010-06-04midi control aproc structure is can be destroyed before any streamAlexandre Ratchov
referencing it (for instance while a recording stream drains buffers of a closed device). So, don't abort() if this happen.
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-05-27include stdint.hAlexandre Ratchov
2010-05-25enable support for ``extended'' .wav files since certain programsAlexandre Ratchov
use this format instead of the non-extended one (ex. audio/libao) spotted/suggested by naddy
2010-05-08prime play buffers as soon as the device is opened, otherwise aAlexandre Ratchov
midi client could start it with empty buffers, in turn hurting audio clients.
2010-05-08Fix sign in dev_getpos(). Indeed, positive device playback latencyAlexandre Ratchov
is accounted as negative start position offset.
2010-05-08don't take into account recording latency in dev_getpos(), sinceAlexandre Ratchov
dev_sync() always discards any recorded samples
2010-05-07remove ``abspos'' counters, from the pre-libsndio era. Since play andAlexandre Ratchov
rec direction use the same clock, there's no need to maintain their absolute position.
2010-05-07Since aucat uses libsndio, play and rec clocks are the same, soAlexandre Ratchov
use play and rec latencies counters to calculate the offset between play and rec direction. Greatly simplifies stream attaching code.
2010-05-07don't prime audio buffers if the device is only started to serveAlexandre Ratchov
as clock source for MIDI clients.
2010-05-06allow volumes of uninitialized slots to be setAlexandre Ratchov
2010-05-04make the mixer process data as soon as it's pushed by one of itsAlexandre Ratchov
inputs, i.e. don't way that the output requests it.
2010-05-04if the ``device'' is in loopback mode (ie no audio device), thenAlexandre Ratchov
disable overruns/underruns since aucat must pause when an input or an output blocks. This is a theoretical fix, since the start/stop code is never reached in loopback mode
2010-05-02Clean up device handling code to clarify different initialization phasesAlexandre Ratchov
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.
2010-05-02Don't systematically fill with silence the mixer output. ThisAlexandre Ratchov
might result in extra samples being written to the device when the mixer is closed.
2010-05-02use clock_gettime() and interval timers instead of gettimeofday()Alexandre Ratchov
and poll()'s timeout. Simpler and more accurate, from midish
2010-05-02in the resampling code, handle the case ``diff == 0'', to avoid producingAlexandre Ratchov
the first sample of the next block in advance.