summaryrefslogtreecommitdiffstats
path: root/lib/libsndio (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* when probing an encoding of a audio(4) device, don't forget toratchov2010-04-241-1/+2
| | | | set record precision.
* remove trailing spaces, from Alexandr Shadchin, thanksratchov2010-04-246-42/+42
|
* Allow multiple users to share the same aucat server. If aucat isratchov2010-04-222-5/+23
| | | | | | | | | | | 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
* audio(4) doesn't require to be started explicitely, so the device isratchov2010-04-111-1/+18
| | | | | | | | started immediately after it's opened in record only mode. Pause it in sio_open() and sio_stop(), since libsndio requires an explicit call to sio_start(). discussed with jakemsr
* aucat (server):ratchov2010-04-064-73/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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@
* Fix sio_getcap() for audio(4) devices exposing encodingsratchov2010-02-101-3/+3
| | | | | with precision other than 8, 16 or 32 bits. Found by Jan Stary <hans at stare.cz>, thanks!
* back out last commit. breaks half-duplex playback with poll().jakemsr2010-01-201-14/+7
| | | | ok ratchov
* Keep in memory whether the socket is writable. This way sio_revents()ratchov2010-01-151-7/+14
| | | | | | | | can return POLLOUT (if requested), even the handle was not writable when sio_pollfd() was called but become writable somewhere in the code path of sio_revents(). This should improve stability of programs using very small buffers.
* explain what sio_close() drains play buffers as if sio_close() wasratchov2009-12-301-16/+16
| | | | | | | called. Since sio_onmove() callback doesn't return negative deltas anymore, slightly simplify related paragraphs. siggested by espie@, ok jakemsr@
* we don't expose overruns/underruns as negative positions anymore,ratchov2009-12-021-3/+3
| | | | don't call the sio_onmove() call-back with negative argument.
* in block size calculations, use SIO_BPS(precision) instead ofratchov2009-11-031-3/+3
| | | | | precision / 8. Fixes sio_setpar() requesting smaller block sizes on 24-bit devices.
* reader state cannot be IDLE, terminate the stream if so ratherratchov2009-10-261-3/+4
| | | | entering a busy loop
* Flow control blocks the client in sio_write(3). Split the dataratchov2009-10-241-3/+7
| | | | | | | | stream in a way that the pause never occurs in the middle of data chunks. Beside being more natural, this allows the client to send non-data messages during the pause (set the volume, stop playback...), rather than delaying them until the end of the pause. It's about few milliseconds only.
* set protocol version number for midi too. Fixes aucat refusingratchov2009-10-221-1/+2
| | | | control connections.
* When starting playback, the client tries to write ``bufsz'' framesratchov2009-10-221-4/+19
| | | | | | | | | | instead of ``appbufsz'', which violates the flow control mechanism. Fix this longstanding bug by enabling negative values in AMSG_MOVE messages, this way the client is notified when its stream is attached to the mixer, and can update its max transfer limit. Since this fix changes the AMSG_MOVE message format, we crank the protocol version, and thus remove code specific to the old protocol.
* Add version number to aucat protocol. It's not used yet,ratchov2009-10-171-1/+2
| | | | | | | but later, it will permit aucat to reject connections from clients statically linked to a unsupported version of libsndio. idea from kittenis, otto and sthen
* when setting parameters of sun devices, check that selected encodingratchov2009-10-101-4/+23
| | | | is actually linear
* at initialization of sun devices, use sio_setpar(3) instead ofratchov2009-10-101-11/+10
| | | | | AUDIO_SETINFO() to set the initial parameters, since AUDIO_SETINFO() can fail.
* since AUDIO_INITINFO() may set parameters to whatever is supportedratchov2009-10-101-24/+59
| | | | | | | | by the device, we may end up with different recording and playback parameters, which will break almost all full duplex apps on such devices. For instance, this should fix full-duplex apps not working on devices that can record at any sample rate but can play at 48kHz only.
* don't consider calling sio_close() without calling sio_stop() firstratchov2009-08-282-6/+4
| | | | | as a programming error. At any stage the program should be alble to cleanly free resources and close the device.
* when using aucat backend, wait for the server to drop the connectionratchov2009-08-281-2/+7
| | | | on sio_close()
* add a new AMSG_BYE, sent by the client to requst the server toratchov2009-08-282-2/+12
| | | | | | free resources and drop the connection. This allows the client to ensuire that at any time it's using only one connection, thus only one MIDI control channel.
* handle incoming AMSG_SETVOL messages, allows the client to be notifiedratchov2009-08-261-1/+7
| | | | of volume changes
* make aucat(1) expose a MIDI device to control server behaviour inratchov2009-08-214-20/+50
| | | | | | 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.
* honor non-blocking flag in mio_open_rmidi(), fixes programsratchov2009-08-011-3/+4
| | | | | eating 100% CPU while trying to use blocking i/o. ok jakemsr
* don't use ``return'' in sio_close() and mio_close()ratchov2009-07-272-4/+4
|
* more style improvemets, from Thomas Pfaffratchov2009-07-262-8/+8
|
* use ``sizeof(string) - 1'' rather than ``strlen(string)'' on staticratchov2009-07-263-8/+8
| | | | strings. suggested by Thomas Pfaff
* remove the (bogus) special case when mio_open() is called withratchov2009-07-261-16/+1
| | | | a midi device name starting with a separator
* rephrase description of (MIO_IN | MIO_OUT) moderatchov2009-07-261-4/+5
| | | | from Thomas Pfaff, ok jmc@
* Make ``static'' few functions that are prototyped as static but are notratchov2009-07-262-4/+4
| | | | | defined as such from Thomas Pfaff
* sort and space headers as per style(9)ratchov2009-07-266-13/+21
| | | | from Thomas Pfaff
* use const qualifier in libsndio, making it slightly more consistentratchov2009-07-2510-38/+38
| | | | | with open(2) and write(2) syscalls. from Thomas Pfaff, jakemsr is fine with it
* add sndio.7, forgotten in last commitratchov2009-07-251-0/+168
| | | | spotted by jasper@
* Currently midi capable programs can control midi hardware, butratchov2009-07-2511-37/+963
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* don't set mode in sio_setpar(), already done at initializationratchov2009-05-161-2/+1
|
* add a new ``hello'' message to aucat protocol useful to work onratchov2009-05-161-5/+25
| | | | future aucat extentions. No functional changes.
* fix style to make future diffs contain functional changes onlyratchov2009-05-161-58/+58
|
* in aucat_getpar() and aucat_getcap(), initialize the message to sendratchov2009-05-161-3/+3
| | | | with AMSG_INIT(), rather than the reply we expect.
* cleanup forgotten calls to exit(3)ratchov2009-05-151-10/+17
|
* replace s/sa/sio/, left from when libsa was renamed to libsndioratchov2009-05-152-94/+94
|
* in headers, macro definitions come first, prototypes come nextratchov2009-05-151-15/+17
|
* if DEBUG is defined, use a global debug level ratherratchov2009-05-154-130/+116
| | | | than a per-stream debug level. No behaviour change.
* describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn valuesratchov2009-05-151-3/+7
| | | | spotted by Philipp Schafft
* no need to install includes from here anymorederaadt2009-04-211-6/+1
|
* move src/lib/libsndio/sndio.h into src/include where other includeratchov2009-04-211-152/+0
| | | | | | files leave. requested by deraadt@, ok miod@
* protypes in sndio.h make reference to struct pollfd; applicationsratchov2009-04-131-1/+3
| | | | | | | that don't use sys/poll.h, wont compile with gcc2. Fix this by declaring the pollfd structure spotted by and ok deraadt
* don't use ``hdl->filling'' flag uninitializedratchov2009-02-261-1/+2
| | | | ok deraadt
* after the STOP message is sent, move the receiver to the RMSG stateratchov2009-02-251-3/+5
| | | | | | | only if it's in the IDLE state, otherwise in some rare cases a data chunk may be interpreted as a message, causing the connection to be dropped. ok deraadt
* in aucat_stop(), after the STOP message was send, put the receiverratchov2009-02-181-1/+3
| | | | | | in ``waiting state'', otherwise the ACK message will be skipped, and the other functions not expecting ACKs might be confused by the ACK.