summaryrefslogtreecommitdiffstats
path: root/lib/libsndio/sio_sun.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-18/+18
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* sys/stat.h not needed here; ok ratchov@miko2018-09-191-2/+1
|
* Use the "new" audio(4) api and delete all the useless code to dealratchov2016-04-071-447/+154
| | | | | | | with artificial complications caused by the old api. No behaviour change. ok armani, semarie
* Make code fit in 80 columns, remove trailing spaces & tabs.ratchov2016-01-091-6/+7
|
* Expose internal functions necessary to open audio devices and midiratchov2015-12-201-3/+9
| | | | ports using existing file descriptors.
* remove unneeded prototypesratchov2015-11-221-3/+1
|
* Don't remove the type component from the device string before passingratchov2015-11-221-7/+13
| | | | | it to the *_open() functions. It's more flexible this way. No behaviour change.
* Split function to initialize the raw device in two parts, one to openratchov2015-11-181-23/+44
| | | | | | the device node, the other to do the initialization. This will allow with minimal changes, work to be done in two process sharing the fd. No behaviour change.
* don't call AUDIO_SETFD ioctl as it's a no-opratchov2015-11-171-13/+2
|
* Validate that midi and audio device numbers are integers.ratchov2015-10-021-2/+8
|
* As device path is known, use its size instead of PATH_MAXratchov2015-10-021-2/+6
|
* Use macros for audio and midi device paths rather than hardcodedratchov2015-10-021-2/+3
| | | | strings. No object change.
* Use new AUDIO_GETPOS ioctl instead of AUDIO_GETxOFFS andratchov2015-07-281-43/+24
| | | | | AUDIO_xERROR. It returns a snapshot of the counters we need and avoids inconsistencies.
* Fix arithmetic mistake causing errors when there are more xruns on theratchov2015-07-241-2/+2
| | | | | record side than on the play side. This almost never happens are record buffer are much larger than play buffers.
* Remove backward compat bits to support for ':' character in sndioratchov2015-02-161-13/+1
| | | | device names. Remove wrong comments.
* Initialize the xrun attribute to SIO_IGNORE in sio_sun_getpar(). Foundratchov2014-11-211-1/+2
| | | | by stu@, thanks!
* Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)guenther2014-08-151-6/+2
| | | | | | | on it, simplifying error checking, reducing system calls, and improving thread-safety for libraries. ok miod@
* - use relative read/write positions to keep track of bufferratchov2014-03-051-12/+15
| | | | | | | | | | | | | | 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
* Be less verbose when SNDIO_DEBUG=1 is set.ratchov2013-12-201-10/+10
|
* Prefix by '_' symbols that are not part of the API.ratchov2013-11-131-7/+7
| | | | ok deraadt, guenther
* Move underrun/overrun recovery code from the sun-api back-end toratchov2013-08-241-88/+19
| | | | | the the generic code, so it can be used by other back-ends as well. No behavior change (hopefully).
* Don't read the xrun counter before the offset in the audio ring,ratchov2012-09-141-25/+25
| | | | | otherwise we'd open a tiny time window during which a xrun may occur in turn making the sio_onmove() clock wrong during one tick.
* Use "unsigned int" rather than "unsigned". No object change.ratchov2012-04-111-19/+21
| | | | suggested by deraadt@
* Correct the spelling of "transferred" and "transferring"guenther2012-02-241-2/+2
| | | | from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
* Add a "device number" component in sndio(7) device names, allowing aratchov2011-11-151-3/+10
| | | | | | | | | | | | | | | | 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.
* determine the default device in backend code instead of the commonratchov2011-05-031-1/+3
| | | | | code. This is simpler as long as not all backends use the same default.
* Make aucat audio and midi backends share the same code to communicateratchov2011-04-161-1/+2
| | | | | | 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.
* Clean up function naming: use sio_<backend>_ prefix for privateratchov2011-04-081-0/+961
audio-related functions and put them in files named sio_<backend>.c No behaviour changes.