From kh@mogami-wire.co.jp  Mon Mar 16 16:40:30 1998
Received: from eve.mogami-wire.co.jp (eve.mogami-wire.co.jp [210.161.93.162])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA24606
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Mar 1998 16:40:29 -0800 (PST)
          (envelope-from kh@mogami-wire.co.jp)
Received: (from kh@localhost) by eve.mogami-wire.co.jp (8.7.6+2.6Wbeta7/3.4Wbeta5-eve) id JAA13458; Tue, 17 Mar 1998 09:40:23 +0900 (JST)
Message-Id: <199803170040.JAA13458@eve.mogami-wire.co.jp>
Date: Tue, 17 Mar 1998 09:40:23 +0900 (JST)
From: kh@mogami-wire.co.jp
Reply-To: kh@mogami-wire.co.jp
To: FreeBSD-gnats-submit@freebsd.org, kh@eve.mogami-wire.co.jp
Subject: kbdcontrol(1) and syscons device driver
X-Send-Pr-Version: 3.2

>Number:         6037
>Category:       bin
>Synopsis:       inconsistency between kbdcontrol(1) and syscons device driver.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 16 16:50:03 PST 1998
>Closed-Date:    Mon Aug 3 02:20:46 PDT 1998
>Last-Modified:  Mon Aug  3 02:21:10 PDT 1998
>Originator:     Kouichi Hirabayashi
>Release:        FreeBSD 2.1.5-RELEASE i386
>Organization:
Mogami Wire & Cable Corp.
>Environment:
	system console

>Description:

Current kbdcontrol(1) manual has not enough information to set
bel duration and pitch.  Here is a possible patch to /usr/shar/
man/man1/kbdcontrol.1.

*** ORGkbdcontrol.1	Tue Mar 17 08:37:25 1998
--- /usr/shar/man/man1/kbdcontrol.1	Tue Mar 17 08:47:45 1998
***************
*** 37,43 ****
  The following command line options are supported:
  .Bl -tag -width indent
  .It Fl b Ar duration.pitch | Ar belltype
! Set the bell duration and pitch values. 
  If a 
  .Ar belltype
  argument is specified, it may be one of 
--- 37,43 ----
  The following command line options are supported:
  .Bl -tag -width indent
  .It Fl b Ar duration.pitch | Ar belltype
! Set the bell duration in 1/10 seconds and pitch in 838.1 nanoseconds. 
  If a 
  .Ar belltype
  argument is specified, it may be one of 

>How-To-Repeat:


>Fix:

But there is inconsistency between kbdcontrol(1) and syscons device
drive as for their default value.

                                bell duration
-----------------------------------------------
/sys/i386/isa/syscons.c          50 miliseconds
/usr/src/usr.sbin/kbdcontrol.c  100 miliseconds


Perhaps more reasonable way is changing unit of pitch and duration
to in hertz (pitch) and miliseconds (duration) as follow.


*** ORGkbdcontrol.1	Tue Mar 17 08:37:25 1998
--- /usr/shar/man/man1/kbdcontrol.1	Tue Mar 17 08:47:45 1998
***************
*** 37,43 ****
  The following command line options are supported:
  .Bl -tag -width indent
  .It Fl b Ar duration.pitch | Ar belltype
! Set the bell duration and pitch values. 
  If a 
  .Ar belltype
  argument is specified, it may be one of 
--- 37,43 ----
  The following command line options are supported:
  .Bl -tag -width indent
  .It Fl b Ar duration.pitch | Ar belltype
! Set the bell duration in miliseconds and pitch in hertz. 
  If a 
  .Ar belltype
  argument is specified, it may be one of

 
*** ORGsyscons.c	Tue Mar 17 08:51:25 1998
--- /sys/i386/isa/syscons.c	Tue Mar 17 08:52:06 1998
***************
*** 2457,2463 ****
  	case 'B':   /* set bell pitch and duration */
  	    if (scp->term.num_param == 2) {
  		scp->bell_pitch = scp->term.param[0];
! 		scp->bell_duration = scp->term.param[1]*10;
  	    }
  	    break;
  
--- 2457,2463 ----
  	case 'B':   /* set bell pitch and duration */
  	    if (scp->term.num_param == 2) {
  		scp->bell_pitch = scp->term.param[0];
! 		scp->bell_duration = scp->term.param[1];
  	    }
  	    break;

  
*** ORGkbdcontrol.c	Tue Mar 17 08:53:10 1998
--- /usr/src/usr.sbin/kbdcontrol.c	Tue Mar 17 08:59:33 1998
***************
*** 459,467 ****
  	int bell, duration, pitch;
  
  	if (!strcmp(opt, "visual"))
! 		bell = 1, duration = 1, pitch = 800;
  	else if (!strcmp(opt, "normal"))
! 		bell = 0, duration = 1, pitch = 800;
  	else {
  		char		*v1;
  
--- 459,467 ----
  	int bell, duration, pitch;
  
  	if (!strcmp(opt, "visual"))
! 		bell = 1, duration = 5, pitch = 800;
  	else if (!strcmp(opt, "normal"))
! 		bell = 0, duration = 5, pitch = 800;
  	else {
  		char		*v1;
  
***************
*** 476,481 ****
--- 476,484 ----
  			warnx("argument to -b must be DURATION.PITCH");
  			return;
  		}
+ 		if (pitch != 0)
+ 			pitch = 1193182 / pitch;	/* in Hz */
+ 		duration /= 10;	/* in 10 m sec */
  	}
  
  	ioctl(0, CONS_BELLTYPE, &bell);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: yokota 
State-Changed-When: Mon Aug 3 02:20:46 PDT 1998 
State-Changed-Why:  
Fixed in syscons.c 1.268 and kbdcontrol.c 1.15. 
>Unformatted:
