--- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -289,7 +289,20 @@ static int oss_open (int in, struct oss_ if (conf.policy >= 0) { int version; - if (ioctl (fd, OSS_GETVERSION, &version)) { + if (ioctl (fd, OSS_GETVERSION, &version) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + /* + * Looks like atm (20100109) FreeBSD knows OSS_GETVERSION + * since 7.x, but currently only on the mixer device (or in + * the Linuxolator), and in the native version that part of + * the code is in fact never reached so the ioctl fails anyway. + * Until this is fixed, just check the errno and if its what + * FreeBSD's sound drivers return atm assume SNDCTL_DSP_POLICY + * works. + */ + && (version = 0x040000), (errno != EINVAL) +#endif + ) { oss_logerr2 (errno, typ, "Failed to get OSS version\n"); } else {