OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.27 / (download) - annotate - [select for diffs], Fri Apr 29 08:30:48 2022 UTC (2 years, 1 month ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.26: +25 -1 lines
Diff to previous 1.26 (colored)

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 1.26 / (download) - annotate - [select for diffs], Mon Nov 1 14:43:24 2021 UTC (2 years, 7 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Stop binding audio devices exposed by sndiod to physical devices

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

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

fixes, help from and ok denis, edd

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 19 08:14:19 2020 UTC (3 years, 6 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.24: +7 -2 lines
Diff to previous 1.24 (colored)

Allow specific devices to be used for play-only and rec-only modes.

Introduce new AUDIO{PLAY,REC}DEVICE environment variables that
override AUDIODEVICE in cases play-only and rec-only mode is
requested.  This allows using different devices for playback and
recording in programs requesting twice the default device (one in
play-only mode and one in rec-only mode).

Based on diffs from Peter J Philipp, semarie, and solene

ok solene, sthen

Revision 1.24 / (download) - annotate - [select for diffs], Sat Jun 29 06:05:26 2019 UTC (4 years, 11 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

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

"Looks right" deraadt

Revision 1.23 / (download) - annotate - [select for diffs], Wed Oct 31 10:06:54 2018 UTC (5 years, 7 months ago) by miko
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.22: +1 -9 lines
Diff to previous 1.22 (colored)

remove a guard in mio_read(), mio_write, sio_read() & sio_write() for a
zero length request. return value of zero is preserved in this case.

OK ratchov@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Sep 19 14:01:52 2018 UTC (5 years, 8 months ago) by miko
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.21: +1 -2 lines
Diff to previous 1.21 (colored)

sys/stat.h not needed here; ok ratchov@

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

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

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

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

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 16 16:48:52 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.18: +1 -2 lines
Diff to previous 1.18 (colored)

Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther

Revision 1.18 / (download) - annotate - [select for diffs], Sun Aug 10 09:11:07 2014 UTC (9 years, 10 months ago) by jsg
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

debug level test for clock_gettime() calls should match
ok ratchov@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Mar 5 20:40:49 2014 UTC (10 years, 3 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.16: +49 -30 lines
Diff to previous 1.16 (colored)

- use relative read/write positions to keep track of buffer
  usage as seen by the caller
- refresh current position before reading/writing data, to keep the
  current position always consistent with read & write pointers
- fix confusion between processed samples by the hardware (as reported
  by GET{I,O}OFFS) and samples played as reported by GETINFO(). Fixes
  incorrect delta propagated after xruns in play-only and rec-only
  modes
- don't wait for POLLIN or POLLOUT to be set to refresh ring pointers,
  as they may not be set in certain cases. Fixes sndiod crash after
  few days of continuous playback.
- save current parameters instead of calling getpar() too often

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

Be less verbose when SNDIO_DEBUG=1 is set.

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

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

ok deraadt, guenther

Revision 1.14 / (download) - annotate - [select for diffs], Sat Aug 24 12:32:34 2013 UTC (10 years, 9 months ago) by ratchov
Branch: MAIN
Changes since 1.13: +109 -51 lines
Diff to previous 1.13 (colored)

Move underrun/overrun recovery code from the sun-api back-end to
the the generic code, so it can be used by other back-ends as well.
No behavior change (hopefully).

Revision 1.13 / (download) - annotate - [select for diffs], Wed Apr 3 03:13:32 2013 UTC (11 years, 2 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.12: +21 -21 lines
Diff to previous 1.12 (colored)

Handle big time_t.
Use clock_gettime(CLOCK_MONOTONIC) instead of gettimeofday() when measuring
time intervals for debugging output.

ok ratchov@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Feb 1 09:02:16 2013 UTC (11 years, 4 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

If par->bufsz is set (it's documented as readonly since years) then
reset it and set par->appbufsz instead

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 27 11:58:08 2012 UTC (11 years, 7 months ago) by ratchov
Branch: MAIN
Changes since 1.10: +8 -3 lines
Diff to previous 1.10 (colored)

check that polled fd number is smaller than SIO_MAXNFDS

Revision 1.10 / (download) - annotate - [select for diffs], Wed May 23 19:25:11 2012 UTC (12 years ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.9: +9 -3 lines
Diff to previous 1.9 (colored)

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.

Revision 1.9 / (download) - annotate - [select for diffs], Fri May 11 07:50:27 2012 UTC (12 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

The default device is selected with sndiod(1) or the AUDIODEVICE
environment variable, so stop using the /dev/audio symlink which
can't be used by sndiod(1) anyway

Revision 1.8 / (download) - annotate - [select for diffs], Wed Apr 11 06:05:43 2012 UTC (12 years, 2 months ago) by ratchov
Branch: MAIN
Changes since 1.7: +11 -10 lines
Diff to previous 1.7 (colored)

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

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

Add a "device number" component in sndio(7) device names, allowing a
single aucat instance to handle all audio and MIDI services. Since
this partially breaks compatibility, this is a opportunitiy to fix few
other design mistakes (eg ':' being used by inet6, type name vs api
name confusion, etc..). This leads to the following names:

        type[@hostname][,unit]/devnum[.option]

The device number is the minor device number for direct hardware
access (ie the 'N' in /dev/audioN). For aucat, this is the occurence
number of the -f (or -M) option.

There's a compatibility hook to keep old names working if only one
aucat server is running.

Revision 1.6 / (download) - annotate - [select for diffs], Mon May 9 17:34:14 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.5: +7 -5 lines
Diff to previous 1.5 (colored)

in sio_psleep(), use an array of SIO_MAXNFDS pollfd strucures rather
than a single one. No behaviour change

Revision 1.5 / (download) - annotate - [select for diffs], Fri May 6 10:25:17 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.4: +22 -15 lines
Diff to previous 1.4 (colored)

use an array of backends and iterate on it, instead of inlining
calls to sio_<backend>_open(). No behaviour change

Revision 1.4 / (download) - annotate - [select for diffs], Fri May 6 07:30:20 2011 UTC (13 years, 1 month ago) by ratchov
Branch: MAIN
Changes since 1.3: +4 -12 lines
Diff to previous 1.3 (colored)

remove almost two years old hack to support legacy audio/midi
device names

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

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

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

Make aucat audio and midi backends share the same code to communicate
with the server. As we're at it use the same protocol for midi and
audio. Now, both audio and midi code use the same SNDIO_DEBUG environment
variable to turn on/off DPRINTF's.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Apr 8 11:18:07 2011 UTC (13 years, 2 months ago) by ratchov
Branch: MAIN

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

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