From owner-freebsd-questions@FreeBSD.ORG Sat Dec 26 14:19:53 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 430CC106566C for ; Sat, 26 Dec 2009 14:19:53 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 95C128FC15 for ; Sat, 26 Dec 2009 14:19:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id nBQEJo0O019362; Sun, 27 Dec 2009 01:19:50 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Sun, 27 Dec 2009 01:19:49 +1100 (EST) From: Ian Smith To: Gary Kline In-Reply-To: <20091226120028.0A8FC10657A0@hub.freebsd.org> Message-ID: <20091227001029.N28370@sola.nimnet.asn.au> References: <20091226120028.0A8FC10657A0@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: clicky driver X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 14:19:53 -0000 On Fri, 25 Dec 2009 20:23:22 -0800 Gary Kline wrote: > On Sat, Dec 26, 2009 at 01:10:45AM +0000, Chris Whitehouse wrote: > > Gary Kline wrote: > > >>On Fri, 25 Dec 2009 13:37:13 -0800, Gary Kline wrote: > > >>> at first I'm lookings for a "cots" (commericial, off-the-shelf) > > >>> solution. The XO has stereo speakers and so do the notebooks. > > >>> I am thinking of the 'PC speaker'; something that would sound for > > >>> around a 25th/second, very low and with at least some loudness > > >>> control. > > > > Hi Gary, > > > > someone posted recently about the play-string language for /dev/speaker, > > see speaker(4). Could you do something with that? > > > > btw thanks to whoever posted the play-string code for frere jaques - > > cracked me up :) > > > > Chris Yeah :) I play little tunelets on certain battery power events, when some IP gets blacklisted by some logtailing script, things like that. > Wow; the stuff I've never heard about:-) --I just tried spkrtest > and have no /dev/speaker. # kldload speaker device speaker isn't in kernel GENERIC. If it doesn't work immediately, try adding speaker_load="YES" to /boot/loader.conf .. this assumes that your box _has_ a working speaker, eg beeps once while booting? Some laptops use the sound'card' for speaker, and provide a mixer level. > The short answer [Guess] is no, I dont think so. If getting the > keys to have an auditory feedback with beeps or shorter clicks were > that easy, it would have been done after 15 years. Even Linux > lacks this--and I'd bet Minux too. > > What I've got to do is pick up where I kwit ten years ago with the > kernel driver code and drop the the code to make the speaker-audio > create tiny, brief clicks, preferably low, thunky sounds like ye > ancient IBM Selectrics. You can do quite a lot with various tempos, intervals and frequencies; see speaker(4) and play around. Making a short click or thunk! should be easy enough, but spkrtest and echoing playstrings >/dev/speaker are userland processes; I've no idea how much 'fun' it would be to invoke /dev/speaker ioctls from the kbd drivers. But if you're really keen: % find /sys/ -name "speaker*" -o -name "spkr*" cheers, Ian