Bug 30541

Summary: [PATCH] old pccard beep depends on value of HZ
Product: Base System Reporter: Tony Finch <dot>
Component: kernAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Tony Finch 2001-09-13 00:50:01 UTC
The timing of pccard event sounds depends on HZ.

How-To-Repeat: Change HZ to (say) 1000.
Comment 1 dd freebsd_committer freebsd_triage 2001-09-13 12:16:27 UTC
Responsible Changed
From-To: freebsd-bugs->imp

Over to maintainer.
Comment 2 Bruce Evans 2001-09-14 00:24:40 UTC
On Thu, 13 Sep 2001, Tony Finch wrote:

> >Description:
> The timing of pccard event sounds depends on HZ.
> >How-To-Repeat:
> Change HZ to (say) 1000.
>
> Index: sys/pccard/pccard_beep.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/pccard/pccard_beep.c,v
> retrieving revision 1.3.2.3
> diff -u -r1.3.2.3 pccard_beep.c
> --- sys/pccard/pccard_beep.c	2001/06/05 19:11:34	1.3.2.3
> +++ sys/pccard/pccard_beep.c	2001/08/28 22:22:10
> @@ -73,8 +73,10 @@
>  	melody = (struct tone *)arg;
>
>  	if (melody->pitch != 0) {
> -		sysbeep(melody->pitch, melody->duration);
> -		timeout(pccard_beep_sub, melody + 1, melody->duration);
> +		sysbeep(melody->pitch,
> +		    melody->duration * hz / 100);
> +		timeout(pccard_beep_sub, melody + 1,
> +		    melody->duration * hz / 100);
>  	} else
>  		allow_beep = BEEP_ON;
>  }

pccard_beep() also suffers from, or at least adds to the confusion about
the pitch of the beep.  sysbeep()'s "pitch" arg is not actually a pitch;
it is a period in i8254 timer cycles.  The "pitches" in the tone data
appear to already by inverted to compensate for this.

Bruce
Comment 3 Warner Losh freebsd_committer freebsd_triage 2002-09-30 00:48:57 UTC
State Changed
From-To: open->closed

Ooops, this is a duplicate of a bug that was submitted a long time ago. 
It has been fixed.  Sorry I didn't include it in the commit message.