From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 9 20:20:21 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7D1106566B for ; Fri, 9 Jan 2009 20:20:21 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from acme.spoerlein.net (cl-43.dus-01.de.sixxs.net [IPv6:2a01:198:200:2a::2]) by mx1.freebsd.org (Postfix) with ESMTP id D96978FC16 for ; Fri, 9 Jan 2009 20:20:20 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from roadrunner.spoerlein.net (e180158134.adsl.alicedsl.de [85.180.158.134]) by acme.spoerlein.net (8.14.2/8.14.2) with ESMTP id n09KKF9Z012908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 Jan 2009 21:20:18 +0100 (CET) (envelope-from uspoerlein@gmail.com) Received: from roadrunner.spoerlein.net (localhost [127.0.0.1]) by roadrunner.spoerlein.net (8.14.3/8.14.3) with ESMTP id n09KC2Jm002933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Jan 2009 21:12:02 +0100 (CET) (envelope-from uspoerlein@gmail.com) Received: (from uqs@localhost) by roadrunner.spoerlein.net (8.14.3/8.14.3/Submit) id n09KC1NA002932; Fri, 9 Jan 2009 21:12:01 +0100 (CET) (envelope-from uspoerlein@gmail.com) Date: Fri, 9 Jan 2009 21:12:01 +0100 From: Ulrich Spoerlein To: perryh@pluto.rain.com Message-ID: <20090109201201.GA1538@roadrunner.spoerlein.net> Mail-Followup-To: perryh@pluto.rain.com, guru@unixarea.de, vladimirt@partygaming.com, freebsd-hackers@freebsd.org References: <20090107181032.GA2808@rebelion.Sisis.de> <1231398405.2842.1.camel@daemon2.partygaming.local> <20090108080708.GE1462@roadrunner.spoerlein.net> <4966e5b7.sTBBp+JY+DDMKG47%perryh@pluto.rain.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4966e5b7.sTBBp+JY+DDMKG47%perryh@pluto.rain.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@freebsd.org, guru@unixarea.de, vladimirt@partygaming.com Subject: Re: /dev/dsp* & /dev/audio* devices not present X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2009 20:20:22 -0000 On Thu, 08.01.2009 at 21:50:47 -0800, perryh@pluto.rain.com wrote: > Ulrich Spoerlein wrote: Ummm, out of curiosity, are your receiving your mail via UUCP? :) > > Please run > > % cat /dev/sndstat > > % ls -l /dev/dsp0 /dev/dsp0.0 > > > > The reason you are not seeing them with 'ls /dev/dsp*' is because > > devfs is creating the nodes when they are open(2)'ed. Using shell > > globbing will search the output of readdir(2) for matches to dsp* > > where devfs has no way of dynamically creating nodes (which ones > > should it create anyway?) > > In principle, everything that would be successfully created if > open(2)'ed. It doesn't necessarily need to actually create them, > but the results from readdir(2) should be as if they had been > created. The whole point of things like ls(1) and readdir(2) is > to find out what-all is available to be opened, without having to > already know the answer. Not according to my understanding, which may be flawed of course. devfs(4) would have to create all devices, which may be open(2)ed up front, for dsp that would have to be 32 instances (for my system): % ll /dev/dsp0.{0,9,11,21,31} crw-rw-rw- 1 root wheel 0, 142 Jan 9 20:57 /dev/dsp0.0 crw-rw-rw- 1 root wheel 0, 153 Jan 9 20:20 /dev/dsp0.11 crw-rw-rw- 1 root wheel 0, 154 Jan 9 20:20 /dev/dsp0.21 crw-rw-rw- 1 root wheel 0, 151 Jan 9 20:20 /dev/dsp0.31 crw-rw-rw- 1 root wheel 0, 152 Jan 9 20:20 /dev/dsp0.9 It would also cloud the information about devices in-use. > > This is a FAQ really. > > It may be an FAQ, but it is also a bug, granted one that may not be > easy to fix. You really want all cloneable instances to show up with a readdir, which would mean that they would have to created upon device attachment? I really don't think so ... For /dev/dsp0 the semantics are pretty clear: try to open /dev/dsp0, if it succeeds fine, if not, there is no vchan available and you're SOL. No need to play the guess-a-free-dsp-device game. Cheers, Ulrich Spoerlein -- It is better to remain silent and be thought a fool, than to speak, and remove all doubt.