History log of /openbsd-current/lib/libsndio/sio_open.3
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.56 30-May-2022 op

move bufsz description after appbufsz as per struct fields order

ok ratchov@


# 1.55 30-Apr-2022 ratchov

Tweak to clarify sio_stop(3) and sio_flush() description, from jmc@


# 1.54 29-Apr-2022 ratchov

Add sio_flush(3) function to stop playback immediately

The new sio_flush(3) functions works the same way as sio_stop(3),
except that it doesn't wait for play buffer to be drained. Instead,
it discards its contents and returns immediately.


Revision tags: OPENBSD_7_1_BASE
# 1.53 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.52 29-Nov-2020 ratchov

Clarify what sio_start() does exactly

Suggested by Erico Nogueira <ericonr@disroot.org>,
help from and ok jmc@, schwarze@


# 1.51 20-Nov-2020 schwarze

* Add SIO_BPS() to NAME and SYNOPSIS where it is missing.
* Use .Fn rather than .Dv for macros taking arguments.
* Actually say what SIO_LE_NATIVE means.
* Add closely related APIs to SEE ALSO.
* Add missing HISTORY and AUTHORS sections.
OK ratchov@


Revision tags: OPENBSD_6_8_BASE
# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.55 30-Apr-2022 ratchov

Tweak to clarify sio_stop(3) and sio_flush() description, from jmc@


# 1.54 29-Apr-2022 ratchov

Add sio_flush(3) function to stop playback immediately

The new sio_flush(3) functions works the same way as sio_stop(3),
except that it doesn't wait for play buffer to be drained. Instead,
it discards its contents and returns immediately.


Revision tags: OPENBSD_7_1_BASE
# 1.53 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.52 29-Nov-2020 ratchov

Clarify what sio_start() does exactly

Suggested by Erico Nogueira <ericonr@disroot.org>,
help from and ok jmc@, schwarze@


# 1.51 20-Nov-2020 schwarze

* Add SIO_BPS() to NAME and SYNOPSIS where it is missing.
* Use .Fn rather than .Dv for macros taking arguments.
* Actually say what SIO_LE_NATIVE means.
* Add closely related APIs to SEE ALSO.
* Add missing HISTORY and AUTHORS sections.
OK ratchov@


Revision tags: OPENBSD_6_8_BASE
# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.54 29-Apr-2022 ratchov

Add sio_flush(3) function to stop playback immediately

The new sio_flush(3) functions works the same way as sio_stop(3),
except that it doesn't wait for play buffer to be drained. Instead,
it discards its contents and returns immediately.


Revision tags: OPENBSD_7_1_BASE
# 1.53 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.52 29-Nov-2020 ratchov

Clarify what sio_start() does exactly

Suggested by Erico Nogueira <ericonr@disroot.org>,
help from and ok jmc@, schwarze@


# 1.51 20-Nov-2020 schwarze

* Add SIO_BPS() to NAME and SYNOPSIS where it is missing.
* Use .Fn rather than .Dv for macros taking arguments.
* Actually say what SIO_LE_NATIVE means.
* Add closely related APIs to SEE ALSO.
* Add missing HISTORY and AUTHORS sections.
OK ratchov@


Revision tags: OPENBSD_6_8_BASE
# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.53 31-Mar-2022 naddy

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.52 29-Nov-2020 ratchov

Clarify what sio_start() does exactly

Suggested by Erico Nogueira <ericonr@disroot.org>,
help from and ok jmc@, schwarze@


# 1.51 20-Nov-2020 schwarze

* Add SIO_BPS() to NAME and SYNOPSIS where it is missing.
* Use .Fn rather than .Dv for macros taking arguments.
* Actually say what SIO_LE_NATIVE means.
* Add closely related APIs to SEE ALSO.
* Add missing HISTORY and AUTHORS sections.
OK ratchov@


Revision tags: OPENBSD_6_8_BASE
# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.52 29-Nov-2020 ratchov

