Discussion:
native OSS_GETVERSION ioctl doesn't really work
(too old to reply)
Juergen Lock
2010-01-09 21:59:28 UTC
Permalink
While fixing qemu for the upcoming 0.12.1 (or .2) qemu-devel port
I discovered that the OSS_GETVERSION ioctl added by r164613 in 2006,
http://svn.freebsd.org/viewvc/base?view=revision&revision=164613
is only implemented for the mixer device (other than in the Linuxolator),
and on top of that that code is never reached because OSS_GETVERSION
is defined as an _IOR ('M', ...), which are all handled by an
if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) {
...
here,
http://fxr.watson.org/fxr/source/dev/sound/pcm/mixer.c#L1255
and so even if actually done on a mixer device the ioctl ends up failing
with ENXIO.

JFY... :)
Juergen

PS: I guess I can try to make a patch, but only if its needed :)
Alexander Motin
2010-01-12 11:25:02 UTC
Permalink
Post by Juergen Lock
While fixing qemu for the upcoming 0.12.1 (or .2) qemu-devel port
I discovered that the OSS_GETVERSION ioctl added by r164613 in 2006,
http://svn.freebsd.org/viewvc/base?view=revision&revision=164613
is only implemented for the mixer device (other than in the Linuxolator),
and on top of that that code is never reached because OSS_GETVERSION
is defined as an _IOR ('M', ...), which are all handled by an
if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) {
...
here,
http://fxr.watson.org/fxr/source/dev/sound/pcm/mixer.c#L1255
and so even if actually done on a mixer device the ioctl ends up failing
with ENXIO.
JFY... :)
Juergen
PS: I guess I can try to make a patch, but only if its needed :)
Fixed it for mixer in HEAD. I see 4Front OSS also implements it for
sndstat and audio devices. Is it right, or it is some kind of bug or
workaround?
--
Alexander Motin
Juergen Lock
2010-01-12 17:50:02 UTC
Permalink
Post by Alexander Motin
Post by Juergen Lock
While fixing qemu for the upcoming 0.12.1 (or .2) qemu-devel port
I discovered that the OSS_GETVERSION ioctl added by r164613 in 2006,
http://svn.freebsd.org/viewvc/base?view=revision&revision=164613
is only implemented for the mixer device (other than in the Linuxolator),
and on top of that that code is never reached because OSS_GETVERSION
is defined as an _IOR ('M', ...), which are all handled by an
if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) {
...
here,
http://fxr.watson.org/fxr/source/dev/sound/pcm/mixer.c#L1255
and so even if actually done on a mixer device the ioctl ends up failing
with ENXIO.
JFY... :)
Juergen
PS: I guess I can try to make a patch, but only if its needed :)
Fixed it for mixer in HEAD. I see 4Front OSS also implements it for
sndstat and audio devices. Is it right, or it is some kind of bug or
workaround?
I'd say it's right, apps depend on the ioctl being available also on
/dev/dsp etc. too. (Or at least qemu 0.12 does, thats where I
discovered the bug. I haven't looked at other apps so far...)

And thank you for the fix! :)
Juergen

Loading...