From owner-freebsd-current@FreeBSD.ORG Sun Apr 27 14:33:26 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F052E51; Sun, 27 Apr 2014 14:33:26 +0000 (UTC) Received: from thyme.infocus-llc.com (server.infocus-llc.com [206.156.254.44]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "*.infocus-llc.com", Issuer "*.infocus-llc.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 183651A09; Sun, 27 Apr 2014 14:33:25 +0000 (UTC) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by thyme.infocus-llc.com (Postfix) with ESMTPSA id 2737237B515; Sun, 27 Apr 2014 09:33:21 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3gGs6m4WGgzYpb; Sun, 27 Apr 2014 09:33:20 -0500 (CDT) Date: Sun, 27 Apr 2014 09:33:20 -0500 From: "Matthew D. Fuller" To: current@freebsd.org Subject: newcons and beeping X Message-ID: <20140427143320.GA7138@over-yonder.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.23 (2014-03-12) X-Virus-Scanned: clamav-milter 0.98.1 at thyme.infocus-llc.com X-Virus-Status: Clean Cc: ray@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 14:33:26 -0000 I switched my workstation over to newcons today, and it worked just fine, so yay. After using it a while, it slowly dawned on me that I wasn't making hardly any typing mistakes, nor was there any annoying email coming in. After all, if either were happing, I'd be getting beeps; vt is making my life easier! ... wait... A little investigation showed that the KDMKTONE ioctl handler was a complete stub, so anything X tried to do to ring the bell was completely unavailing. Urg. That's... unpleasant. >From poking around in vt and comparing with syscons, I've come up with the following patch which makes it work (as the couple beeps I've spawned just writing this email show). It's kinda fugly; should probably be better factored, or less magic-numberized. Possibly vtterm_bell() should be able to take pitch/duration like sc_bell() does. But it's _much_ better than nothing; the bell should work! Index: sys/dev/vt/vt_core.c =================================================================== --- sys/dev/vt/vt_core.c (revision 264991) +++ sys/dev/vt/vt_core.c (working copy) @@ -1636,7 +1636,11 @@ #endif return (0); case KDMKTONE: /* sound the bell */ - /* TODO */ + if(*(int*)data) + sysbeep(1193182 / ((*(int*)data)&0xffff), + (((*(int*)data)>>16)&0xffff)*hz/1000); + else + vtterm_bell(tm); return (0); case KIOCSOUND: /* make tone (*data) hz */ /* TODO */ -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.