Page MenuHomeFreeBSD

vt(4): Connect to teken's TP_SETBELLPD
ClosedPublic

Authored by imp on Oct 24 2021, 5:56 AM.
Tags
None
Referenced Files
F107191320: D32620.diff
Sat, Jan 11, 10:33 AM
Unknown Object (File)
Mon, Jan 6, 11:29 AM
Unknown Object (File)
Fri, Jan 3, 8:00 AM
Unknown Object (File)
Dec 10 2024, 2:15 AM
Unknown Object (File)
Nov 26 2024, 9:43 AM
Unknown Object (File)
Nov 14 2024, 8:50 PM
Unknown Object (File)
Nov 6 2024, 5:20 AM
Unknown Object (File)
Nov 5 2024, 10:27 AM
Subscribers

Details

Summary

Add the glue needed to listen to TP_SETBELLPD which tekken 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 tekken
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.

Sponsored by: Netflix

Test Plan

Please note: My prior analysis of the 'bug' I found was kinda bogus. The intention seems to have been to use 1491Hz as the tone.
This should allow kbdcontrol to control this but I've done only limited testing.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42328
Build 39216: arc lint + arc unit

Event Timeline

imp requested review of this revision.Oct 24 2021, 5:56 AM
imp created this revision.
imp added reviewers: glebius, manu, des.
tsoome added inline comments.
sys/dev/vt/vt.h
311

not quite sure about the variable use?:) or why (?) in comment?

Pardon my ignorance, what applications are known to configure terminal with TP_SETBELLPD?

Pardon my ignorance, what applications are known to configure terminal with TP_SETBELLPD?

It's not something an application does directly through a call program call.

This is an intenral teken signal to its driver. It's only done when it parses a certain escape sequence.
And that escape sequence is only generated by kbdcontrol -b as far as I know.
There's an rc.conf variable that configures this at boot, though.

imp retitled this revision from vt(4): Connect to tekken's TP_SETBELLPD to vt(4): Connect to teken's TP_SETBELLPD.Oct 25 2021, 9:40 PM
imp added inline comments.
sys/dev/vt/vt.h
311

It's a comment about what locks that field. It likely should be removed here since it was from when I'd mistakenly added it elsewhere early in development.

mav added a subscriber: mav.

I know nothing about teken, but it looks like lost functionality during vt(4) transition. Assuming it works. ;)

This revision is now accepted and ready to land.Oct 26 2021, 1:35 AM
In D32620#737097, @mav wrote:

I know nothing about teken, but it looks like lost functionality during vt(4) transition. Assuming it works. ;)

Yes. It fails to break anything, but I need to try it on a different system that has a speaker connected not in a machine room to be sure...

This revision was automatically updated to reflect the committed changes.