summaryrefslogtreecommitdiff
path: root/lib/libossaudio/ossaudio.c
AgeCommit message (Collapse)Author
2020-04-02Makes libossaudio use sndio instead of the kernel mixer(4) interface.Alexandre Ratchov
Programs will see the device handled by sndiod (instead of the first one) and will always get access at least the sndiod master level control. If present, hardware master input and output volumes are exposed as well. feedback from landry and sthen, "do it" deraadt
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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.
2018-10-26remove a misleading comment; ok ratchov@miko
2015-04-19Make SNDCLT_DSP_* ioctls return ENOTTY, and remove the correspondingAlexandre Ratchov
code. No ABI change. ok armani@, guenther@, sthen@
2013-03-27rename define to reflect current operating system, as in sys/compatTed Unangst
from tim van der molen
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-04-04simplify SNDCTL_DSP_SETTRIGGERJacob Meuser
- don't mess with the operational mode. that was primarily to be able to set record|play mode for full-duplex, which isn't needed any more. - don't set pause=1. this ioctl isn't supposed to be used for stopping streams. suggestions, ok ratchov
2007-11-12this is the recording source. rename 'source' to 'recsource' and beJacob Meuser
sure to only use 'record.source' instead of possibly 'inputs.source'.
2007-11-12implement SNDCTL_DSP_GETODELAYJacob Meuser
bump minor version ok deanna@
2007-11-06- when we need to do both AUDIO_SETINFO and AUDIO_GETINFO to emulateJacob Meuser
a single OSS ioctl, return the return value and errno from from AUDIO_SETINFO if there was an error, since it's more informative than the return value and errno from AUDIO_GETINFO. also, don't bail if AUDIO_SETINFO fails, because OSS ioctls should return the current value of the parameter they are setting, even if there was an error. - avoid a possible (though highly unlikely) divide by zero in SNDCTL_DSP_GET[IO]SPACE. ok ratchov@
2007-10-08- make SNDCTL_DSP_GETOSPACE much more efficient by using AUDIO_GETPRINOJacob Meuser
instead of AUDIO_GETINFO - make SNDCTL_DSP_GETISPACE return correct values by using AUDIO_GETRRINFO instead of AUDIO_GETINFO - remove calls to setblocksize() from SNDCTL_DSP_GET[IO]SPACE. changing the blocksize inside play or record loops, where these ioctls are most often used, can have serious negative consequences. the blocksize should be "fixed" to a power of 2 before these ioctls are called by using SNDCTL_DSP_SETFRAGMENT or SNDCTL_DSP_GETBLKSIZE. heavily tested by myself. no negative feedback from anyone else. ok ratchov
2007-09-28implement SNDCTL_DSP_[G|S]ETTRIGGERJacob Meuser
SNDCTL_DSP_SETTRIGGER is used to pause and unpause recording and playback data transfers. SNDCTL_DSP_GETTRIGGER returns the paused states. this implementation of SNDCTL_DSP_SETTRIGGER also sets the audio(4) mode (AUMODE_[PLAY|RECORD]), depending on which direction (play, record or both) is to be triggered. this can be used allow OSS audio programs to work in full-duplex mode without changing the audio(4) layer itself. according to OSS docs, SNDCTL_DSP_SETTRIGGER is a fairly important ioctl, and should be used "when even the first read() cannot block." tested to not break any ports currently using SNDCTL_DSP_SETTRIGGER which has been a no-op for quite some time. ok ratchov
2006-02-13revert change that breaks KDE, until we figure out what's wrong.Marc Espie
2006-01-25Fix problem in ioctl() handling in OSS audio emulation which causedBrad Smith
unintentional changes of the audio settings e.g. when running "kphone". Adapted to the userland library from a similar change in the kernel code. ok jakemsr@
2005-01-19compare st_dev/st_ino before declaring the cached values valid; ok miodJason Wright
2003-05-03- make it -Wall cleanAnil Madhavapeddy
- add SNDCTL_DSP_SETDUPLEX emulation (netbsd) - SNDCTL_DSP_POST is a noop to prevent some apps blocking (netbsd) - some man pages fixes (from me and netbsd) - add some more missing #defines for SOUND_MIXER_* (netbsd)
2002-04-24make oss_ioctl varargs.Marc Espie
this is not standard C, but it works on the arches we support, and osscompat is a dirty hack in the first place. ok millert@, tested naddy@
2001-08-18sync up libossaudio with NetBSD changes.Brad Smith
-- - Add __BEGIN_DECLS & __END_DECLS for C++ - Make protection against multiple inclusion non-invasive wrt. name space - Use EAGAIN instead of EWOULDBLOCK. The actual numeric value is same, but EAGAIN is the posixly correct name - Remove white space - Change the behaviour to report emulated encodings, too - Implement SOUND_MIXER_INFO - Implement OSS_GETVERSION - Accept mixer values above max (100) - Handle the info from AUDIO_MIXER_DEVINFO properly, parts of it is opaque - Use accurate rounding in conversion between OSS and OpenBSD volume values - Map OSS mixer device "line1" to native mixer device "aux" -- Some testing by pvalchev@, no response from other testers in over a month and a half.
2001-05-24Fix fragment handling for SNDCTL_DSP_GETxSPACE ioctls; per NetBSD PR/12796.Aaron Campbell
The kernel part of this fixes sound emulation for version 1.37c of the Linux binary of Snes9x (Super Nintendo emulator). The userland equivalent fix should allow espie to remove his local audio hacks in the squeak port.
1998-05-25fix off by one error, reported by nathanw@MIT.EDU.Niels Provos
1998-05-01libossaudio from NetBSD mostly by Lennart Augustsson <augustss@cs.chalmers.se>Niels Provos