--- - branch: MAIN date: Wed Apr 15 15:25:33 UTC 2020 files: - new: '1.40' old: '1.39' path: src/lib/libossaudio/ossaudio.c pathrev: src/lib/libossaudio/ossaudio.c@1.40 type: modified - new: '1.80' old: '1.79' path: src/sys/compat/ossaudio/ossaudio.c pathrev: src/sys/compat/ossaudio/ossaudio.c@1.80 type: modified id: 20200415T152533Z.615ccba2e465018ab19b291566c87ecaa6c2c119 log: | ossaudio: Make SNDCTL_DSP_SETFMT conform with OSSv4. 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. module: src subject: 'CVS commit: src' unixtime: '1586964333' user: nia