Subject: kern/7665: X server bell pitch setting doesn't reflect reality
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 05/29/1999 21:05:44
>Number:         7665
>Category:       kern
>Synopsis:       X server bell pitch setting doesn't reflect reality
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 29 21:05:00 1999
>Last-Modified:
>Originator:     Dave Sainty
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Release:        NetBSD-current 19990529
>Environment:
>Description:
	An X server compiled for pcvt consoles will XBell() at the wrong
	pitch.  The problem is that the KDMKTONE interface does not take a
	pitch parameter specified in Hz, but as a period.
>How-To-Repeat:
	xset b 70 3000
	<generate beep>
	xset b 70 4000
	<generate beep>

	Notice that the first beep is higher than the second, and both beeps
	are considerably lower than expected.
>Fix:
--- sys/dev/wscons/wsdisplay_compat_usl.orig.c  Sun Jan 31 01:13:14 1999
+++ sys/dev/wscons/wsdisplay_compat_usl.c       Sun May 30 14:33:55 1999
@@ -438,7 +438,7 @@
 #define d (*(int *)data)
                if (d) {
                        bd.which = WSKBD_BELL_DOPITCH | WSKBD_BELL_DOPERIOD;
-                       bd.pitch = d & 0xffff; /* Hz */
+                       bd.pitch = 1193182 /* = PCVT_SYSBEEPF */ / (d & 0xffff); /* Hz */
                        bd.period = d >> 16; /* ms */
                } else
                        bd.which = 0; /* default */
>Audit-Trail:
>Unformatted:
System: NetBSD tequila.dave.dtsp.co.nz 1.3I NetBSD 1.3I (TEQUILA) #3: Tue Jan 5 01:00:19 NZDT 1999 dave@tequila.dave.dtsp.co.nz:/vol/tequila/userC/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386