Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Mar 2003 09:42:45 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        soralx@cydem.org.ua
Cc:        dougb@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: misc/41772: can't disable keybell [PATCH]
Message-ID:  <XFMail.20030322094245.jhb@FreeBSD.org>
In-Reply-To: <200303212321.30894.soralx@cydem.org.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

On 22-Mar-2003 soralx@cydem.org.ua wrote:
> 
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=41772
> This appears to be _VERY_ old problem (I don't remember
> it on 2.2.7-RELEASE, though)
> In short: the beeper still produces noises (clicks) when
> shut up with `kbdcontrol -b off`

Using kbdcontrol -b off on my laptop running current does
turn off the sound already.  On a stable machine I still
do see the problem.  Incidentally, using quiet.off doesn't
shut it up either which is very confusing since quiet sets
SC_QUIET_BELL.

> (as well a this one:
> 'http://www.FreeBSD.org/cgi/query-pr.cgi?pr=kern/44257' -
> it works well for my EIDE controller).

PCI ID's for the ICH4 controllere were committed prior to 4.7.
However, thanks for your submission.

> FreeBSD 4.6.2-RELEASE:
> =======================8<=======================
> --- ./syscons.c.ORIG  Fri Mar 21 23:10:05 2003
> +++ ./syscons.c       Fri Mar 21 23:10:37 2003
> @@ -3385,6 +3385,9 @@
>      if (scp != scp->sc->cur_scp && (scp->sc->flags & SC_QUIET_BELL))
>       return;
>  
> +    if (!(duration && pitch))
> +     return;
> +
>      if (scp->sc->flags & SC_VISUAL_BELL) {
>       if (scp->sc->blink_in_progress)
>           return;
> =======================8<=======================

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?

-- 

John Baldwin <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030322094245.jhb>