Clarify what sio_start() does exactly

Suggested by Erico Nogueira <ericonr@disroot.org>,
help from and ok jmc@, schwarze@


# 1.51 20-Nov-2020 schwarze

* Add SIO_BPS() to NAME and SYNOPSIS where it is missing.
* Use .Fn rather than .Dv for macros taking arguments.
* Actually say what SIO_LE_NATIVE means.
* Add closely related APIs to SEE ALSO.
* Add missing HISTORY and AUTHORS sections.
OK ratchov@


Revision tags: OPENBSD_6_8_BASE
# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.51 20-Nov-2020 schwarze

* Add SIO_BPS() to NAME and SYNOPSIS where it is missing.
* Use .Fn rather than .Dv for macros taking arguments.
* Actually say what SIO_LE_NATIVE means.
* Add closely related APIs to SEE ALSO.
* Add missing HISTORY and AUTHORS sections.
OK ratchov@


Revision tags: OPENBSD_6_8_BASE
# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.50 20-Jun-2020 schwarze

basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises


Revision tags: OPENBSD_6_7_BASE
# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.49 21-Apr-2020 deraadt

move mixerctl and audioctl man pages to section 8, as these work
against root-only device nodes.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.48 18-Jan-2019 ratchov

Sayt that using capabilities to negociate audio parameters (ie using
sio_getcap() function) is not recomended.

From Paul Swanson <psw at protonmail.com>, ok jmc


Revision tags: OPENBSD_6_4_BASE
# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


# 1.47 28-Jul-2018 ratchov

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

"make sense" deraadt


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.46 03-Jan-2017 natano

Tweak RETURN VALUES section. Move description of sio_pollfd() and
sio_nfds() return values there and add a paragraph about sio_eof().

ok jmc ratchov


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.45 11-Feb-2016 tim

Document how to use sndio in pledged programs.

Input and OK jmc@ ratchov@ semarie@


# 1.44 07-Jan-2016 ratchov

Move sndiod man page to section 8.

suggested by deraadt, fixes from jmc, ok millert


# 1.43 14-Sep-2015 schwarze

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples. This achieves a consistent .Fo and .Fn quoting style
across the whole tree.


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.42 02-Dec-2014 schwarze

Kill the only instance of .Lb in our tree. It is better to not use
it at all, not even occasionally, because there is no sustainable
way (and even less any portable way) to maintain the list of library
names. Besides, without such a list, even the formatting looks bad.
OK jmc@ bentley@


Revision tags: OPENBSD_5_6_BASE
# 1.41 05-Mar-2014 ratchov

say this is the "sndio" api, as we have other audio/midi apis,
makes "man -k" happier.

ok jmc, schwarze


Revision tags: OPENBSD_5_5_BASE
# 1.40 22-Jan-2014 schwarze

clean up macro usage;
tweak and ok ratchov@, ok jmc@


# 1.39 23-Dec-2013 ratchov

- clarify that sio_close() stops the device first, then
frees the handle and not the opposite
- clarify that sio_close() and sio_stop() dont discard
samples in the play buffer.

suggested by Reimar Doeffinger <Reimar.Doeffinger at gmx.de>

ok jmc@


# 1.38 22-Dec-2013 ratchov

- replaces "audio stream" by "audio device", as sndio is a device
abstraction
- remove useless statements.

ok jmc@


Revision tags: OPENBSD_5_4_BASE
# 1.37 04-Jul-2013 ratchov

remove FILES sections because it's incomplete, wrong and doesn't give
any useful information


# 1.36 04-Jul-2013 ratchov

shorten lines in literal blocks to avoid word wraping


# 1.35 05-Jun-2013 tedu

use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarze


# 1.34 06-Apr-2013 ratchov

explain what "default" means in sndio.7 rather than {sio,mio}_open.3,
with tweaks from jmc


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.33 23-May-2012 ratchov

