From nobody Fri Nov 01 16:18:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xg5dS2fvgz5c2ss; Fri, 01 Nov 2024 16:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xg5dS1z0Lz3yfD; Fri, 1 Nov 2024 16:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730477916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=as79dt008Rz0ttQYTQBFflpFIjXfyEPnPXEHtxgd/oI=; b=wrP79q/w8yba4QvErL/nG4p8Wci2+17mty6GEDCRqNQPgl3LLXotbqylZZiNRehQ/C5Bta V0v1j+r0xvZPoVoma5y6XwxQj6M/B7yzpYmg7B4DhQ5UdsHHsKZF1GwCFHPbriJLwDnprS yU6p+zSWHvVGjFJeCxd6EXYvxrftF0ZbYLzVujf7YF7sUuVKIjQmZdtzPCCiFUEsQ5YeRv XMkdi8z2GU5yToUNUYp5+YMzMIGI9wVKTl+zxc7KTsCGKU5geWR3xgdhnepevgMnl1LEtG Hn8WALpvgJiTZEj/GPrE8pZgDeDeDYyNIsNeaXNdqFCfbX264NA3M1FbL6y+XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730477916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=as79dt008Rz0ttQYTQBFflpFIjXfyEPnPXEHtxgd/oI=; b=jvdeyS3eTy2RrYYnWUAECTg5qBx3fH/YM+QW74ZSTsDC691wtVJ+y5Q/ueZ47lqtTBMHNw sBinfKVvrYLd1x5OsTOM4XenwHovKx9fsOpIe+MdKAW7yuJ8BPWtJC87zn8KWgkuS8ox48 VzF86KFkMKvONFymXc9WuJeDGetFinAGn+P1WXRPQ+Jj0X2aBk5MgymPPNikGqTvadR4sU vf8SWzudILqA0REmSkaMGNGqB7syk0W2sPPhOKPrbLoWj/5oNP/vvfH2z9XpZxQvdPtPaa FRFFMIbKqEN+l54JMgTgX9dTNm/Sz6cScNBmpBqyvPIsxWksyVzCnM+QaDK/Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730477916; a=rsa-sha256; cv=none; b=kVqUoXRjCSIesw5ruV0rgPAqvBBXSyQgTlLdZBuyZarPRR6bkEtMOnbzP8Vib/TrKwBvgn V11KCSYYmW6fO1aT36U9iITt4O0SpCOB7cTKbagC6CiTnjre+mM/IQvHqNa7a0EwfsCzf6 LSReJn9Vpi6yB+L6h7Jke4fDti7PRA1Ml5S3YVV/Yn4iXDZkGHoCgnxavWYXgTkoJootiS vujps/7ZJXolCgQtpc5qPCGAO0jl5zXlgFvMy5zhMkuVME0wIgtNYIp1TQJZ7rrzX72Rua 0gpFFVp/eQejko41sWIohkcQLZcvYAB0IMtxVSxPM3n+Ttsa8fWT/DxdbKNRUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xg5dS1Rb6zRrD; Fri, 1 Nov 2024 16:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A1GIa5m087075; Fri, 1 Nov 2024 16:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1GIa5s087072; Fri, 1 Nov 2024 16:18:36 GMT (envelope-from git) Date: Fri, 1 Nov 2024 16:18:36 GMT Message-Id: <202411011618.4A1GIa5s087072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2416be588ea1 - main - vt: Fix frequency calcuation for bell List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2416be588ea113cc06b924ed85861ed3bc391fe0 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2416be588ea113cc06b924ed85861ed3bc391fe0 commit 2416be588ea113cc06b924ed85861ed3bc391fe0 Author: Warner Losh AuthorDate: 2021-11-03 21:55:55 +0000 Commit: Ed Maste CommitDate: 2024-11-01 16:17:36 +0000 vt: Fix frequency calcuation for bell 386BSD provided a MD function sysbeep. This took two arguments (pitch and period). Pitch was jammed into the PIT's divisor directly (which means the argument was expected to sound a tone at '1193182 / pitch' Hz). FreeBSD inherited this interface. In commit e46598588587 (svn 177642, Mar 26 2008), phk changed this function to take a tone to sound in hz. He converted all in-tree instances of 1193182 / hz to just hz (and kept the few misguided folks that passed hz directly unchanged -- this was part of what motivated the change). He converted the places where we pre-computed the 8254 divisor from being pitch to 1193182 / pitch (since that converts the divisor to the frequency and the interfaces that were exposed to userland exposed it in these units in places, continuing the tradition inherited from SCO System V/386 Unix in spots). In 2009, Ed Shouten was contracted by the FreeBSD Foundation to write / finish newcons. This work was done in perforce and was imported into subversion in user/ed/newcons in revision 199072 (https://svnweb.freebsd.org/base?view=revision&revision=199072) which was later imported into FreeBSD by ray@ (Aleksandr Rybalko). From that earliest import into svn import to this date, we ring the bell with: sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); where VT_BELLPITCH was defined to be 800. This results in a bell frequency of 1491Hz, more or less today. This is similar to the frequency that syscons and pcvt used (1493Hz and 1500Hz respectively). This in turn was inherited from 386BSD, it seems, which used the hard coded value 0x31b which is 795 -> 1500Hz. This '800' was intended to be the bell tone (eg 800Hz) and this interface was one that wasn't converted. The most common terminal prior to the rise of PCs was the VT100, which had an approximately 800Hz bell. Ed Shouten has confirmed that the original intent was 800Hz and changing this was overlooked after the change to -current was made. This restors that original intent and makes the bell less obnoxious in the process. Reviewed by: des, adrian Differential Revision: https://reviews.freebsd.org/D32594 Sponsored by: Netflix (cherry picked from commit ba48d52ca6c867559156dd916631f9ac47abe80f) This change was accidentally reverted in 80f21bb039ce. --- sys/dev/vt/vt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index a579183658fa..8f5e45306d61 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -119,7 +119,7 @@ static const struct terminal_class vt_termclass = { /* Bell pitch/duration. */ #define VT_BELLDURATION (SBT_1S / 20) -#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ +#define VT_BELLPITCH 800 #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number)