From owner-freebsd-hackers Mon Mar 24 7:42:13 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBB1937B401 for ; Mon, 24 Mar 2003 07:42:04 -0800 (PST) Received: from mail.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3976343F75 for ; Mon, 24 Mar 2003 07:42:04 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 13138 invoked from network); 24 Mar 2003 15:42:06 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 24 Mar 2003 15:42:06 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h2OFg1Ov092124; Mon, 24 Mar 2003 10:42:01 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200303222312.35930.soralx@cydem.org.ua> Date: Mon, 24 Mar 2003 10:42:01 -0500 (EST) From: John Baldwin To: soralx@cydem.org.ua Subject: Re: misc/41772: can't disable keybell [PATCH] Cc: freebsd-hackers@FreeBSD.ORG X-Spam-Status: No, hits=-19.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 23-Mar-2003 soralx@cydem.org.ua wrote: > >> Using kbdcontrol -b off on my laptop running current does >> turn off the sound already. > > I tested `kbdcontrol -b off` on FreeBSD 5.0-RELEASE, and it > still did not turn off the beeper. I have also checked > 'syscons.c', v. 1.399 ([0]), and foud only one change > concerning keybell: > 'if (cold || shutdown_in_progress || !enable_bell)' - > ('enable_bell' added, which must be "hw.syscons.bell" > sysctl var), that enables to turn the keybell off globally, > but not for separate vtys. > >> Incidentally, using quiet.off doesn't >> shut it up either which is very confusing since quiet sets >> SC_QUIET_BELL. > > I tested this again, and it works fine: > > `kbdcontrol -b quiet.normal` > `(sleep 2;echo -e "\x07";sleep 2)&` > When, after executing this command, i quickly switch to > another vty, I hear no bell; when I stay on the same vty, > I can hear the bell. > >> PCI ID's for the ICH4 controllere were committed prior to 4.7. > > good, found my controller's ID in the latest CVSweb ATA-PCI tree > >> This patch would inadvertently turn off visual bell's if you >> set the duration or pitch to zero manually. A better patch >> might be: >> >> Index: syscons.c >> =================================================================== >> RCS file: /usr/cvs/src/sys/dev/syscons/syscons.c,v >> retrieving revision 1.399 >> diff -u -r1.399 syscons.c >> --- syscons.c 3 Mar 2003 16:24:44 -0000 1.399 >> +++ syscons.c 22 Mar 2003 14:38:58 -0000 >> @@ -3547,7 +3547,7 @@ >> if (scp != scp->sc->cur_scp) >> scp->sc->blink_in_progress += 2; >> blink_screen(scp->sc->cur_scp); >> - } else { >> + } else if (duration != 0 && pitch != 0) { >> if (scp != scp->sc->cur_scp) >> pitch *= 2; >> sysbeep(pitch, duration); >> >> Can you verify that this fix works for you? > > yes, it does > but, I think, this may produce faster code: > + } else if (duration && pitch) { Nope, optimizing like that is the compiler's job, not the authors. Making readable code that follows style conventions leads to code that is easier to maintain. :) > I also found couple more problems: > > 00. > `kbdcontrol -b 128.800` > `(sleep 2;echo -e "\x07";sleep 2)&` > If I stay on the same vty, I hear 800Hz bell, if I switch > to another vty, I hear ~400Hz bell. > > `kbdcontrol -b normal` > `(sleep 2;echo -e "\x07";sleep 2)&` > If I stay on the same vty, I hear normal bell, if I switch > to another vty, I hear a bell with pitch twice as _high_. > > 01. > `kbdcontrol quiet.115.400` - won't set SC_QUIET_BELL flag I have no idea about these other bugs. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message