Make the "default" string a valid device name that has the same effect
as NULL has. This will (hopefully) simplify ports where the user
passes the device string.


# 1.32 11-Apr-2012 ratchov

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


Revision tags: OPENBSD_5_1_BASE
# 1.31 24-Dec-2011 jmc

formatting errors, found using freebsd's "igor";


# 1.30 09-Dec-2011 ratchov

mention sndiod rather than aucat when talking about the server


# 1.29 17-Oct-2011 ratchov

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


# 1.28 04-Oct-2011 jmc

some tweaks, from Tim van der Molen


Revision tags: OPENBSD_5_0_BASE
# 1.27 16-Apr-2011 ratchov

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 tags: OPENBSD_4_9_BASE
# 1.26 06-Nov-2010 jmc

tweak previous;


# 1.25 06-Nov-2010 ratchov

make sio_onvol(3) return a integer exposing whether a volume knob
is available for the stream. As we're at it, remove macros and
functions that are neither used nor documented.


Revision tags: OPENBSD_4_8_BASE
# 1.24 26-Apr-2010 jakemsr

once sio_start() has been called, stream parameters cannot be
changed until after sio_stop() is called

ok ratchov@, jmc@


# 1.23 06-Apr-2010 ratchov

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 tags: OPENBSD_4_7_BASE
# 1.22 30-Dec-2009 ratchov

explain what sio_close() drains play buffers as if sio_close() was
called. Since sio_onmove() callback doesn't return negative deltas
anymore, slightly simplify related paragraphs.

siggested by espie@, ok jakemsr@


# 1.21 25-Jul-2009 ratchov

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


# 1.20 25-Jul-2009 ratchov

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 tags: OPENBSD_4_6_BASE
# 1.19 15-May-2009 ratchov

describe sio_getcap(), sio_pollfd() and sio_setvol() retrurn values
spotted by Philipp Schafft


Revision tags: OPENBSD_4_5_BASE
# 1.18 04-Feb-2009 ratchov

update the default socket paths, to reflect recent aucat changes


# 1.17 04-Feb-2009 ratchov

explain that it's ok if we get a slightly different rate than
the one we asked for, from Thomas Pfaff <tpfaff(at)tp76.info>
with tweaks from jmc@


# 1.16 21-Jan-2009 ratchov

fix bugs section: clarify that sio_start() and sio_stop() should
not be used if blocking is not desirable.


# 1.15 21-Jan-2009 ratchov

explain what ``frame'' does mean
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc


# 1.14 12-Jan-2009 ratchov

replace s/routine/function/, as other manuals do
from Thomas Pfaff <tpfaff(at)tp76.info>, thanks!
ok jmc@


# 1.13 08-Jan-2009 jmc

oops, i messed up tim's patch; correction from Tim van der Molen


# 1.12 08-Jan-2009 jmc

a little macro cleanup; from Tim van der Molen


# 1.11 17-Dec-2008 ratchov

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


# 1.10 17-Dec-2008 jmc

tweak previous;


# 1.9 17-Dec-2008 ratchov

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


# 1.8 17-Nov-2008 jmc

occures -> occurs;


# 1.7 16-Nov-2008 ratchov

document that sio_revents() can return POLLHUP


# 1.6 11-Nov-2008 jmc

tweak previous;


# 1.5 11-Nov-2008 ratchov

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


# 1.4 09-Nov-2008 naddy

typos; ok ratchov@ jmc@


# 1.3 07-Nov-2008 ratchov

expose the block size in the sndio API by making par->round writable
and thus remove the ugly rate <-> block-size table from
sio_setpar(3). Handle the block size negociation in aucat(1), since
it has few constrains the code is overally simpler.
ok jakemsr@, major crank suggested by deraadt@


# 1.2 29-Oct-2008 todd

document LIBSIO_DEBUG
ok ratchov@


# 1.1 27-Oct-2008 ratchov

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