summaryrefslogtreecommitdiff
path: root/sys/compat/ossaudio
AgeCommit message (Collapse)Author
2023-06-20compat_ossaudio: Zero-initialize idat before copyout.riastradh
Unclear if there are any paths to the copyout without initialization, but let's play it safe to keep the auditing effort low. XXX pullup-8 XXX pullup-9 XXX pullup-10
2021-09-07sys/compat: Memset zero before copyout.riastradh
Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2020-04-19ossaudio: Avoid giving userland uninitialized memory. Noticed by maxv.nia
The uninitalized field in this structure is `fillers`, an array that simply reserves space for later changes in OSSv4, which this version of the OSS compat layer (specifically for Linux applications) makes no effort to implement.
2020-04-19ossaudio: Implement SNDCTL_DSP_(SET|GET)TRIGGER.nia
2020-04-15ossaudio: If the user's channel count is rejected, use the hardware countnia
2020-04-15ossaudio: Make SNDCTL_DSP_SETFMT conform with OSSv4.nia
The OSSv4 spec says we shouldn't really error if an invalid format is chosen by an application. Things are especially likely to be confused if we return MULAW, since in OSSv4 terms that means that's the native hardware format. Instead, set and return the current hardware format if an invalid format is chosen. For the 24-bit sample formats, note that the NetBSD kernel currently can't handle them in its default configuration, and will return an error code if you attempt to use them. So, if an applicaton requests 24-bit PCM, promote it to 32-bit PCM. According to the spec, this is valid and applications should be checking the return value anyway. In the Linux compat layer, we just use S16LE as a fallback. The OSSv3 headers that are still being shipped with Linux don't contain definitions for fancier formats and we can reasonably expect all applications to support S16LE.
2020-04-15ossaudio: Make SNDCTL_DSP_SPEED more robust when using invalid rates.nia
From the perspective of reading the OSSv4 specification, NetBSD's behaviour when an invalid sample rate is set makes no sense at all: AUDIO_SETINFO simply returns an error code, and then we immediately fall through to getting the sample rate, which is still set to the legacy default of 8000 Hz. Instead, what OSS applications generally expect is that they will be able to receive the actual hardware sample rate. This is very, very unlikely to be 8000 Hz on a modern machine. No functional change when setting a sample rate between the supported rates of 1000 and 192000 Hz. When a rate outside this range is requested, the hardware rate is returned (on modern hardware, generally always 48000 Hz or a multiple of 48000 Hz).
2019-11-03Use record field for recording even onisaki
SNDCTL_DSP_STEREO, SNDCTL_DSP_SETFMT, and SNDCTL_DSP_CHANNELS.
2019-11-02Use record.sample_rate for recording on SNDCTL_DSP_SPEED.isaki
It's kernel side of PR lib/54667.
2019-09-26- "source" is u_long in the kernel (and int in userland). Cast -1 to u_long.christos
- make "s" unsigned since blocksize is too.
2019-08-23Fix error handling, returns an errno, not -1.maxv
2019-02-03- add or adjust /* FALLTHROUGH */ where appropriatemrg
- add __unreachable() after functions that can return but won't in this case, and thus can't be marked __dead easily
2019-02-02Correct debug messages.isaki
2019-02-02Fix minor bugs of SNDCTL_DSP_GETISPACE.isaki
- hiwat is playback-only parameter. - 'bytes' should not be rounded down.
2019-01-29Revert a wrong OSS_SNDCTL_DSP_GETOSPACE part of rev1.70.isaki
- 'fragments' is the number of full free blocks and should not be negative value. - 'bytes' should not be rounded down.
2017-03-24Update compat/ossaudio with GETISPACE/GETOSPACE corrections fromnat
libossaudio.
2014-11-17Define compat modules (but without dependencies yet).uebayasi
2014-09-05Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to getmatt
a correctly typed pointer.
2013-09-19exec modules need to be of the exec kindchristos
2011-10-14Change the vnode locking protocol of VOP_GETATTR() to request at leasthannken
a shared lock. Make all calls outside of file systems respect it. The calls from file systems need review. No objections from tech-kern.
2011-09-06Add support for AFMT_AC3jmcneill
2009-08-22add a lot more debugging and error checking. Alas, skype seems to be happychristos
getting back our values, but still does not work.
2008-11-13compat_ossaudio module, so others can depend on it.ad
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-03-21Catch up with descriptor handling changes. See kern_descrip.c revisionad
1.173 for details.
2008-01-22Add ossaudio support for COMPAT_LINUX32, with help from mrg. With thisjmcneill
change, audio now works on amd64 with native firefox, nspluginwrapper, and the 32-bit linux flash binaries.
2007-12-20Convert all the system call entry points from:dsl
int foo(struct lwp *l, void *v, register_t *retval) to: int foo(struct lwp *l, const struct foo_args *uap, register_t *retval) Fixup compat code to not write into 'uap' and (in some cases) to actually pass a correctly formatted 'uap' structure with the right name to the next routine. A few 'compat' routines that just call standard ones have been deleted. All the 'compat' code compiles (along with the kernels required to test build it). 98% done by automated scripts.
2007-12-08ANSIfy most of the function definitions in sys/compat (but not ndis).dsl
All by the magic of sed ...
2007-12-04Remove all the __Pdsl
2007-11-26Remove the "struct lwp *" argument from all VFS and VOP interfaces.pooka
The general trend is to remove it from all kernel interfaces and this is a start. In case the calling lwp is desired, curlwp should be used. quick consensus on tech-kern
2007-09-18Implement OSS_SNDCTL_DSP_GETODELAY and provide a no-op functionmlelstv
for OSS_SNDCTL_DSP_PROFILE.
2007-06-11Add a new ioctl AUDIO_GETBUFINFO. It works like AUDIO_GETINFO, butjoerg
doesn't obtain the ports, gain and balance related parameters. Those generally require reading from the hardware and therefore are much more expensive to obtain. Modify OSS emulation to use the new ioctl where possible. This reduces CPU usage of mplayer during mp3 playback with my Thinkpad from 20% to < 1% and from 50% to 20% during Xvid playback. Review and comments from jmcneill@
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2007-02-09Merge newlock2 to head.ad
2006-09-03remove unneeded initializer.christos
2006-07-23Use the LWP cached credentials where sane.ad
2006-05-14integrate kauth.elad
2006-03-04Instead of getting properties from calling ioctl with AUDIO_GETINFO, usextraeme
AUDIO_INITINFO(). Now the sound with the linux flash plugin works properly. From OpenBSD.
2005-12-11merge ktrace-lwp.christos
2005-12-08Fix problem in ioctl() handling in OSS audio emulation which causedtron
unintentional changes of the audio settings e.g. when running "kphone". Patch submitted by George Michaelson on "tech-kern@NetBSD.org".
2005-02-26nuke trailing whitespaceperry
2004-11-18getdevinfo():kent
If a mixer item does not match with AudioNsomething, check whether it ends with '.' + AudioNsomething. PR#15441
2003-06-29Back out the lwp/ktrace changes. They contained a lot of colateral damage,fvdl
and need to be examined and discussed more.
2003-06-28Pass lwp pointers throughtout the kernel, as required, so that the lwpid candarrenr
be inserted into ktrace records. The general change has been to replace "struct proc *" with "struct lwp *" in various function prototypes, pass the lwp through and use l_proc to get the process pointer when needed. Bump the kernel rev up to 1.6V
2003-06-23Fix missing call to FILE_UNUSE. From kern/21946, from Todd Vierling.augustss
2003-03-21Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.dsl
Avoids a lot of casting and removes the need for some line breaks. Removed a load of (caddr_t) casts from calls to copyin/copyout as well. (approved by christos - he has a plan to remove caddr_t...)
2003-01-18add compat_ossaudiochristos
2003-01-18Merge the nathanw_sa branch.thorpej
2003-01-12add support for SNDCTL_DSP_SETDUPLEX ioctl to ossaudio emulation codejdolecek
code provided by Andreas Wrede in PR kern/19793
2001-12-24Make SNDCTL_DSP_POST a nop. It's explicitly *not* supposed to sleep, and asmycroft
it's merely advisory (and in fact is implemented as a nop in the OSS->ALSA shim), it should be safe to ignore it.