OpenBSD CVS

CVS log for src/lib/libsndio/aucat.c


[BACK] Up to [local] / src / lib / libsndio

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.79 / (download) - annotate - [select for diffs], Sun Nov 7 20:51:47 2021 UTC (2 years, 7 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.78: +17 -5 lines
Diff to previous 1.78 (colored)

Allow -current libsndio to connect to old sndiod servers

Recent sndio device naming change is missing the proper compatibility
bits for this case. Found and fixed by bluhm@ and tweaks from me.

ok bluhm

Revision 1.78 / (download) - annotate - [select for diffs], Mon Nov 1 14:43:24 2021 UTC (2 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.77: +11 -8 lines
Diff to previous 1.77 (colored)

Stop binding audio devices exposed by sndiod to physical devices

This a shift towards a new model: clients connect to logical devices
(created with -s option) then the server routes data to/from the
underlying physical device (registered with -f option). The binding
may be changed at run-time with the server.device control exposed by
sndioctl(1).

As audio devices exposed by sndiod(8) are not bound to fixed physical
devices anymore, the physical audio device number component of
sndio(7) descriptors was removed.

fixes, help from and ok denis, edd

Revision 1.77 / (download) - annotate - [select for diffs], Fri Jul 12 06:30:55 2019 UTC (4 years, 11 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.76: +2 -1 lines
Diff to previous 1.76 (colored)

Add affinity between the program and its mixer control.

Currently, if there are two instances of the same program, sndiod will
allocate one volume control to each. If both programs disconnect and
reconnect, the information of which control is assigned to which
program is lost. This makes difficult to run two instances of a player
and crossfade between each other with a MIDI controller.

To address this, the program chooses a 32-bit "id" (for now the
process pid) and sends it to the server. The server records the id in
the client's slot structure.  When the server accepts a new
connection, it uses the id to identify the slot the client used during
the previous connection; if it was not recycled yet, it's assigned to
the program.

Revision 1.76 / (download) - annotate - [select for diffs], Sat Jun 29 06:05:26 2019 UTC (4 years, 11 months ago) by ratchov
Branch: MAIN
Changes since 1.75: +22 -22 lines
Diff to previous 1.75 (colored)

Check if syscalls return -1 instead of any negative value.

"Looks right" deraadt

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jun 28 05:35:34 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

mkstemp() returns -1 on failure

Revision 1.74 / (download) - annotate - [select for diffs], Thu Mar 28 11:11:18 2019 UTC (5 years, 2 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.73: +17 -4 lines
Diff to previous 1.73 (colored)

Wait until server disconnects before closing the socket. Otherwise,
last bytes sent may be lost by the server.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Sep 26 08:33:22 2018 UTC (5 years, 8 months ago) by miko
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.72: +3 -24 lines
Diff to previous 1.72 (colored)

call _sndio_parsenum() instead of duplicating the code in parsedev(); ok ratchov@

Revision 1.72 / (download) - annotate - [select for diffs], Sat Jul 28 09:11:55 2018 UTC (5 years, 10 months ago) by ratchov
Branch: MAIN
Changes since 1.71: +12 -2 lines
Diff to previous 1.71 (colored)

Move libsndio session cookie in its own $HOME/.sndio/ directory to
make libsndio easier to use with unveil(2).

"make sense" deraadt

Revision 1.71 / (download) - annotate - [select for diffs], Sat Jan 9 08:27:24 2016 UTC (8 years, 5 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

Make code fit in 80 columns, remove trailing spaces & tabs.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Dec 23 20:29:57 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
Changes since 1.69: +3 -5 lines
Diff to previous 1.69 (colored)

remove NULL-checks before free()

Revision 1.69 / (download) - annotate - [select for diffs], Sun Nov 22 12:01:23 2015 UTC (8 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.68: +15 -6 lines
Diff to previous 1.68 (colored)

Don't remove the type component from the device string before passing
it to the *_open() functions. It's more flexible this way. No behaviour
change.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Oct 5 07:18:03 2015 UTC (8 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.67: +28 -14 lines
Diff to previous 1.67 (colored)

Fix missing checks for truncation of long file names. Rather than
checking for truncation every time we touch the string, simply allocate
a memory chunk large enough to store the full path.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Oct 2 09:51:54 2015 UTC (8 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.66: +5 -3 lines
Diff to previous 1.66 (colored)

use macros for cookie path and temp file template instead
of hardcoded strings. no object change.

Revision 1.66 / (download) - annotate - [select for diffs], Fri Oct 2 09:36:24 2015 UTC (8 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.65: +3 -3 lines
Diff to previous 1.65 (colored)

As the socket path is known, use its size rather that PATH_MAX.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Oct 2 09:21:46 2015 UTC (8 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

use macros instead of hard-coded strings for unix sockets paths

Revision 1.64 / (download) - annotate - [select for diffs], Thu Oct 1 06:38:19 2015 UTC (8 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.63: +7 -11 lines
Diff to previous 1.63 (colored)

Remove support for the AUCAT_COOKIE environment variable.

Revision 1.63 / (download) - annotate - [select for diffs], Tue May 5 13:36:22 2015 UTC (9 years, 1 month ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.62: +3 -2 lines
Diff to previous 1.62 (colored)

add missing braces in _aucat_wmsg()

As ratchov@ notes:
"all _aucat_wmsg() callers set hdl->wtodo, so your diff can't break
things that used to work by accident."

ok ratchov@

Revision 1.62 / (download) - annotate - [select for diffs], Sun Sep 7 10:12:17 2014 UTC (9 years, 9 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.61: +4 -7 lines
Diff to previous 1.61 (colored)

Use SOCK_CLOEXEC (instead of later using fcntl(F_SETFD)) when creating sockets
for talking to aucat/sndiod

ok ratchov@

Revision 1.61 / (download) - annotate - [select for diffs], Fri Dec 20 08:51:28 2013 UTC (10 years, 5 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored)

Be less verbose when SNDIO_DEBUG=1 is set.

Revision 1.60 / (download) - annotate - [select for diffs], Mon Nov 18 17:37:45 2013 UTC (10 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.59: +1 -0 lines
Diff to previous 1.59 (colored)

add missing prototypes

Revision 1.59 / (download) - annotate - [select for diffs], Wed Nov 13 22:38:22 2013 UTC (10 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.58: +30 -31 lines
Diff to previous 1.58 (colored)

Prefix by '_' symbols that are not part of the API.

ok deraadt, guenther

Revision 1.58 / (download) - annotate - [select for diffs], Tue Nov 12 06:56:00 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.57: +4 -4 lines
Diff to previous 1.57 (colored)

internalize some functions so that they do not need prototypes
ok ratchov

Revision 1.57 / (download) - annotate - [select for diffs], Wed Mar 13 08:51:18 2013 UTC (11 years, 3 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.56: +1 -0 lines
Diff to previous 1.56 (colored)

in debug mode, log successful connections, from Jan Stary

Revision 1.56 / (download) - annotate - [select for diffs], Fri Nov 23 07:03:28 2012 UTC (11 years, 6 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.55: +2 -3 lines
Diff to previous 1.55 (colored)

Remplace aucat server by a new sndiod daemon aimed to be simpler
smaller and faster than aucat. It's a drop in replacement with the
following exceptions that don't affect the default setup:
  - The sample rate and the encoding are a per-device parameters
    thus -r and -e options must precede the corresponding -f option
  - MIDI thru boxes are dynamically created and no -M option
    is required anymore, so -M was removed.
  - MIDI ports are exposed with a new ``midi/N'' name, rather
    than abusing MIDI thru boxes.
with help from armani@, ok deraadt@

Revision 1.55 / (download) - annotate - [select for diffs], Fri Nov 2 10:24:58 2012 UTC (11 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored)

Use dedicated messages for flow control instead of abusing clock tick
messages and enable flow control for MIDI. Since this requires protocol
version bump, both sndiod and libsndio must be kept up to date to work
together.

Revision 1.54 / (download) - annotate - [select for diffs], Wed Apr 11 06:05:43 2012 UTC (12 years, 2 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.53: +11 -9 lines
Diff to previous 1.53 (colored)

Use "unsigned int" rather than "unsigned". No object change.
suggested by deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Tue Nov 15 08:05:22 2011 UTC (12 years, 6 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.52: +88 -45 lines
Diff to previous 1.52 (colored)

Add a "device number" component in sndio(7) device names, allowing a
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.

Revision 1.52 / (download) - annotate - [select for diffs], Sat Oct 22 10:23:44 2011 UTC (12 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.51: +9 -7 lines
Diff to previous 1.51 (colored)

Don't attempt to send data not available for sending yet. Analysed
and fixed by Remco <remco at d-compu.dyndns.org>, thanks!

Revision 1.51 / (download) - annotate - [select for diffs], Mon Oct 17 21:09:11 2011 UTC (12 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.50: +9 -15 lines
Diff to previous 1.50 (colored)

Remove midicat since aucat can now be used instead of midicat
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

Revision 1.50 / (download) - annotate - [select for diffs], Wed Oct 5 16:15:43 2011 UTC (12 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.49: +4 -1 lines
Diff to previous 1.49 (colored)

restart connect(2) if it returns EINTR

Revision 1.49 / (download) - annotate - [select for diffs], Tue May 3 20:15:23 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.48: +3 -1 lines
Diff to previous 1.48 (colored)

determine the default device in backend code instead of the common
code. This is simpler as long as not all backends use the same
default.

Revision 1.48 / (download) - annotate - [select for diffs], Mon May 2 22:32:29 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.47: +12 -12 lines
Diff to previous 1.47 (colored)

Add missing byter order conversions in message headers. Fixes the case
when the server and the client are not of the same endianness.
Found by naddy.

Revision 1.47 / (download) - annotate - [select for diffs], Mon May 2 22:24:23 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.46: +9 -2 lines
Diff to previous 1.46 (colored)

set the TCP_NODELAY option for TCP connections

Revision 1.46 / (download) - annotate - [select for diffs], Thu Apr 28 06:19:57 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.45: +164 -4 lines
Diff to previous 1.45 (colored)

Implement a new authentication method allowing aucat and midicat to
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

Revision 1.45 / (download) - annotate - [select for diffs], Mon Apr 18 23:57:35 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.44: +38 -29 lines
Diff to previous 1.44 (colored)

slightly cleanup by separating socket-specific code from
protocol specific code. No behaviour change

Revision 1.44 / (download) - annotate - [select for diffs], Sat Apr 16 10:52:22 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.43: +144 -560 lines
Diff to previous 1.43 (colored)

Make aucat audio and midi backends share the same code to communicate
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.

Revision 1.43, Fri Apr 8 11:18:07 2011 UTC (13 years, 2 months ago) by ratchov
Branch: MAIN
Changes since 1.42: +1 -1 lines
FILE REMOVED

Clean up function naming: use sio_<backend>_ prefix for private
audio-related functions and put them in files named sio_<backend>.c
No behaviour changes.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Oct 21 18:57:42 2010 UTC (13 years, 7 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.41: +2 -6 lines
Diff to previous 1.41 (colored)

use MODE_xxx and XRUN_xxx macros everywhere, and zap corresponding
AMSG_xxx macros, which in turns simplifies the code

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jun 5 16:00:52 2010 UTC (14 years ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.40: +6 -4 lines
Diff to previous 1.40 (colored)

don't prime server buffers, because it's ugly and conceptually
complicated. Instead, request clients to provide enough samples
and start with buffers full.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jun 5 13:40:47 2010 UTC (14 years ago) by ratchov
Branch: MAIN
Changes since 1.39: +8 -5 lines
Diff to previous 1.39 (colored)

don't send clock ticks while buffers are being primed

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jun 5 12:45:48 2010 UTC (14 years ago) by ratchov
Branch: MAIN
Changes since 1.38: +12 -9 lines
Diff to previous 1.38 (colored)

Don't send the initial position as a clock tick with a negative delta.
Add a new ``initial position'' message which is simpler. No bahaviour
change, except effects of the protocol version crank.

Revision 1.38 / (download) - annotate - [select for diffs], Tue May 25 06:51:28 2010 UTC (14 years ago) by ratchov
Branch: MAIN
Changes since 1.37: +16 -11 lines
Diff to previous 1.37 (colored)

complete any pending message when the device is stopped

Revision 1.37 / (download) - annotate - [select for diffs], Sat Apr 24 06:15:54 2010 UTC (14 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.36: +5 -5 lines
Diff to previous 1.36 (colored)

remove trailing spaces, from Alexandr Shadchin, thanks

Revision 1.36 / (download) - annotate - [select for diffs], Thu Apr 22 17:43:30 2010 UTC (14 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.35: +11 -2 lines
Diff to previous 1.35 (colored)

Allow multiple users to share the same aucat server. If aucat is
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

Revision 1.35 / (download) - annotate - [select for diffs], Tue Apr 6 20:07:01 2010 UTC (14 years, 2 months ago) by ratchov
Branch: MAIN
Changes since 1.34: +75 -23 lines
Diff to previous 1.34 (colored)

aucat (server):

  - 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@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Jan 20 13:17:22 2010 UTC (14 years, 4 months ago) by jakemsr
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.33: +7 -14 lines
Diff to previous 1.33 (colored)

back out last commit.  breaks half-duplex playback with poll().
ok ratchov

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jan 15 22:28:23 2010 UTC (14 years, 4 months ago) by ratchov
Branch: MAIN
Changes since 1.32: +14 -7 lines
Diff to previous 1.32 (colored)

Keep in memory whether the socket is writable. This way sio_revents()
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.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Oct 26 19:06:28 2009 UTC (14 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.31: +4 -3 lines
Diff to previous 1.31 (colored)

reader state cannot be IDLE, terminate the stream if so rather
entering a busy loop

Revision 1.31 / (download) - annotate - [select for diffs], Sat Oct 24 09:35:16 2009 UTC (14 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.30: +7 -3 lines
Diff to previous 1.30 (colored)

Flow control blocks the client in sio_write(3). Split the data
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.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Oct 22 21:41:30 2009 UTC (14 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.29: +19 -4 lines
Diff to previous 1.29 (colored)

When starting playback, the client tries to write ``bufsz'' frames
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.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Oct 17 10:55:43 2009 UTC (14 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored)

Add version number to aucat protocol. It's not used yet,
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

Revision 1.28 / (download) - annotate - [select for diffs], Fri Aug 28 10:52:14 2009 UTC (14 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

don't consider calling sio_close() without calling sio_stop() first
as a programming error. At any stage the program should be alble to
cleanly free resources and close the device.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Aug 28 10:03:36 2009 UTC (14 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.26: +7 -2 lines
Diff to previous 1.26 (colored)

when using aucat backend, wait for the server to drop the connection
on sio_close()

Revision 1.26 / (download) - annotate - [select for diffs], Fri Aug 28 06:37:06 2009 UTC (14 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.25: +7 -1 lines
Diff to previous 1.25 (colored)

add a new AMSG_BYE, sent by the client to requst the server to
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.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Aug 26 05:33:01 2009 UTC (14 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.24: +7 -1 lines
Diff to previous 1.24 (colored)

handle incoming AMSG_SETVOL messages, allows the client to be notified
of volume changes

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jul 26 12:38:20 2009 UTC (14 years, 10 months ago) by ratchov
Branch: MAIN
Changes since 1.23: +4 -2 lines
Diff to previous 1.23 (colored)

sort and space headers as per style(9)
from Thomas Pfaff

Revision 1.23 / (download) - annotate - [select for diffs], Sat Jul 25 11:15:56 2009 UTC (14 years, 10 months ago) by ratchov
Branch: MAIN
Changes since 1.22: +4 -4 lines
Diff to previous 1.22 (colored)

use const qualifier in libsndio, making it slightly more consistent
with open(2) and write(2) syscalls.
from Thomas Pfaff, jakemsr is fine with it

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jul 25 08:44:26 2009 UTC (14 years, 10 months ago) by ratchov
Branch: MAIN
Changes since 1.21: +21 -6 lines
Diff to previous 1.21 (colored)

Currently midi capable programs can control midi hardware, but
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@

Revision 1.21 / (download) - annotate - [select for diffs], Sat May 16 12:10:52 2009 UTC (15 years ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

don't set mode in sio_setpar(), already done at initialization

Revision 1.20 / (download) - annotate - [select for diffs], Sat May 16 11:15:26 2009 UTC (15 years ago) by ratchov
Branch: MAIN
Changes since 1.19: +25 -5 lines
Diff to previous 1.19 (colored)

add a new ``hello'' message to aucat protocol useful to work on
future aucat extentions. No functional changes.

Revision 1.19 / (download) - annotate - [select for diffs], Sat May 16 09:04:45 2009 UTC (15 years ago) by ratchov
Branch: MAIN
Changes since 1.18: +58 -58 lines
Diff to previous 1.18 (colored)

fix style to make future diffs contain functional changes only

Revision 1.18 / (download) - annotate - [select for diffs], Sat May 16 09:01:56 2009 UTC (15 years ago) by ratchov
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

in aucat_getpar() and aucat_getcap(), initialize the message to send
with AMSG_INIT(), rather than the reply we expect.

Revision 1.17 / (download) - annotate - [select for diffs], Fri May 15 13:10:39 2009 UTC (15 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.16: +27 -27 lines
Diff to previous 1.16 (colored)

replace s/sa/sio/, left from when libsa was renamed to libsndio

Revision 1.16 / (download) - annotate - [select for diffs], Fri May 15 13:04:52 2009 UTC (15 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.15: +17 -17 lines
Diff to previous 1.15 (colored)

if DEBUG is defined, use a global debug level rather
than a per-stream debug level. No behaviour change.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Feb 25 23:31:59 2009 UTC (15 years, 3 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.14: +5 -3 lines
Diff to previous 1.14 (colored)

after the STOP message is sent, move the receiver to the RMSG state
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

Revision 1.14 / (download) - annotate - [select for diffs], Wed Feb 18 07:32:27 2009 UTC (15 years, 3 months ago) by ratchov
Branch: MAIN
Changes since 1.13: +3 -1 lines
Diff to previous 1.13 (colored)

in aucat_stop(), after the STOP message was send, put the receiver
in ``waiting state'', otherwise the ACK message will be skipped,
and the other functions not expecting ACKs might be confused by
the ACK.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 4 07:54:00 2009 UTC (15 years, 4 months ago) by ratchov
Branch: MAIN
Changes since 1.12: +5 -1 lines
Diff to previous 1.12 (colored)

Programs have no direct access do the device file descriptor. So, if
the programs calls execvp(2), the new image can't use the device, which
stays open, so other programs get EBUSY. Set the close-on-exec flag to
avoid this.

ok jakemsr

Revision 1.12 / (download) - annotate - [select for diffs], Tue Feb 3 19:44:58 2009 UTC (15 years, 4 months ago) by ratchov
Branch: MAIN
Changes since 1.11: +9 -3 lines
Diff to previous 1.11 (colored)

in server mode, create /tmp/aucat-userid/ directory with
permissions 0700, and create sockets in it. This prevents
one local user to eavesdrop or disturb audio programs of
other users.

if you're using the ``-s socket'' option with an absolute
path as argument, please update it to use a socket name.

requested by many, bits from jakemsr and otto
ok jakemsr

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jan 10 20:34:44 2009 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.10: +30 -30 lines
Diff to previous 1.10 (colored)

make all private functions static

Revision 1.10 / (download) - annotate - [select for diffs], Sat Dec 27 12:10:42 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

when polling aucat(1) socket, don't set the POLLIN bit if we
don't expect messages. Avoids busy loops in programs calling
poll(2) on a stopped device.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Dec 27 11:35:50 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

when using the aucat(1) backend, don't mask the POLLHUP bit
even if the device is not started yet. This way, if the server
is killed programs can notice it.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Dec 21 10:03:25 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

fix more spelling errors and typos,
from Thomas Pfaff <tpfaff(at)@tp76.info>, thanks

Revision 1.7 / (download) - annotate - [select for diffs], Wed Dec 17 10:00:50 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.6: +16 -16 lines
Diff to previous 1.6 (colored)

stop using stderr in the library, wrap all diagnostic fprintfs
so they are visible only when the DEBUG macro is #defined
and SIO_DEBUG env. variable is set.
requested by many, discussed with jakemsr

Revision 1.6 / (download) - annotate - [select for diffs], Wed Dec 17 07:31:38 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

fix spell errors, from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!

Revision 1.5 / (download) - annotate - [select for diffs], Wed Dec 17 07:19:27 2008 UTC (15 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.4: +3 -2 lines
Diff to previous 1.4 (colored)

add a writable ``appbufsz'' field to the sa_par structure, containing
the program-part of the buffer size, ie the part that is subject to
underruns. Useful for apps like cdio(1) that don't have their own
rings, or to apps that have a minimum ring size constraint. Setting
the ``bufsz'' parameter becomes deprecated.
ok jakemsr

Revision 1.4 / (download) - annotate - [select for diffs], Mon Nov 17 07:04:13 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.3: +18 -11 lines
Diff to previous 1.3 (colored)

allow aucat to run as server in play-only and record-only mode, so
it can be used on play-only, record-only and half-duplex devices.
ok jakemsr

Revision 1.3 / (download) - annotate - [select for diffs], Sun Nov 16 21:18:30 2008 UTC (15 years, 6 months ago) by ratchov
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

when the aucat backend is used, sio_revents(3) should return POLLHUP
if the connection to the server is lost.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Nov 11 19:39:35 2008 UTC (15 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.1: +90 -42 lines
Diff to previous 1.1 (colored)

expose a volume knob in the sndio API: add sio_setvol(3) and
sio_onvol(3) functions. The audio(4) backend tries to use the
inputs.dac, outputs.dac, outputs.output and outputs.master
controls (in this order). Add a sample file in
regress/lib/libsndio/vol/vol.c

Revision 1.1 / (download) - annotate - [select for diffs], Mon Oct 27 00:26:33 2008 UTC (15 years, 7 months ago) by ratchov
Branch: MAIN

rename libsa to libsndio
requested by many, "just go for it" deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.