Bug 204837 - kbdcontrol -b (bell control) does not work with vt(4)
Summary: kbdcontrol -b (bell control) does not work with vt(4)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: vt
Depends on:
Blocks: 231027 203349
  Show dependency treegraph
 
Reported: 2015-11-27 00:16 UTC by Ed Maste
Modified: 2024-11-01 16:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2015-11-27 00:16:16 UTC
Documented as:
     -b duration.pitch | belltype
             Set the bell duration in milliseconds and pitch in hertz.  If a
             belltype argument is specified, it may be one of normal which
             sets sound parameters back to normal values, off which disables
             the bell entirely, or visual which sets the bell to visual mode,
             i.e., flashes the screen instead.  If belltype is preceded by the
             word quiet., the bell will not be rung when the ringing process
             is in the background vty.  The visual bell, when chosen, applies
             to all vtys; other bell types can be set individually for each
             vty.

in vt(4) mode kbdcontrol -b has no effect (and does not produce an error).
Comment 1 Ed Maste freebsd_committer freebsd_triage 2024-11-01 16:55:15 UTC
Support added in:

commit 2533eca1c2b9d561c42d28bcb6f1c1c35562fbcc
Author: Warner Losh <imp@FreeBSD.org>
Date:   Wed Nov 3 15:55:42 2021 -0600

    vt(4): Connect to teken's TP_SETBELLPD
    
    Add the glue needed to listen to TP_SETBELLPD which teken uses to
    inform its client drivers about the results of parsing
    \e[=<pitch>;<duration>B. It converts these to a Hz value for the
    tone/pitch of the bell and a duration in ms. There's some loss of
    precision because <pitch> in the escape seuquence is defined to be
    (1193182 / pitch) Hz and <duration> is in 10ms units. Also note that
    kbdcontrol also parses 'off' but then doesn't send the proper escape
    sequence, leading me to wonder if that's another bug since teken
    appears to parse that sequence properly and I've added code here to
    treat that as the same as quiet or disabled.
    
    In general, Hz from 100 to 2000 is good. Outside that range is possible,
    but even at 100Hz the square wave is starting to sound bad and above
    2000Hz the speaker may not respond.
    
    Reviewed by:    mav
    Differential Revision:  https://reviews.freebsd.org/D32620