From owner-freebsd-questions@FreeBSD.ORG Tue Oct 8 01:46:26 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 764DD33C for ; Tue, 8 Oct 2013 01:46:26 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23A022654 for ; Tue, 8 Oct 2013 01:46:25 +0000 (UTC) Received: from r56.edvax.de (port-92-195-74-65.dynamic.qsc.de [92.195.74.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 3FD3A2761F; Tue, 8 Oct 2013 03:46:18 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r981kBIH001943; Tue, 8 Oct 2013 03:46:11 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 8 Oct 2013 03:46:11 +0200 From: Polytropon To: Frank Leonhardt Subject: Re: How do I ring a bell? Message-Id: <20131008034611.6ff7d5c5.freebsd@edvax.de> In-Reply-To: <52531508.7090206@fjl.co.uk> References: <52529CFF.9030105@fjl.co.uk> <20131007143637.653304bd.freebsd@edvax.de> <52531508.7090206@fjl.co.uk> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Oct 2013 01:46:26 -0000 On Mon, 07 Oct 2013 21:09:44 +0100, Frank Leonhardt wrote: > On 07/10/2013 13:36, Polytropon wrote: > > > Is there any way to make a noise through the built in "bell" speaker > > > found on an IBM PC compatible server box? Writing 007 to the BIOS cout > > > routine might do it, but I've realised I haven't got a clue how to > > do that. > > Making it audible is part of the local terminal emulator, > > either the TTY (text mode) driver or via xterm (or the > > preferred alternative terminal emulator in X). > > Yers, but I'm not running X. Or a character terminal come to that :-) In that case, something line printf "\a" > /dev/console should work - I've just tried it. You can do that from a shell script or maybe even via fprintf() from your own code. > > See the following shell script as an example of what you > > can do: > > Overkill. I have proper work to do rather than working out how to play > appropriate bit silly little tunes for every eventuality. Actually > spkr.c has some useful comments in it - apparently it works the same as > IBM PC BASIC. Now how do I make it polyphonic... By adding more computers. This is the established solution to _every_ IT-related problem. :-) The code in /usr/src/sys/dev/speaker/spkr.c provides a more streamlined interface to sound generation. It's even more "bare metal" than what I remember from Borland Turbo-C: sound(1000); delay(2500); nosound(); It was important not to miss the 3rd line or the "fun" would never end. :-) > > Always make sure that the system actually _has_ got an > > internal speaker! I assume that modern PC hardware could > > have it removed along with floppy drive connector, parallel > > port or power switch. > > Remains to be seen, but most still seem to have one so the BIOS ROM can > make "beep" diagnostic codes if it can't do anything else. This proves that it is present, even if it's not an attached speaker anymore. Many mainboards contain a little piezo speaker directly mounted (my ultracheap home PC does, for example). > >> P.S. "cdcontrol -f /dev/mycdrom eject" is the best I've come up with so > >> far for getting attention. > > That's a really clever idea, never heared of that. It has > > the advantage of being permanent because the drive will > > stay open when the sound of its motor has finished. :-) > > I use it all the time, especially when directing a tech to the > appropriate server in a rack. "It's the one I just popped the CD drive > on". These days servers have the spring-loaded notebook drives instead > of the motorised trays, which is a pity. You could keep winding the > motorised ones in and out until someone spotted it. This seems to be better than those "slot-in" drives I had in one server: no moving parts to the outside. > I suppose if you did > it energetically enough it might catch fire and set off the smoke alarm > (audible). This procedure has been part of an independent quality test of CD recorders, performed by a PC maganzine many years ago. Interesting result: the cheapest drive would last longer than the most expensive one in which the gears automatically had disassembled. :-) > Or leave it wound out with a tin can balanced on it; to make > a noise wind it back in and hear it clatter to the floor. Interesting use for the "4X cup holder". :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...