Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 2024 15:06:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 281713] kbdcontrol -b to set bell frequency is inverted vs sc
Message-ID:  <bug-281713-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281713

            Bug ID: 281713
           Summary: kbdcontrol -b to set bell frequency is inverted vs sc
           Product: Base System
           Version: 14.1-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: divVerent@gmail.com

Note: this bug kinda implies that
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204837 has been "fixed"=
 - the
command definitely does something now, just not the right thing.

Running these shell commands in order:

```
kbdcontrol -b 300.440
sleep 0.1
printf '\a'
sleep 0.4
kbdcontrol -b 300.554
sleep 0.1
printf '\a'
sleep 0.4
kbdcontrol -b 300.659
sleep 0.1
printf '\a'
```

should play an increasing chords, as the frequencies are the ones of the no=
tes
A, C# and E.

And it does this fine when booting with `kern.vty=3Dsc`.

However, it actually plays a decreasing, and too high pitched, chord when in
`vt`! According to audacity, the frequencies actually played are 2659Hz, 21=
49Hz
and 1804Hz.

This can be repro'd right on the "disc1" image.

There is a frequency division here in `kbdcontrol`:

https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/kbdcontrol/kbdcon=
trol.c#L1042

Removing this division statement makes it sound exactly as it should. And in
fact, when multiplying intended and measured frequencies, I get 1169960,
1190546 and 1188836, respectively - all really close to the magic constant =
in
that division.

Thus, I suspect one of two things is the case:

- vt intentionally changed the meaning of the `ESC [ =3D pitch ; duration B`
escape sequence to now express pitch in Hertz, not 8254 timer ticks, but it=
 was
forgotten to make `kbdcontrol` detect whether it's running on vt or syscons=
 and
respond accordingly.
- vt accidentally changed the meaning of the sequence, and should get a fix
added to match up with syscons.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-281713-227>