summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/aucat.c
AgeCommit message (Collapse)Author
2011-04-16for unix domain socket addresses use AUCAT_PATH and MIDICAT_PATHAlexandre Ratchov
macros instead of hardcoded strings. No object change
2011-03-17use a DEFAULT_RATE macro instead of hardcoding 44100, no object changeAlexandre Ratchov
2010-11-05unbreak compilation without DEBUG definedAlexandre 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-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-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-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-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-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-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-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-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-04-24if there are no files to play in legacy mode, print the usage messageAlexandre Ratchov
2010-04-24rename ibuflist/obuflist -> ins/outs to cut long linesAlexandre Ratchov
from Thomas Pfaff, thanks
2010-04-22Allow multiple users to share the same aucat server. If aucat isAlexandre Ratchov
run by root, it binds a shared address to the socket, cranks the process priority and drops privileges. sio_open(3) will try to connect to the private socket first (if any), then to the shared socket. Only one user may have connections to aucat at a given time. based on discussions with henning, pyr and others ok jacek, deraadt
2010-04-21when creating the ``default'' subdevice, use last parameters of theAlexandre Ratchov
command line, instead of the device parameters.
2010-04-21adds the necessary bits to join channels (ex stereo->mono) orAlexandre Ratchov
expand channels (ex mono->stereo). It's switched on/off with the ``-j'' option, (default is "on").
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-14Use -C option to specify recorded channel range instead of -c whichAlexandre Ratchov
is for played channels. spotted by Jan Stary <hans at stare.cz>, thanks
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
2010-01-05Make the way .wav files are handled closer to the way sockets areAlexandre Ratchov
handled, which is conceptually simpler. No behaviour changes.
2009-11-21use strtonum(3) and strtol(3) instead of sscanf(3)Alexandre Ratchov
suggested by deraadt@
2009-11-21spellingTheo de Raadt
2009-11-03Allow any program using aucat to act as MMC slave and MTC masterAlexandre Ratchov
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.
2009-10-27add missing word in error messageAlexandre Ratchov
2009-10-10don't use a references to the device file to check the current modeAlexandre Ratchov
2009-10-10make dev_done() common to audio and MIDI, and drop dev_thrudone()Alexandre Ratchov
2009-10-10use dev_done() for loopback devices too and remove dev_loopdone()Alexandre Ratchov
2009-10-05add -d flag. When started in server mode, if the -d flag isAlexandre Ratchov
used aucat and midicat don't daemonize and log on stderr.
2009-09-27remove all debug tracesAlexandre Ratchov
2009-08-26oops, forgot to update usage();Jason McIntyre
2009-08-19don't try to process -o arguments using the input file list, fixesAlexandre Ratchov
midicat crashing sometimes when -o is used
2009-08-19organize midi code like audio code, no functional changeAlexandre Ratchov
2009-08-17allow midicat to take multiple -i and -o optionsAlexandre Ratchov
2009-08-17if one or more MIDI devices are specified in server mode, subscribeAlexandre Ratchov
them to the MIDI thru box
2009-07-25fix comments, remove no longer needed declaration, reorder includesAlexandre Ratchov
from Thomas Pfaff
2009-07-25Currently midi capable programs can control midi hardware, butAlexandre Ratchov
cannot cooperate with other programs. The aim of this change is to allow any program to send midi data to other programs as they were midi hardware. For instance, this change should solve the longstanding problem of using a midi sequencer with software synthesizers. More precisely: - new midicat(1) utility (actually hardlink to aucat(1)). it creates software midi thru boxes, allowing programs to send midi messages to other programs as they were midi(4) hardware. - new midi api in libsndio (see mio_open(3)), to access midi(4) devices and midicat(1) sockets in a uniform way. - new device naming scheme <service>:<unit>[.<option>], common to audio and midi. - new sndio(7) manual describing concepts and naming The current audio device naming still works, but people having scripts or configuration files containing device names could read the sndio(7) man page and slowly start updating device names. discussed with jakemsr@ and deraadt@, help form jmc@
2009-04-27make -v option apply also to implicit default socketAlexandre Ratchov