PR: 281713
Details
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
The PR reports that in vt mode the bell frequency is currently 1193182 / desired pitch.
The ioctl is implemented wrong then, no?
No - the pitch is set by the fprintf not the ioctl.
Tracing it through, it gets set by case TP_SETBELLPD in vtterm_param(), which is vt_termclass.tc_param. This is called by termteken_param() which is terminal_drawmethods.tf_param This is called by teken_funcs_param which gets called by teken_subr_cons25_set_bell_pitch_duration. That gets called by generated teken_state.h handler teken_state_9 for \[[=. \[[=%d.%dB is teken's C25BLPD.
The history of bell pitch setting is quite a mess, and it seems different parts have switched between Hz and period-in-units-of-838nS over time. For instance, rG:2aa0aafb2d0f2a6fb36c1f2abb19aaa6e50f832f is "Set bell pitch in hertz and duration in msecs. The change corresponds to syscons.c 1.268." but that change is what introduced the pitch = 1193182 / pitch; calculation in kbdcontrol.
A vt console currently considers \[[=%d.%dB sets the pitch by frequency; period-in-units-of-838nS is a silly way to set the pitch. So regardless of how we got here I believe it makes sense to leave the kernel the way it is, and avoid the 1193182 / pitch calculation in kbdcontrol for vt.
Also we have a slightly strange default vt(4) bell pitch:
#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */
It looks like rG:ba48d52ca6c867559156dd916631f9ac47abe80f was reverted and needs to be reapplied.
If we reapply the default change, I'm good with this and think both changes are 14.2 candidates.