summaryrefslogtreecommitdiff
path: root/lib/libsndio
AgeCommit message (Collapse)Author
2011-12-24formatting errors, found using freebsd's "igor";Jason McIntyre
2011-12-09mention sndiod rather than aucat when talking about the serverAlexandre Ratchov
2011-11-15Add a "device number" component in sndio(7) device names, allowing aAlexandre Ratchov
single aucat instance to handle all audio and MIDI services. Since this partially breaks compatibility, this is a opportunitiy to fix few other design mistakes (eg ':' being used by inet6, type name vs api name confusion, etc..). This leads to the following names: type[@hostname][,unit]/devnum[.option] The device number is the minor device number for direct hardware access (ie the 'N' in /dev/audioN). For aucat, this is the occurence number of the -f (or -M) option. There's a compatibility hook to keep old names working if only one aucat server is running.
2011-10-22Don't attempt to send data not available for sending yet. AnalysedAlexandre Ratchov
and fixed by Remco <remco at d-compu.dyndns.org>, thanks!
2011-10-18some minor tweaks concerning midicat removal; ok ratchovJason McIntyre
2011-10-17Remove midicat since aucat can now be used instead of midicatAlexandre Ratchov
with almost the same syntax (roughly an extra -M option). Thru boxes are created with aucat, and corresponding MIDI port names have the "aucat" prefix instead of "midithru". The old device name will still work some time for backward compatibility. ok deraadt
2011-10-05restart connect(2) if it returns EINTRAlexandre Ratchov
2011-10-04some tweaks, from Tim van der MolenJason McIntyre
2011-06-03one midicat server can export multiple midithru portsAlexandre Ratchov
2011-06-03don't forget to send the initial clock tickAlexandre Ratchov
2011-05-09in sio_psleep(), use an array of SIO_MAXNFDS pollfd strucures ratherAlexandre Ratchov
than a single one. No behaviour change
2011-05-06use an array of backends and iterate on it, instead of inliningAlexandre Ratchov
calls to sio_<backend>_open(). No behaviour change
2011-05-06remove almost two years old hack to support legacy audio/midiAlexandre Ratchov
device names
2011-05-03determine the default device in backend code instead of the commonAlexandre Ratchov
code. This is simpler as long as not all backends use the same default.
2011-05-02Add missing byter order conversions in message headers. Fixes the caseAlexandre Ratchov
when the server and the client are not of the same endianness. Found by naddy.
2011-05-02set the TCP_NODELAY option for TCP connectionsAlexandre Ratchov
2011-04-28Implement a new authentication method allowing aucat and midicat toAlexandre Ratchov
work over TCP, for instance, to expose the sound card of one machine with other machines of the network. The first client generates a 128-bit random number (aka the session cookie), saves it in $HOME/.aucat_cookie and sends it to the server. Successive clients load the cookie from $HOME/.aucat_cookie and send it to the server but the server accepts only clients whose cookie matches the session cookie. When all clients are gone, the session is over, and another cookie could start a new session, and so on. TCP is enabled on the server with the new -L option, and on the client side hostnames are specified with a new optional component in the device name. hints from damien, dlg and deraadt, tweaks from jmc
2011-04-27move amsg.h containing protocol defs from aucat side to libsndio side.Alexandre Ratchov
requested by deraadt
2011-04-18slightly cleanup by separating socket-specific code fromAlexandre Ratchov
protocol specific code. No behaviour change
2011-04-16remove aucat(1) and midicat(1) socket paths from the FILES sections.Alexandre Ratchov
Besides being wrong, they are part of sndio internals and don't need to be exposed in such a high level man page.
2011-04-16for unix domain socket addresses use AUCAT_PATH and MIDICAT_PATHAlexandre Ratchov
macros instead of hardcoded strings. No object change
2011-04-16Since aucat supports any parameter combination sio_getcap() doesn'tAlexandre Ratchov
need to query the server for supported parameters. So stop using the AMSG_GETCAP message, and remove it completely from the aucat protocol.
2011-04-16Make aucat audio and midi backends share the same code to communicateAlexandre Ratchov
with the server. As we're at it use the same protocol for midi and audio. Now, both audio and midi code use the same SNDIO_DEBUG environment variable to turn on/off DPRINTF's.
2011-04-12Use mio_<backend>_ prefix for private midi-related functions and putAlexandre Ratchov
them in files named mio_<backend>.c No behaviour change.
2011-04-08Clean up function naming: use sio_<backend>_ prefix for privateAlexandre Ratchov
audio-related functions and put them in files named sio_<backend>.c No behaviour changes.
2010-11-06tweak previous;Jason McIntyre
2010-11-06make sio_onvol(3) return a integer exposing whether a volume knobAlexandre Ratchov
is available for the stream. As we're at it, remove macros and functions that are neither used nor documented.
2010-10-23add forgotten ``static''Alexandre 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-17don't try to get the current stream postion when the device is stopped,Alexandre Ratchov
and don't generate clock ticks (ie don't invoke the sio_onmove(3) call-back).
2010-08-20polish the code: remove few unused #includes, add missing ones,Alexandre Ratchov
fix NULL vs 0, etc. No behaviour change.
2010-08-06If audio interrupts are missed (as this happens on some MP systemsAlexandre Ratchov
now), play and record directons may be out of sync, and since the play direction is used as clock source, we may end up with data ariving _before_ the time it was recorded. This breaks the sndio ``device model'' and most full-duplex apps relying on it, starting with aucat in its default mode. Workaround this by using the direction that's ahead as clock source, ensuring that recorded data never arrives before the clock tick it was recorded. This prevents apps from crashing but won't fix stuttering caused by missed interrupts. ok deraadt@
2010-07-21remove unnecessary ``return 0'' statements,Alexandre Ratchov
from Remco <remco at d-compu.dyndns.org>, thanks!
2010-07-15add two new members to structs audio_encoding and audio_prinfo.Jacob Meuser
for both structs, the new members are 'bps' and 'msb', which describe the number of bytes per sample and data alignment in the sample, respectively. drivers must properly set these fields in the 'query_encoding', 'set_parameters' and 'get_default_params' hardware interface methods. discussed with ratchov, deraadt
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-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 clock ticks while buffers are being primedAlexandre Ratchov
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-05-25complete any pending message when the device is stoppedAlexandre Ratchov
2010-05-25drop samples or insert silence in sun_revents(). Otherwise, inAlexandre Ratchov
full-duplex, we may detect a xrun in the play direction and discard the clock tick, this would cause sio_revents() to return POLLIN without the clock being advanced, causing apps relying on the clock for flow control to enter a busy loop.
2010-05-09if the sample rate the hardware will use is different than theJacob Meuser
requested sample rate, scale the block/buffer sizes so the block/ buffer sizes the hardware will use are the same amount of *time* as the requested block/buffer sizes. ok ratchov@
2010-04-29in sun_start(), don't pause the device in play mode, since it'sAlexandre Ratchov
already paused (by either sio_open or sio_stop) from Alexandr Shadchin, thanks!
2010-04-26once sio_start() has been called, stream parameters cannot beJacob Meuser
changed until after sio_stop() is called ok ratchov@, jmc@
2010-04-25If setting close-on-exec flag fails (can this happen?), the wrongAlexandre Ratchov
descriptor is closed. Fix from Alexandr Shadchin, together with various simplifications.
2010-04-25Fix the way sio_getcap() probes rates of audio(4) devices.Alexandre Ratchov
From Alexandr Shadchin <alexandr.shadchin at gmail.com> Good catch!
2010-04-25when probing for a encoding/channels/rate combination, ensure thatAlexandre Ratchov
play parameters are set only if playback is enabled, and record parameters are set only if recording is enabled. Fixes sun_getcap() on devices whose play and record parameters are not independent.
2010-04-24when probing an encoding of a audio(4) device, don't forget toAlexandre Ratchov
set record precision.
2010-04-24remove trailing spaces, from Alexandr Shadchin, thanksAlexandre Ratchov
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-11audio(4) doesn't require to be started explicitely, so the device isAlexandre Ratchov
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