From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 12 18:17:13 2010 Return-Path: Delivered-To: freebsd-multimedia@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D194A1065670; Tue, 12 Jan 2010 18:17:13 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 8A1E88FC15; Tue, 12 Jan 2010 18:17:13 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id BFAAC1E0076C; Tue, 12 Jan 2010 19:17:11 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o0CHo3Le008933; Tue, 12 Jan 2010 18:50:03 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o0CHo2h4008932; Tue, 12 Jan 2010 18:50:02 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Tue, 12 Jan 2010 18:50:02 +0100 To: Alexander Motin Message-ID: <20100112175002.GA8721@triton8.kn-bremen.de> References: <20100109215928.GA93188@triton8.kn-bremen.de> <4B4C5C0E.5040301@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B4C5C0E.5040301@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-multimedia@FreeBSD.org, netchild@FreeBSD.org, Juergen Lock , Ryan Beasley Subject: Re: native OSS_GETVERSION ioctl doesn't really work X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 18:17:13 -0000 On Tue, Jan 12, 2010 at 01:25:02PM +0200, Alexander Motin wrote: > Juergen Lock wrote: > > 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